14.03.2012, 17:54
thats the onplayerdisconnect
Код:
public OnPlayerDisconnect(playerid, reason) { if(TextdrawActive[playerid] == 1) { TextDrawHideForPlayer(playerid, TextDraw[playerid]); TextDrawDestroy(TextDraw[playerid]); } TextDrawHideForPlayer(playerid,ShadInfoBox[playerid]); TextDrawDestroy(ShadInfoBox[playerid]); SavePlayerAchievements(playerid); for(new a=1; a<=MAX_ACHIEVEMENTS; a++) { ACH_USER[playerid][achprogress][a] = 0; ACH_USER[playerid][achieved][a] = 0; //Fixed. } oplayers--; SaveAccountStats(playerid); new pName[MAX_PLAYER_NAME]; new string[56]; GetPlayerName(playerid, pName, sizeof(pName)); switch(reason) { case 0: format(string, sizeof(string), "**%s has left the Server.(Timeout/Crash)**", pName); case 1: format(string, sizeof(string), "** %s has left the Server. **", pName); case 2: format(string, sizeof(string), "** %s has left the Server.(Kick/Ban)**", pName); } SendClientMessage(playerid,COLOR_RED, string); return 1; }