13.06.2010, 15:11
Look at the code;
When player has under 20 HP, it automatic goes on animation, but animation doesnt start, and i want that player cant go out of animation.
Can someone help me, please?
pawn Код:
public CheckPlayerHealth()
{
new string[256];
new sendername[MAX_PLAYER_NAME];
for (new i=0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_ONFOOT)
{
new Float:health;
GetPlayerHealth(i,health);
if(health < 20.0)
{
ApplyAnimation(i, "ped", "FALL_front", 4.0, 1, 0, 0, 0, 0);
TogglePlayerControllable(i, 0);
ApplyAnimation(i, "ped", "FALL_front", 4.0, 1, 0, 0, 0, 0);
SetPlayerHealth(i, 20.0);
GetPlayerName(i, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s atslēdzas un nokrīt uz zemes, jo ir ievainots", sendername);
ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string, sizeof(string), "* Atslēdzies (( %s ))", sendername);
ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(i, COLOR_RED, "Tu esi atslēdzies, gaidi mediķus vai raksti /acceptdeath");
IsOnDeath[i] = 1;
}
}
}
}
Can someone help me, please?