GamingTim Posted April 14, 2014 Posted April 14, 2014 Well here's the code, I tested it,no errors but the weird thing is that it doesnt output the text to a player. [code=text]function setAdminTeam (player, command) local accName = getAccountName (getPlayerAccount (player)) if isObjectInACLGroup("user."..accName, aclGetGroup ("Admin")) then setPlayerTeam (player, Admin) else outputChatbox ( "Ha, you're not an admin.", player) end end addCommandHandler("togadmin",setAdminTeam) addEventHandler("onPlayerCommand",root,setAdminTeam) [/code]
justn Posted April 14, 2014 Posted April 14, 2014 It's outputChatBox not outputChatbox Datastore - Store data to a database quickly. (Useful for saving scripted tables)
Moderators IIYAMA Posted April 14, 2014 Moderators Posted April 14, 2014 and remove/disable: addEventHandler("onPlayerCommand",root,setAdminTeam) You don't need that. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
GamingTim Posted April 14, 2014 Author Posted April 14, 2014 I usually make noob punctuation and case sensitive errors, thanks alot!
GamingTim Posted April 14, 2014 Author Posted April 14, 2014 and remove/disable: addEventHandler("onPlayerCommand",root,setAdminTeam)You don't need that. Yeah i'll remove that thanks for telling.
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