SA-MP Forums Archive
Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem (/showthread.php?tid=663656)



Problem - SeeNN - 08.02.2019

Hi,I have a problem with database,I do not know why when I restart the server,my statistics don't save,how can I solve,I will leave a link for database to see everyone if is something worng with her.

Link: https://www120.zippyshare.com/v/ZVjf0G00/file.html


Re: Problem - AhmedMohamed - 08.02.2019

Can you show us ongamemodeexit() ?


Re: Problem - SeeNN - 08.02.2019

HTML Code:
public OnGameModeExit()
{
    foreach(new i: Player) OnPlayerDisconnect(i, 1);
    //--------------------------------------------------------------------------
    new x;
	//--------------------------------------------------------------------------
    while (x<500)
	{
        if (x!=(0xFFFF))
		{
            CallRemoteFunction("OnPlayerDisconnect", "i", x);
        }
        ++ x;
    }
    //--------------------------------------------------------------------------
	new ls_Query[1024];
	//--------------------------------------------------------------------------
	for (new i = 1; i < MAX_GANGS; i++)
	{
	    format(ls_Query, sizeof(ls_Query), "UPDATE `GangTers` SET `GangTerOwner` = '%d' WHERE `ID` = '%d'", Teritories[i][owner], i);
	    mysql_tquery(DB_Connect, ls_Query, "", "");
	}
	//--------------------------------------------------------------------------
	OnUpdate(); mysql_close(DB_Connect);
	//--------------------------------------------------------------------------
	return 1;
}



Re: Problem - Florin48 - 08.02.2019

En: How work your restart system?
Ro: Cum functioneaza sistemul de restart, daca e pe timp ar trebui ca la o anumita secundă sa faci sa se salveze toate date de pe server si dupa sa dai restart.


Re: Problem - Kane - 08.02.2019

Well it doesn't look like you're saving any statistics. What does OnUpdate do?

Also: Why?

pawn Code:
while (x<500)
{
    if (x!=(0xFFFF))
    {
        CallRemoteFunction("OnPlayerDisconnect", "i", x);
    }
    ++ x;
}



Re: Problem - SeeNN - 08.02.2019

Quote:
Originally Posted by Florin48
View Post
En: How work your restart system?
Ro: Cum functioneaza sistemul de restart, daca e pe timp ar trebui ca la o anumita secundă sa faci sa se salveze toate date de pe server si dupa sa dai restart.
E facut deja,dar tot mi se intampla sa nu se salveze


Re: Problem - AhmedMohamed - 08.02.2019

Well, it seems like no saving here, What about onplayerdisconnect?