function ParsePlayerText(ply, text)
//!health
if string.find( text, "!health") == 1 then //wenn "!health" an erster stelle
if ply:Alive() != true then //wenn Palyer nicht am leben
ply:ChatPrint( "You are dead.")
else
ply:SetHealth(ply:Health() + 100)
ply:ChatPrint( "Added 100 health.")
end
return ""
end
//!equip
if string.find( text, "!equip") == 1 then
if ply:Alive() != true then
ply:ChatPrint( "You are dead.")
else
ply:Give("weapon_crowbar")
ply:Give("weapon_physcannon")
ply:Give("weapon_physgun")
ply:Give("weapon_pistol")
ply:Give("weapon_357")
ply:Give("weapon_smg1")
ply:Give("weapon_ar2")
ply:Give("weapon_crossbow")
ply:Give("weapon_frag")
ply:Give("weapon_rpg")
ply:Give("gmod_camera")
ply:Give("gmod_tool")
ply:ChatPrint( "Added equipment.")
end
return ""
end
//!ammo
if string.find( text, "!ammo") == 1 then
if ply:Alive() != true then
ply:ChatPrint( "You are dead.")
else
ply:GiveAmmo(100,"pistol")
ply:GiveAmmo(100,"357")
ply:GiveAmmo(100,"smg1")
ply:GiveAmmo(100,"ar2")
ply:GiveAmmo(100,"ar2altfire")
ply:GiveAmmo(100,"crossbow")
ply:ChatPrint( "Added ammo.")
end
return ""
end
//!info
if string.find( text, "!info") == 1 then
ply:ChatPrint( "!health - Adds 100 health.")
ply:ChatPrint( "!equip - Adds all weapons")
ply:ChatPrint( "!ammo - Adds ammo")
return ""
end
return text
end
hook.Add("PlayerSay", "ParsePlayerText", ParsePlayerText)