Gtagasje Posted November 29, 2011 Share Posted November 29, 2011 hi. I have made this script to set your team to Staff if you are in the admin ACL. But it shows this error: Attempt to concatenate global 'playerName'. (A nill value). Its on line . I dont know how to fix this. I tried, but without succes. But the getACL thing is working in other scripts. What to do.. This is my script (server): local Staff = createTeam ( "Staff", 113, 0, 188 ) function StaffTeam ( source, command ) if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) then setPlayerTeam (source, "Staff") else cancelEvent() end end addCommandHandler("admin", StaffTeam) Link to comment
CapY Posted November 29, 2011 Share Posted November 29, 2011 local Staff = createTeam ( "Staff", 113, 0, 188 ) function StaffTeam ( source, command ) local playerName = getPlayerAccount(source) if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) then setPlayerTeam (source, "Staff") else cancelEvent(true, "You're not allowed to use this command!") end end addCommandHandler("admin", StaffTeam) ? Link to comment
unknooooown Posted November 29, 2011 Share Posted November 29, 2011 hi.I have made this script to set your team to Staff if you are in the admin ACL. But it shows this error: Attempt to concatenate global 'playerName'. (A nill value). Its on line . I dont know how to fix this. I tried, but without succes. But the getACL thing is working in other scripts. What to do.. This is my script (server): local Staff = createTeam ( "Staff", 113, 0, 188 ) function StaffTeam ( source, command ) if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) then setPlayerTeam (source, "Staff") else cancelEvent() end end addCommandHandler("admin", StaffTeam) Don't mind CapY.. He is a little slow.. You are forgetting to define playerName anywhere in your script. You need: local playerName = getPlayerName(source) You also want to do is remove ' "" ' from "Staff" - So: -- This should be changed setPlayerTeam (source, "Staff") -- To this setPlayerTeam (source, Staff) And just before the end, I dont see a reason to use cancelEvent(), in your case, because if the user is not in the Staff group, then nothing will happen. Link to comment
Gtagasje Posted November 29, 2011 Author Share Posted November 29, 2011 Oh, sorry for that, I didnt script a while, and I forgot some things. Link to comment
unknooooown Posted November 29, 2011 Share Posted November 29, 2011 Oh, sorry for that, I didnt script a while, and I forgot some things. No problem Hope my answer could help you. Link to comment
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