• DARKRP: If statement on a certain job
    4 replies, posted
Hello guys, can you please help me out again? I wanna make an if statement on an job like: (if job==Mayor) then ply:Kill()
When do you want to kill them?
[QUOTE=code_gs;50450540]When do you want to kill them?[/QUOTE] When they use the command ( It's for a commmand ;) ) But it's the player that use the command that needs to be Mayor
[code]local tCommands = { ["/killmayor"] = true, ["!killmayor"] = true } hook.Add("PlayerSay", "KillMayor", function(pPlayer, sText) if (tCommands[sText]) then if (pPlayer:Team() == TEAM_MAYOR and pPlayer:Alive()) then pPlayer:Kill() else pPlayer:ChatPrint("You must be mayor to run this command!") end end end)[/code]
[QUOTE=code_gs;50451251][code]local tCommands = { ["/killmayor"] = true, ["!killmayor"] = true } hook.Add("PlayerSay", "KillMayor", function(pPlayer, sText) if (tCommands[sText]) then if (pPlayer:Team() == TEAM_MAYOR and pPlayer:Alive()) then pPlayer:Kill() else pPlayer:ChatPrint("You must be mayor to run this command!") end end end)[/code][/QUOTE] Thank you so mutch!
Sorry, you need to Log In to post a reply to this thread.