12.01.2012, 12:39
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys == KEY_FIRE)
{
if (IsPlayerInAnyVehicle(playerid))
{
SetTimerEx("Engine", 3000, false, "i", playerid);
ApplyAnimation(playerid, "FAT", "IDLE_TIRED", 4.1, 1, 1, 1, 1, 0, 1);
}
}
return 1;
}
public Engine(playerid)
{
new vehid = GetPlayerVehicleID(playerid);
new x = random(2);
if (x == 0)
{
SendClientMessage(playerid, COLOR_ERROR, "Vous n'avez reussi a demarrer le moteur");
ClearAnimations(playerid, 1);
}
else
{
ClearAnimations(playerid, 1);
SetVehicleParamsEx(vehid, 1, 0, 0, 0, 0, 0, 0);
vData[vehid][E_params][0] = 1;
SendClientMessage(playerid, COLOR_GREEN, "Vous avez reussi a demarrer le moteur");
}
}