PDA

View Full Version : This is not Wroking


Knucis
04-02-2009, 11:48 AM
This cmd is not working, aint set any speed in the car.
function onPlayerKeyPress(PlayerID, key)
if key == 78 then
if isPlayerInAnyVehicle(PlayerID) == 1 then
setVehicleSpeed(PlayerID, VehicleID, 300)
outputChatBox(PlayerID,"Nitro on!",255,0,0,255)
return
end
end
end

Ettans
04-02-2009, 12:12 PM
Because you haven't defined VehicleID. Add this: VehicleID = getPlayerVehicleID(PlayerID)

Knucis
04-02-2009, 12:47 PM
Oh, it works! Thank you Ettans ;)

Ettans
04-02-2009, 01:11 PM
You're welcome. :P

Boylett
04-02-2009, 02:44 PM
You should use local VehicleID, there's no need to have a global variable storing something you only need for a millisecond.