I have a feeling I'm doing this all wrong, staffcommand v2
4 replies, posted
local adminGroups = {
["superadmin"] = true,
["senioradmin"] = true,
["admin"] = true,
["moderator"] = true
-- more..
}
hook.Add("OnPlayerChangedTeam", "oldteam", staffoldteam)
function staffoldteam (ply, before, after)
return before
end
hook.Add( "PlayerSay", "StaffArea", function( ply, text, public )
if ( string.lower( text ) == "!staffonduty" ) and adminGroups[ply:GetUserGroup()] then
ply:SetPos(Vector(-13252.610352, -4806.537109, 12207.473633))
ply:GodEnable()
ply:DarkRP.changeTeam(43, true, true)
return ""
end
end )
hook.Add( "PlayerSay", "StaffArea2", function( ply, text, public )
if ( string.lower( text ) == "!staffoffduty" ) and adminGroups[ply:GetUserGroup()] then
ply:SetPos(Vector(11575.844727, -1995.730591, 146.373474))
ply:GodDisable()
ply:DarkRP.changeTeam(staffoldteam() or 1)
return ""
end
end )
hastebin < --- same code just with indents
I have a feeling I'm doing this all wrong, as you can probably tell I'm not the best at glua yet haha, all the help is greatly appreciated!
Sorry yes, there is no lua error, the chat is showing up in chat and if that's not I thing then I must being using this wrong? https://wiki.darkrp.com/index.php/Functions/Player/Server/changeTeam do I not include the DarkRP part?
Correct.
ply:changeTeam is how you call it.
Sorry, you need to Log In to post a reply to this thread.