Jump to content

Fuelsystem need help !!!


Miika

Recommended Posts

BindKey not working

The code is:

(server side)

function setEngineState(player) 
veh = getPedOccupiedVehicle(player) 
state = getVehicleEngineState(veh) 
if veh then 
setVehicleEngineState(veh,not state) 
end 
end 
bindKey ("c", "down", setEngineState) 
  
function command(player,cmd,amount) 
local vehicle = getPedOccupiedVehicle(player) 
local fuel = getElementData(vehicle,"fuel") 
local account = getPlayerAccount(player) 
local name = getAccountName(account) 
if isObjectInACLGroup("user."..name,aclGetGroup("Admin")) then 
if vehicle and tonumber(amount) and (tonumber(fuel) + tonumber(amount)) <= 100 then 
setElementData(vehicle,"fuel",tonumber(amount) + tonumber(fuel)) 
outputChatBox("Your vehicle has been refuelled successfully by Script.("..(amount).."%)",player) 
else 
outputChatBox("Please Type an amount that keep the car fuel below 100%.",player) 
end 
else 
outputChatBox("Access Denied.",255,255,0) 
end 
end 
addCommandHandler("refuel",command) 
  

Sorry my bad english... :)

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...