wannacry Posted July 13, 2017 Posted July 13, 2017 I just made a script, This script effects everyone. I just want the "Staff" team not to be effected from this script. What should I do to remove the "staff" team from this script? -- List of commands to disable cmdList = { ["speaker"]=true, ["superman"]=true, } -- Disable unwanted commands addEventHandler("onPlayerCommand", root, function(cmdName) if cmdList[cmdName] then cancelEvent() end end)
AHMED MOSTAFA Posted July 13, 2017 Posted July 13, 2017 Just now, wannacry said: I just made a script, This script effects everyone. I just want the "Staff" team not to be effected from this script. What should I do to remove the "staff" team from this script? -- List of commands to disable cmdList = { ["speaker"]=true, ["superman"]=true, } -- Disable unwanted commands addEventHandler("onPlayerCommand", root, function(cmdName) if cmdList[cmdName] then cancelEvent() end end) test it commandList = { ["speaker"]=true, ["superman"]=true, } function onCommand ( command ) if commandList [ command ] and not ( getTeamName ( getPlayerTeam ( source ) ) == "Staff" ) then cancelEvent() end end addEventHandler("onPlayerCommand", root, onCommand ) April 25, 2016, THE BEGINNING OF MY JOURNEY Check my apps in playStore
koragg Posted July 13, 2017 Posted July 13, 2017 Or if you have a 'Staff' acl group then use this: -- List of commands to disable cmdList = { ["speaker"]=true, ["superman"]=true, } -- Disable unwanted commands function onPlayerCommand(cmdName) local accName = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..accName, aclGetGroup("Staff")) then return end if cmdList[cmdName] then cancelEvent() end end addEventHandler("onPlayerCommand", root, onPlayerCommand) I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux I also love cars PS I'm friendly
wannacry Posted July 13, 2017 Author Posted July 13, 2017 6 minutes ago, Killer Project said: test it commandList = { ["speaker"]=true, ["superman"]=true, } function onCommand ( command ) if commandList [ command ] and not ( getTeamName ( getPlayerTeam ( source ) ) == "Staff" ) then cancelEvent() end end addEventHandler("onPlayerCommand", root, onCommand ) Oh yeah, It works. Thanks for helping.
AHMED MOSTAFA Posted July 13, 2017 Posted July 13, 2017 Just now, wannacry said: Oh yeah, It works. Thanks for helping. your welcome April 25, 2016, THE BEGINNING OF MY JOURNEY Check my apps in playStore
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now