Posts: 708
Threads: 140
Joined: Jan 2013
Reputation:
0
08.06.2013, 16:59
(
Последний раз редактировалось Sellize; 09.06.2013 в 11:18.
)
---------- fixed
When I type /stats my deaths is 1 but when i do /kill and after i respawn do /stats again its still 1
How do I fix this?
Posts: 535
Threads: 36
Joined: Oct 2009
Reputation:
0
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerInfo[playerid][pAlive] = 0;
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
return 1;
}
killerid if you do /kill is INVALID_PLAYER_ID and it's out of bounds of the array.
So do:
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerInfo[playerid][pAlive] = 0;
if (IsPlayerConnected(killerid)) //
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
return 1;
}
Posts: 568
Threads: 28
Joined: Dec 2012
Reputation:
0
It seems that the onplayerdeath callback does not get triggered when you die. I had the same problem and in order to solve this I united the gamemode with the reg/log filterscript. In gamemode the onplayerdeath works fine.
Posts: 708
Threads: 140
Joined: Jan 2013
Reputation:
0
Thanks guys, indeed killerid is unknown in /kill