25.10.2012, 17:41
PHP код:
public OnPlayerDisconnect(playerid, reason){
specby[specto[playerid]]=-1;
specto[playerid]=-1;
specby[playerid]=-1;
PlayersCount--;
Account[playerid][pVotesForKick]=0;
Account[playerid][pVotesForBan]=0;
PlayerInVotekick[playerid]=false;
PlayerInVoteban[playerid]=false;
KillTimer(VoteKickTimer[player]);
KillTimer(VoteBanTimer[player]);
DestroyObject(myobject[playerid]);
DestroyObject(myobject2[playerid]);
DestroyObject(myobject3[playerid]);
DestroyObject(myobject4[playerid]);
DestroyObject(myobject5[playerid]);
for(new i=0;i<MAX_SERVER_PLAYERS;i++){
MyVoteK[i][playerid]=false;
MyVoteB[i][playerid]=false;}
MyVoteC[playerid]=false;
new stringa[128],file[256];
GetPlayerName(playerid, name, sizeof(name));
switch(reason){
case 0: format(stringa, sizeof(stringa), "* [CRASH]: %s has left the server. *", name);
case 1: format(stringa, sizeof(stringa), "* [EXIT]: %s has left the server. *", name);
case 2:{
if(Banned[playerid]==false){
format(stringa, sizeof(stringa), "* [KICK]: %s has been kicked. *", name);}
if(Banned[playerid]==true){
format(stringa, sizeof(stringa), "* [BAN]: %s has been banned!!! *", name);}}}
if(Options[ConnectMessages]==1){
SendClientMessageToAll(COLOR_GREY, stringa);}
print(stringa);
Banned[playerid]=false;
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), UsersFile, pname);
OnPlayerLogout(playerid);
Account[playerid][pMuteWarnings]=0;
Account[playerid][pSpamWarnings]=0;
Account[playerid][pPingWarnings]=0;
Account[playerid][pFloodding]=0;
Account[playerid][pJailed]=false;
Account[playerid][pFreezed]=false;
Account[playerid][pMuted]=false;
Account[playerid][pFlood]=false;
Account[playerid][pVehicleLocked]=false;
Account[playerid][pWarning]=0;
Account[playerid][pBanWarning]=0;
Account[playerid][pSkin]=0;
if(Account[playerid][pLoggedin]==1){
dini_IntSet(file,"muted",0);
dini_IntSet(file,"jailed",0);
dini_IntSet(file,"freezed",0);}
Spawned[playerid]=false;
GodActive[playerid]=false;
ResetPlayerWeapons(playerid);
KillTimer(MuteTimer[playerid]);
KillTimer(JailTimer[playerid]);
return 1;
)