Kill, Death and server Visit counter doesn't work out for me!
#5

Try:
pawn Код:
//At the top
enum pInfo
{
    pKills,
    pDeaths,
    pVisits
}
new PlayerInfo[MAX_PLAYERS][pInfo];

public OnPlayerConnect(playerid)
{
    PlayerInfo[playerid][pVisits]++;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][pKills]++;
    PlayerInfo[playerid][pDeaths]++;
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/stats", cmdtext, true, 10) == 0)//test cmd
    {
       if(IsPlayerConnected(playerid))
       {
           new statstring[128];
           format(statstring, sizeof(statstring), "| Your Stats | Kills: %d | Deaths: %d | Visits: %d |",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pVisits]);
           SendClientMessage(playerid,-1, statstring);
       }
       return 1;
    }
    return 0;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)