[HELP] Saving kills and death
#1

I use Seifadmin, does it will save kills and deaths ?
I made this code:


Код:
//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]++;
}
Reply
#2

How do you save your status and such? Admin Level Password and more?
Reply
#3

Quote:

I use Seifadmin

Seifadmin, Admin script , yes it has register/password/login system. Each account is saved at /scriptfiles/sAccounts/Hot.ini
Reply
#4

HELP ?
Reply
#5

Oh yeah I didn't see the part of saving it with SeifAdmin.
pawn Код:
// 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);
}
Do the same about the kills. I hope you understand from that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)