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
When do you call the animation clear? Under which function? And you sure you haven't added RemovePlayerFromVehicle(vehicleid, playerid)?
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");
}
}