Miika Posted August 5, 2014 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... Real motorbike backflip / frontflip script: https://forum.mtasa.com/viewtopic.php?f=108&t=98191
TAPL Posted August 5, 2014 Posted August 5, 2014 bindKey ("c", "down", setEngineState) Server - Syntax 1 bindKey ( player thePlayer, string key, string keyState, function handlerFunction, [ var arguments, ... ] )
Miika Posted August 5, 2014 Author 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 Real motorbike backflip / frontflip script: https://forum.mtasa.com/viewtopic.php?f=108&t=98191
Addlibs Posted August 5, 2014 Posted August 5, 2014 function onJoin() bindKey(source, "c", "down", setEngineState) end) addEventHandler("onPlayerJoin", root, onJoin) Previously known as MrTasty.
Miika Posted August 5, 2014 Author Posted August 5, 2014 function onJoin() bindKey(source, "c", "down", setEngineState) end) addEventHandler("onPlayerJoin", root, onJoin) I find the proble. But thanks for helping" Real motorbike backflip / frontflip script: https://forum.mtasa.com/viewtopic.php?f=108&t=98191
MightyAnimals Posted August 6, 2014 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. Need help with something? Message me, and maybe I'll get back to you. And might even do it for a fair price.
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