23.05.2014, 09:48
pawn Код:
if (newkeys & KEY_NO)
{
if(GetPlayerState(playerid) == 2)
{
//This part here is defining the vehicle ID that the player is currently in.
new engine, lights, alarm, doors, bonnet, boot, objective; //This is defining the vehicles current items.
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);//This is checking the vehicle's engine/lights/alarm/doors/bonnet/boot/objective status.
if(Engine[vehicle] == 0) //This is checking if the engine of the vehicle, is turned off or not.
{
Engine[vehicle] = 1; //This is setting the global variable that you created at the beginning.
SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnet, boot, 0); //This is setting the vehicles engine to be on.
GameTextForPlayer(playerid, "~w~ENGINE ~g~ON...", 1000, 6);
}
else
{
Engine[vehicle] = 0; //This is setting the global variable that you created at the beginning.
SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0); //This is setting the vehicles engine to be on.
GameTextForPlayer(playerid, "~w~ENGINE ~r~OFF...", 1000, 6);
}
}
}
well maybe the checkgas() is loading more than 1 time ?