24.06.2014, 06:14
Код:
public OnPlayerDisconnect(playerid,reason) { new string[128]; numplayers--; mysql_format(SQL, string,128,"UPDATE `users` SET `online`='0' WHERE `ID`='%d' LIMIT 1",PlayerData[playerid][online],PlayerData[playerid][ID]); mysql_tquery(SQL, string, "", ""); if(PlayerData[playerid][SpectateP] != -1) { new id = PlayerData[playerid][SpectateP]; PlayerData[id][WatchingTV] = 0;// PlayerData[id][Spectate] = -2; GameTextForPlayer(id, "~w~ Target~n~~r~ Left", 5000, 6); PlayerPlaySound(id, 1145, 0.0, 0.0, 0.0); PlayerData[playerid][SpectateP] = -1; } switch(reason) { case 0: format(string,sizeof string,"%s exited the game. (crash)", PlayerData[playerid][Name]); case 1: format(string,sizeof string,"%s exited the game. (quit)", PlayerData[playerid][Name]); case 2: format(string,sizeof string,"%s exited the game. (kicked/banned)", PlayerData[playerid][Name]); } ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); TextDrawDestroy(TextDrawSpec[playerid][1]); TextDrawDestroy(TextDrawSpec[playerid][2]); TextDrawDestroy(TextDrawSpec[playerid][3]); TextDrawDestroy(TextDrawSpec[playerid][4]); MysqlRaceCheck[playerid]++; return 1; }