//Variables
new Kills[MAX_PLAYERS];
new Deaths[MAX_PLAYERS];
//OnPlayerCommandText
if (strcmp("/status", cmdtext, true, 10) == 0)
{
new stringkills[256];
new stringdeaths[256];
SendClientMessage(playerid,COLOR_LIGHTBLUE,"[SERVER] Your stats:");
format(stringkills,sizeof(stringkills),"Kills: %d", Kills[playerid]);
SendClientMessage(playerid,0xFF9933AA, stringkills);
//
format(stringdeaths,sizeof(stringdeaths),"Mortes: %d", Deaths[playerid]);
SendClientMessage(playerid, 0xFF9933AA, stringdeaths);
return 1;
}
//OnPlayerDeath
Deaths[playerid]++;
if(killerid == INVALID_PLAYER_ID) {
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
}
else if(Gang[playerid] != Gang[playerid]) //
{
SetPlayerScore(killerid,GetPlayerScore(killerid) +1);
GivePlayerMoney(killerid, 2000);
Kills[killerid]++;
//Deaths[playerid]++;
}
|
I use Seifadmin |
// inside 'info' enum
Death,
//OnPlayerDeath
AccountInfo[playerid][Death]++;
//in /status
format(stringdeaths,sizeof(stringdeaths),"Mortes: %d", AccountInfo[playerid][Death]);
SendClientMessage(playerid, 0xFF9933AA, stringdeaths);
//OnPlayerRegister
format(file, sizeof file, "Death: %d\n\r",AccountInfo[playerid][Death]);
{ fwrite(account, file); }
//In the saving varieble
format(file, sizeof file, "Death: %d\n\r",AccountInfo[playerid][Death]);
{ fwrite(account, file); }
//OnPlayerLogin
if (strfind(passres, "Death") != -1)
{
value = GetFileValue(pass);
AccountInfo[playerid][Death] = strval(value);
}