OnPlayerDeath
#1

When anyone kill player, or when i kill player with command, or when player jump, he dont die, he dont see death anim, all other see him death except him. He can run, shoot from gun, kill other players, and after 2-3 seconds he get respawn. I search on forum but i dont find solution.

1. I check if killerid != INVALID_PLAYER_ID
2. I put debug messages, and when player die(for other players), he is in PLAYER_STATE_WASTED, and OnPlayerDeath start and finish, sucessful. After 2-3 sec player see animation for death, and after 4-5 sec OnPlayerSpawn is called...


Do you have any idea for solution?


EDIT: I think i found anything... Everything is called on time, only animation not started on time...

Second found: When i Apply any animation, and then when i die, its okey, animation starts good... Do I need to loop any animation always?
Reply
#2

Try to put ClearAnimations(playerid); under OnPlayerDeath.
Reply
#3

Quote:
Originally Posted by oMa37
Посмотреть сообщение
Try to put ClearAnimations(playerid); under OnPlayerDeath.
Not working again...


Is there any default animation, i need to active any animation before player die...
Reply
#4

new PlayerKills[MAX_PLAYERS] = 0, Dominating[MAX_PLAYERS] = 0;

public OnPlayerDeath(playerid, killerid, reason)
{
new kName[128], string[128];
GetPlayerName(killerid, kName, sizeof(kName));
PlayerKills[killerid] = PlayerKills[killerid] +1;
PlayerKills[playerid] = 0;
if(PlayerKills[killerid] == 4 && Dominating[killerid] == 1)
{
GameTextForAll(string, 6000,4);
GivePlayerMoney(killerid, 1000);
SetPlayerWantedLevel(playerid, 1);
SetPlayerScore(playerid, 1);
return 1;
}
if(PlayerKills[killerid] == 2)
{
GameTextForAll(string, 6000,4);
GivePlayerMoney(killerid, 1500);
SetPlayerWantedLevel(playerid, 2);
SetPlayerScore(playerid, 1);
return 1;
}
if(PlayerKills[killerid] == 3)
{
GameTextForAll(string, 6000,4);
GivePlayerMoney(killerid, 2000);
SetPlayerWantedLevel(playerid, 3);
SetPlayerScore(playerid, 1);
return 1;
}
if(PlayerKills[killerid] == 4)
{
GameTextForAll(string, 6000,4);
GivePlayerMoney(killerid, 2500);
SetPlayerWantedLevel(playerid, 4);
SetPlayerScore(playerid, 1);
return 1;
}
if(PlayerKills[killerid] == 5)
{
GameTextForAll(string, 6000,4);
GivePlayerMoney(killerid, 3000);
SetPlayerWantedLevel(playerid, 5);
SetPlayerScore(playerid, 1);
return 1;
}
if(PlayerKills[killerid] == 6)
{
format(string,128, "~r~%s Most Wanted", kName);
GameTextForAll(string, 6000,4);
GivePlayerMoney(killerid, 15000);
SetPlayerWantedLevel(playerid, 6);
SetPlayerScore(playerid, 1);
}
return 1;
}
Reply
#5

Got this issue my self, and lead to fix it?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)