11.01.2012, 20:10
hi i applied animation for players in vehicle but when I call ClearAnimation(playerid), they was ejected from vehicles why .. sorry for my bad english
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");
}
}