SA-MP Forums Archive
Help, I'm confused in OnGameModeExit - 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: Help, I'm confused in OnGameModeExit (/showthread.php?tid=457576)



Help, I'm confused in OnGameModeExit - Uberanwar - 12.08.2013

Hi guys, I'm trying to add Code 2 Police Lights into my gamemode. However, I'm always stucked at OnGameModeExit part, and I'm confused. How can I add this
Quote:
Код:
        KillTimer(FlashTimer);
        for (new i = 0; i < MAX_VEHICLES; i++)
        {
                DestroyObject(obj[i]);
                DestroyObject(obj2[i]);
        }
        return 1;
Into my OnGameModeExit?

Quote:
Код:
public OnGameModeExit()
{
	for(new i; i< MAX_PLAYERS; i++)
	{
		if(!IsPlayerConnected(i)) continue;
		TextDrawHideForPlayer(i, Zones[i]);
	}
	for(new p; p<2; p++) KillTimer(TimerKill[p]);
	return 1;
}
Thanks


Re: Help, I'm confused in OnGameModeExit - semaj - 12.08.2013

am not 100% as am new to this ma self but try
pawn Код:
public OnGameModeExit()
{
        KillTimer(FlashTimer);
        for (new i = 0; i < MAX_VEHICLES; i++)
        {
                DestroyObject(obj[i]);
                DestroyObject(obj2[i]);
        }
    for(new i; i< MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        TextDrawHideForPlayer(i, Zones[i]);
    }
    for(new p; p<2; p++) KillTimer(TimerKill[p]);
    return 1;
}



Re: Help, I'm confused in OnGameModeExit - Pottus - 12.08.2013

I'll be honest OnGameModeExit() is not even worth using apart from saving user data. GMX causes client bugs it's best just to completely restart your server.


Re: Help, I'm confused in OnGameModeExit - Uberanwar - 12.08.2013

How about this one

Quote:

public OnGameModeExit()
{
for(new i; i< MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
TextDrawHideForPlayer(i, Zones[i]);
}
for(new p; p<2; p++) KillTimer(TimerKill[p]);

KillTimer(FlashTimer);
for (new i = 0; i < MAX_VEHICLES; i++)
{
DestroyObject(obj[i]);
DestroyObject(obj2[i]);
}

return 1;
}