micheal1230 Posted June 21, 2012 Share Posted June 21, 2012 Well i dont get why it wants a bracket and i cant fix it function isplayeradmin(thePlayer) local isadmin = ( hasObjectPermissionTo ( thePlayer, "command.aexec", true ) ) setElementData(thePlayer, "admin" isadmin) end addEventHandler("onResourceStart", getResourceRootElement(thisResource), isplayeradmin) Link to comment
Kenix Posted June 21, 2012 Share Posted June 21, 2012 setElementData(thePlayer, "admin" isadmin) You forgot ',' here.( it's syntax error ) You don't know lua? or you forgot use ',' here? If you don't know lua. Learn https://forum.multitheftauto.com/viewtop ... 24eb26f3cc Also your variable thePlayer is stated resource.( not player ) Link to comment
micheal1230 Posted June 21, 2012 Author Share Posted June 21, 2012 setElementData(thePlayer, "admin" isadmin) You forgot ',' here.( it's syntax error ) You don't know lua? or you forgot use ',' here? If you don't know lua. Learn https://forum.multitheftauto.com/viewtop ... 24eb26f3cc Also your variable thePlayer is stated resource.( not player ) Forgot The , Link to comment
Wei Posted June 21, 2012 Share Posted June 21, 2012 (edited) function isplayeradmin() local players = getElementsByType ( "player" ) for _,v in ipairs(players) do local isadmin = ( hasObjectPermissionTo ( v, "command.aexec", true ) ) setElementData(v, "admin", isadmin) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), isplayeradmin) Edited June 21, 2012 by Guest Link to comment
Kenix Posted June 21, 2012 Share Posted June 21, 2012 function isplayeradmin() local players = getElementsByType ( "player" ) for _,v in ipairs(players) do local isadmin = ( hasObjectPermissionTo ( v, "command.aexec", true ) ) setElementData(v, "admin", isadmin) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), isplayeradmin) You forgot 'end'. 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