21.04.2014, 21:58
(
Последний раз редактировалось 1fret; 22.04.2014 в 21:20.
)
pawn Код:
//When player disconnects
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",AdminLevel[playerid]);
INI_WriteInt(File,"Donor",vip[playerid]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_Close(File);
//what happens when you kill someone are when you die
if(killerid != INVALID_PLAYER_ID)
{
SendClientMessage(killerid,0xAA3333AA,"Well Done");
GameTextForPlayer(playerid,"~g~You've Killed A Player And Recieved $2000 + 1 score", 3000, 3);
pScore[killerid]++;
SetPlayerScore(killerid, pScore[killerid]);
GivePlayerMoney(killerid,2000);
SetPlayerWantedLevel(killerid,1);
PlayerKills[killerid] ++;
}
SendClientMessage(playerid,0xAA3333AA,"You have been killed");
GameTextForPlayer(playerid,"~r~You have Been killed And You Lost $1000", 3000, 3);
GivePlayerMoney(playerid,-1000);
PlayerDeaths[playerid] ++;
//the /stats command
CMD:stats(playerid, params[])
{
new target=playerid;
if(!isnull(params)) sscanf(params, "r", target);
new string[200];
format(string, sizeof(string), "%s's Statistics", GetName(playerid));
SendClientMessage(playerid, COLOR_BROWN, string);
format(string, sizeof(string), "[Account]: Score: %i | Money: %i | Kills: %d | Deaths: %d", GetPlayerScore(target), GetPlayerMoney(target), PlayerInfo[target][Kills], PlayerInfo[target][Deaths]);
SendClientMessage(playerid ,COLOR_BROWN, string);
format(string, sizeof(string), "[Levels]: Admin Level: %d | Donor Rank: %d", AdminLevel[target], vip[target]);
SendClientMessage(playerid ,COLOR_BROWN, string);
return 1;
}