So, I never actually used this function of DarkRP before. It seems amazingly simple yet it seems to defy me. Maybe I am also amazingly simple
My test code:
local function SSAFire(ply,cmd,args) local tar = FindPlayer(args) if team.GetName(ply:Team()) == "Mayor" then if team.GetName(tar:Team()) == "Secret Service Agent" then tar:TeamBan() tar:ChangeTeam(TEAM_CITIZEN, true) NotifyAll(1, 4, string.format(LANGUAGE.demoted, tar:Nick() .. " By The Mayor")) end end return "" end AddChatCommand("/fire", SSAFire)
However, when typing in chat the command simple removes the command from your chat string and submits the text. So:
would say in chat
Can’t see why, anyone got any ideas?