Код:
public OnGameModeExit()
{
for(new i; i < sizeof(Intro); i++)
{
TextDrawDestroy(Intro[i]);
}
for(new i=0; i<MAX_PLAYERS; i++)
{
SavePlayer(i);
}
return 1;
}
Код:
public OnPlayerDisconnect(playerid, reason)
{
SavePlayer(playerid);
new string[64],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"{AFAFAF}*** %s ïîêèíóë Äðèôò Ìèð (Âûëåò)",name);
case 1: format(string,sizeof string,"{AFAFAF}*** %s ïîêèíóë Äðèôò Ìèð (Âûõîä)",name);
case 2: format(string,sizeof string,"{AFAFAF}*** %s ïîêèíóë Äðèôò Ìèð (Êèê/áàí)",name);
}
SendClientMessageToAll(0xFFFFFFAA,string);
PlayerInfo[playerid][Work]=0;
ta4katest[playerid] = 0;
Musix[playerid]=0;
DestroyVehicle(ta4ka[playerid]);
logged[playerid]=0;
SetPVarInt(playerid,"Login",0);
if(GetPVarInt(playerid, "Kick") != 0) KillTimer(GetPVarInt(playerid, "Kick"));
if(GetPVarInt(playerid, "Ban") != 0) KillTimer(GetPVarInt(playerid, "Ban"));
return 1;
}
Код:
forward SavePlayer(playerid);
public SavePlayer(playerid)
{
new string[64];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "users/%s.ini", playername);
new iniFile = ini_openFile(string);
ini_setInteger(iniFile,"Money",PlayerInfo[playerid][pMoney]);
ini_setInteger(iniFile,"Score",GetPlayerScore(playerid));
ini_setInteger(iniFile,"Skin",PlayerInfo[playerid][Skin]);
ini_setInteger(iniFile,"House",PlayerInfo[playerid][House]);
ini_setInteger(iniFile,"Team",PlayerInfo[playerid][Team]);
ini_setInteger(iniFile,"pAdmin",PlayerInfo[playerid][pAdmin]);
ini_setInteger(iniFile,"Work",PlayerInfo[playerid][Work]);
ini_setInteger(iniFile,"Muted",PlayerInfo[playerid][Muted]);
ini_setInteger(iniFile,"Referee",PlayerInfo[playerid][Referee]);
ini_setInteger(iniFile,"Duel",PlayerInfo[playerid][Duel]);
ini_setInteger(iniFile,"Banned",PlayerInfo[playerid][Banned]);
ini_setInteger(iniFile,"Leader",PlayerInfo[playerid][Leader]);
ini_setInteger(iniFile,"DLose",PlayerInfo[playerid][DLose]);
ini_setInteger(iniFile,"Spawn",PlayerInfo[playerid][Spawn]);
ini_setInteger(iniFile,"DWin",PlayerInfo[playerid][DWin]);
ini_setInteger(iniFile,"TWin",PlayerInfo[playerid][TWin]);
ini_setInteger(iniFile,"iSponsor",PlayerInfo[playerid][iSponsor]);
ini_setInteger(iniFile,"Sp1",PlayerInfo[playerid][Sp1]);
ini_setInteger(iniFile,"Sp2",PlayerInfo[playerid][Sp2]);
ini_setInteger(iniFile,"Sp3",PlayerInfo[playerid][Sp3]);
ini_setInteger(iniFile,"Sp4",PlayerInfo[playerid][Sp4]);
ini_setInteger(iniFile,"Sp5",PlayerInfo[playerid][Sp5]);
ini_setInteger(iniFile,"Sp6",PlayerInfo[playerid][Sp6]);
ini_closeFile(iniFile);
}