Menu Punishment for TK
#5

Quote:
Originally Posted by Bakr
View Post
Store the ID of the killer in a per-player variable, and access it inside the callback when necessary
pawn Code:
// global variable
new g_PlayerKiller[ MAX_PLAYERS ] = { INVALID_PLAYER_ID, ... };

//OnPlayerDeath
if( Team[ killerid ] == Team[ playerid ] )
{
   g_PlayerKiller[ playerid ] = killerid;
   // rest of code
}

//OnPlayerSelectedMenuRow
SetPlayerHealth( g_PlayerKiller[ playerid ], 0.00 ); // example punishment, killing the player
g_PlayerKiller[ playerid ] = INVALID_PLAYER_ID;
OK, thanks. But what would I put after the three "...":
pawn Code:
{ INVALID_PLAYER_ID, ... };
Reply


Messages In This Thread
Menu Punishment for TK - by Tigerbeast11 - 26.08.2011, 04:41
Re: Menu Punishment for TK - by Bakr - 26.08.2011, 04:48
Re: Menu Punishment for TK - by Tigerbeast11 - 26.08.2011, 04:58
Re: Menu Punishment for TK - by Bakr - 26.08.2011, 05:12
Re: Menu Punishment for TK - by Tigerbeast11 - 27.08.2011, 01:22

Forum Jump:


Users browsing this thread: 2 Guest(s)