SA-MP Forums Archive
[HELP] Saving kills and death - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Saving kills and death (/showthread.php?tid=68569)



[HELP] Saving kills and death - Hot - 11.03.2009

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]++;
}



Re: [HELP] Saving kills and death - MenaceX^ - 11.03.2009

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


Re: [HELP] Saving kills and death - Hot - 11.03.2009

Quote:

I use Seifadmin

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


Re: [HELP] Saving kills and death - Hot - 11.03.2009

HELP ?


Re: [HELP] Saving kills and death - MenaceX^ - 11.03.2009

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.