13.02.2012, 22:50
Nevermind, I just found my careless flaw, it was the placing of my defining of the Engine.
--------------------------------------------------------------------------
EDIT:
--------------------------------------------------------------------------
I editted it to this code:
It compiled with no errors, I go to test it, and it does not work, I want the engine to go on if the engine is off, along with showing the GameTextForPlayer IF it is JUST turning the engine on, not everytime I press my KEY_HANDBRAKE.
--------------------------------------------------------------------------
EDIT:
--------------------------------------------------------------------------
I editted it to this code:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new playerState = GetPlayerState(playerid);
new veh = GetPlayerVehicleID(playerid);
new
engine,
lights,
alarm,
doors,
bonnet,
boot,
objective;
if(newkeys & KEY_HANDBRAKE && playerState == PLAYER_STATE_DRIVER)
{
GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
if(veh, 0, 0, 0, 0, 0, 0)
{
GameTextForPlayer(playerid, "~G~Engine On!", 50000, 3);
new
engine,
lights,
alarm,
doors,
bonnet,
boot,
objective;
GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(veh, 1, lights, alarm, doors, bonnet, boot, objective);
}
}
return 1;
}

