08.11.2011, 11:18
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;
}