SA-MP Forums Archive
Little Help - 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: Little Help (/showthread.php?tid=299655)



Little Help - SpiderWalk - 26.11.2011

Hello everybody.In my Admin System i want to add to command stats kills and deaths and i am asking if this will work:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[playerid][pKills] ++;
    PlayerInfo[playerid][pDeaths] ++;
    return 1;
}



Re: Little Help - Kostas' - 26.11.2011

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[playerid][pDeaths]++;
    if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID) {
        PlayerInfo[killerid][pKills]++;
    }
    return 1;
}



Respuesta: Little Help - TiNcH010 - 26.11.2011

Yeah.
Or you can be use += 1 too.
Example:

pawn Код:
PlayerInfo[playerid][pKills] += 1;
PlayerInfo[playerid][pDeaths] += 1;