Jump to content

Only staff get some vehicles


//_Dragon

Recommended Posts

Yes it's possible.
staffcarss = { 
[520] = true, 
} 
function staffcars ( player, seat, jacked ) 
if staffcarss[getElementModel(source)] then 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin")) then 
else 
cancelEvent() 
outputChatBox ("text", player, 255, 255, 255, true ) 
end 
end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), staffcars ) 

server or client ?

Link to comment
----server

staffcarss = {

[520] = true,

}

function staffcars ( player, seat, jacked )

if staffcarss[getElementModel(source)] then

if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin")) then

else

cancelEvent()

outputChatBox ("You can't get hydra", player, 255, 255, 255, true )

end

end

end

addEventHandler ( "onVehicleStartEnter", getRootElement(), staffcars )

---meta

Link to comment
    staffcarss = { 
    [520] = true, 
    } 
    function staffcars ( player, seat, jacked ) 
    if staffcarss[getElementModel(source)] then 
    if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin")) then 
    cancelEvent() 
    outputChatBox ("Yee must be admin to neter this car matty.", player, 255, 255, 255, true ) 
    else 
    return 
    end 
    end 
    end 
    addEventHandler ( "onVehicleStartEnter", getRootElement(), staffcars ) 

-

Link to comment
    staffcarss = { 
    [520] = true, 
    } 
    function staffcars ( player, seat, jacked ) 
    if staffcarss[getElementModel(source)] then 
    if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin")) then 
    cancelEvent() 
    outputChatBox ("Yee must be admin to neter this car matty.", player, 255, 255, 255, true ) 
    else 
    return 
    end 
    end 
    end 
    addEventHandler ( "onVehicleStartEnter", getRootElement(), staffcars ) 

-

DuDE worke but i wannt only who's admin the hydra will get down & who's not admin hydra will not get down :|

Link to comment

Go to resources/[gameplay]/freeroam and open up the file fr_server.lua.

Find this line;

vehicle = createVehicle(vehID, vx, vy, vz, 0, 0, vrot) 

Try changing it to this;

if(vehID == 520)  then 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then 
        vehicle = createVehicle(vehID, vx, vy, vz, 0, 0, vrot) 
    else 
        outputChatBox("You're not allowed to spawn this vehicle!", source, 187, 0, 0, true) 
    end 
else 
    vehicle = createVehicle(vehID, vx, vy, vz, 0, 0, vrot) 
end 
  

Link to comment

Of course it's possible, but try and do it yourself this time. I already showed you where the relevant code is.

getPlayerMoney -- Check if the player has $25 000 
takePlayerMoney -- If the player can afford it, take away $25 000 of their money 

Edit:

A little hint, you only need to modify this piece of code;

else 
   outputChatBox("You're not allowed to spawn this vehicle!", source, 187, 0, 0, true) 
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...