03.05.2014, 10:53
playerid and killerid are just numbers. Each number represents an index for the array.
So if OnPlayerDeath is called with playerid (0) and killerid (2) and you do:
Keep in mind that if you want to check what value the "Variable" holds for killerid, you'll need to check if killer is not an invalid player (it is when a player dies by themselves).
More informations about arrays:
https://sampwiki.blast.hk/wiki/Scripting_Basics#Arrays
https://sampforum.blast.hk/showthread.php?tid=318212
So if OnPlayerDeath is called with playerid (0) and killerid (2) and you do:
pawn Код:
if (Variable[playerid] == 1) // it's like doing: if (Variable[0] == 1)
{
// some code..
}
pawn Код:
if (killerid != INVALID_PLAYER_ID)
{
if (Variable[killerid] == 0)
{
// some code..
}
}
https://sampwiki.blast.hk/wiki/Scripting_Basics#Arrays
https://sampforum.blast.hk/showthread.php?tid=318212