how can i store the last killer in a variable
#2

1.) You need to save the id of the killer of player killed in a variable.
pawn Код:
Example. MyKiller[playerid] = killerid;
2.) You don't want to use IsPlayerConnected() instead what you want to do is check when a player logs out if they are in another players MyKiller variable.
Example.
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(!IsPlayerConnected(i)) continue;
    if(MyKiller[i] == i) MyKiller[i] = INVALID_PLAYER_ID;

}
3.) Check for a revenge kill on death
pawn Код:
if(MyKiller[killerid] == playerid)
I hope that helps.
Reply


Messages In This Thread
how can i store the last killer in a variable - by GwENiko - 30.09.2014, 04:22
Re: how can i store the last killer in a variable - by Pottus - 30.09.2014, 04:40
Re: how can i store the last killer in a variable - by GwENiko - 30.09.2014, 05:04
Re: how can i store the last killer in a variable - by Pottus - 30.09.2014, 05:09
Re: how can i store the last killer in a variable - by GwENiko - 30.09.2014, 05:16

Forum Jump:


Users browsing this thread: 1 Guest(s)