16.03.2013, 19:21
I'm positive.
OnPlayerDeath:
My /setadmin command.
<-- Just a example of what I have under it.
I also implemented a /savestats command, which still doesn't save there kills/deaths.
OnPlayerDeath:
pawn Код:
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
pawn Код:
PlayerInfo[target][pAdmin] = 1;
I also implemented a /savestats command, which still doesn't save there kills/deaths.
pawn Код:
CMD:savestats(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >=4)
{
new string[128], reason[75];
if(sscanf(params, "s[75]",reason)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /savestats [reason]");
{
foreach (Player, i)
{
new INI:File = INI_Open(UserPath(i));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(i));
INI_WriteInt(File,"Admin",PlayerInfo[i][pAdmin]);
INI_WriteInt(File,"Vip",PlayerInfo[i][pVip]);
INI_WriteInt(File,"Kills",PlayerInfo[i][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[i][pDeaths]);
INI_WriteInt(File,"Ban",PlayerInfo[i][pBan]);
INI_WriteInt(File,"Score",PlayerInfo[i][pScore]);
INI_WriteInt(File,"Talent",PlayerInfo[i][pTalent]);
INI_Close(File);
}
format(string,sizeof(string), "AdmCmd: %s %s has Saved everyones stats. Reason: %s",GetAdminLvlName(playerid),GetName(playerid),reason);
SendClientMessageToAll(COLOR_ORANGE, string);
}
}
else return SendClientMessage(playerid, COLOR_GREY, ERROR);
return 1;
}