SA-MP Forums Archive
Help array under death works only if there is a killer. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help array under death works only if there is a killer. (/showthread.php?tid=308462)



ResetPlayerMoney doesn't work corretly. - liinor - 03.01.2012

This code is under on player death and it works only if someone kills me but not when i do suicide so why doesn't it work when i do suicide?

if(GetPlayerMoney(playerid) > 0) // Check If Player Have more than 0 cash
{
for( new D; D < MAX_dPICKUPS; D++)
{
new Float:X7,Float:Y7,Float:Z7;
GetPlayerPos(playerid,X7,Y7,Z7);
DropMoney[playerid] = GetPlayerMoney(playerid);

SetTimer("message", 60000, false);
pick3[D] = CreatePickup(1212,5,X7,Y7-0.5,Z7);
ResetPlayerMoney(playerid);

}
}


Re: Help array under death works only if there is a killer. - Norck - 03.01.2012

Seems that problem is not here. Probably there is some check like
pawn Код:
if(playerid == killerid)
or
pawn Код:
if(playerid != killerid)
above the code you posted.

Anyway, if you still can't recognize your problem, show more code from OnPlayerDeath callback.


Re: Help array under death works only if there is a killer. - liinor - 04.01.2012

Thx Norck it worked you solved my problem.