[S.K] Posted July 22, 2014 Posted July 22, 2014 i made Car fly but i want to make it for Staff Team only
[S.K] Posted July 22, 2014 Author Posted July 22, 2014 vuelo = false function volar() if (vuelo == false) then vuelo = true setWorldSpecialPropertyEnabled("aircars", true) triggerServerEvent("onFly", getLocalPlayer()) else vuelo = false setWorldSpecialPropertyEnabled("aircars", false) triggerServerEvent("offFly", getLocalPlayer()) end end addCommandHandler("fly", volar) isObjectInACLGroup("Admin") end Whats wrong i can't fly i'm Admin btw i need Occupation i mean Admin Occupation can fly
[S.K] Posted July 22, 2014 Author Posted July 22, 2014 pls help dude i'm scripting anything else and i don't understand this how to do pls do that anyone
Saml1er Posted July 22, 2014 Posted July 22, 2014 Player must be logged in to execute "fly" command. -- server side function Staff_check(v) -- make a custom function so we don't have to write the same code again and again local acc = getPlayerAccount(v) if not isGuestAccount( acc ) then local accountname = getAccountName (acc)) local staff = "YourStaffGroupNameInAcl" -- first add a group in acl and write its name here if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( staff ) ) then setElementData(v,"Staff",true) else setElementData(v,"Staff",nil) end else setElementData(v,"Staff",nil) end end for _,v in pairs ( getElementsByType("player") ) do -- loop through all players Staff_check(v) -- call the function end addEventHandler("onPlayerLogin",root, function () Staff_check(source) end ) --- client side vuelo = false addCommandHandler("fly", function () if getElementData(localPlayer,"Staff") == true then if (vuelo == false) then vuelo = true setWorldSpecialPropertyEnabled("aircars", true) triggerServerEvent("onFly", getLocalPlayer()) else vuelo = false setWorldSpecialPropertyEnabled("aircars", false) triggerServerEvent("offFly", getLocalPlayer()) end end end)
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