JehadGh Posted May 6, 2019 Share Posted May 6, 2019 (edited) its just not working server-side addEventHandler ( "onPlayerLogin", root, function ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then setElementData( source, "cons", true) else setElementData( source, "cons", false) end end ) client-side function fly() if ( getElementData ( localPlayer, "cons") == true ) then if isWorldSpecialPropertyEnabled("aircars") then setWorldSpecialPropertyEnabled("aircars", false) outputChatBox("its off !", 255, 0, 0) else setWorldSpecialPropertyEnabled("aircars", true) outputChatBox("its on !", 0, 255, 0 )) end elseif ( getElementData ( localPlayer, "cons") == false ) then outputChatBox("You are not a admin") end end addCommandHandler("flyy", fly ) errors : server.lua:3: Bad arrgument @ getPlayerAccount [expected element at argument 1, got account] server.lua:3: Bad arrgument @ getAccountname [expected element at argument 1, got boolean] server.lua:4: attempt to concatenate local 'accName' (a boolean value) thanks . Edited May 6, 2019 by JehadGh Link to comment
Moderators Patrick Posted May 6, 2019 Moderators Share Posted May 6, 2019 https://wiki.multitheftauto.com/wiki/OnPlayerLogin Quote Parameters account thePreviousAccount, account theCurrentAccount thePreviousAccount: the account the player was logged into before. theCurrentAccount: the account the player logged into just now. -- SERVER addEventHandler ( "onPlayerLogin", root, function ( thePreviousAccount, theCurrentAccount ) local accName = getAccountName ( theCurrentAccount ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then setElementData( source, "cons", true) else setElementData( source, "cons", false) end end ) Link to comment
JehadGh Posted May 6, 2019 Author Share Posted May 6, 2019 2 hours ago, stPatrick said: https://wiki.multitheftauto.com/wiki/OnPlayerLogin -- SERVER addEventHandler ( "onPlayerLogin", root, function ( thePreviousAccount, theCurrentAccount ) local accName = getAccountName ( theCurrentAccount ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then setElementData( source, "cons", true) else setElementData( source, "cons", false) end end ) bro you are really kind , thanks alot bro 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