Jump to content

Small help if u can do


[S.K]

Recommended Posts

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

Link to comment

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) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...