OnPlayerDisconnect
#1

Код:
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;
}
Why that query isn't executed sometimes?
Reply
#2

Show the MySQL log.
Reply
#3

Already checked that, MySQL log doesn't show any errors
Reply
#4

pawn Код:
"UPDATE `users` SET `online`='0' WHERE `ID`='%d' LIMIT 1",PlayerData[playerid][online],PlayerData[playerid][ID]
You have only one specifier, while two values to fill it up. The correct query would be -

pawn Код:
"UPDATE `users` SET `online`= 0 WHERE `ID`= %d LIMIT 1", PlayerData[playerid][ID]
Reply
#5

Well if its not showing an error in the Mysql Log then nothing is wrong - If anything is wrong within Mysql Saving / Loading it will say in the Mysql log


Also Use This
Quote:
Originally Posted by RajatPawar
Посмотреть сообщение
pawn Код:
"UPDATE `users` SET `online`='0' WHERE `ID`='%d' LIMIT 1",PlayerData[playerid][online],PlayerData[playerid][ID]
You have only one specifier, while two values to fill it up. The correct query would be -

pawn Код:
"UPDATE `users` SET `online`= 0 WHERE `ID`= %d LIMIT 1", PlayerData[playerid][ID]
Reply
#6

Now, I use that, but nothing change..
Reply
#7

Show us your Mysql Log then
Reply


Forum Jump:


Users browsing this thread: