Miika Posted August 5, 2014 Share Posted August 5, 2014 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
TAPL Posted August 5, 2014 Share Posted August 5, 2014 bindKey ("c", "down", setEngineState) Server - Syntax 1 bindKey ( player thePlayer, string key, string keyState, function handlerFunction, [ var arguments, ... ] ) Link to comment
Miika Posted August 5, 2014 Author Share Posted August 5, 2014 bindKey ("c", "down", setEngineState) Server - Syntax 1 bindKey ( player thePlayer, string key, string keyState, function handlerFunction, [ var arguments, ... ] ) bindKey ( player, c, down, setEngineState ) not working Link to comment
Addlibs Posted August 5, 2014 Share Posted August 5, 2014 function onJoin() bindKey(source, "c", "down", setEngineState) end) addEventHandler("onPlayerJoin", root, onJoin) Link to comment
Miika Posted August 5, 2014 Author Share Posted August 5, 2014 function onJoin() bindKey(source, "c", "down", setEngineState) end) addEventHandler("onPlayerJoin", root, onJoin) I find the proble. But thanks for helping" Link to comment
MightyAnimals Posted August 6, 2014 Share Posted August 6, 2014 The bindKey code you had at start. You could've placed that in a client-sided file. It could've been the solution. 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