03.01.2014, 17:29
Hi,
Can anyone tell me how do i make that GameTextForPlayer only shows once when the engine turned on? I mean, when the player already has his/her engine turned on and they press the fire button, it sends the GamText again. More and more whenever they press fire key. I couldn't figure out how to make it showing only once when they turn it on.
Can anyone tell me how do i make that GameTextForPlayer only shows once when the engine turned on? I mean, when the player already has his/her engine turned on and they press the fire button, it sends the GamText again. More and more whenever they press fire key. I couldn't figure out how to make it showing only once when they turn it on.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (GetPlayerVehicleSeat(playerid) == 0)
{
if (newkeys & KEY_FIRE)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
new vehicleid = GetPlayerVehicleID(playerid);
if (AVehicleData[vehicleid][Fuel] > 0)
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
GameTextForPlayer(playerid, "~w~Engine turned ~g~on", 2000, 1);
TextDrawHideForPlayer(playerid, APlayerData[playerid][VState]);
}
}
}
return 1;
}