Is there a better way ?
#1

Im making a script that need an OnPlayerWorldChange callback. I know this callback doesnt exist, so i built my own using OnPlayerUpdate, which can be found below. It works, but im just worried its going to put a lot of strain on my server (The OnPlayerWolrdChange needs to have a lot of checks/loops/functions ).

Is there a more efficient way to do this?

Код:
public OnPlayerUpdate(playerid)
{
	pData[playerid][WorldCheck] = GetPlayerVirtualWorld(playerid);
	
	if(pData[playerid][WorldCheck] != pData[playerid][NewWorld])
	{
	  pData[playerid][OldWorld] = pData[playerid][NewWorld];
	  pData[playerid][NewWorld] = pData[playerid][WorldCheck];
	  
	  OnPlayerWorldChange(playerid, pData[playerid][NewWorld], pData[playerid][OldWorld]);
	}
	return 1;
}
Reply


Messages In This Thread
Is there a better way ? - by Kyosaur - 15.03.2010, 08:07
Re: Is there a better way ? - by cessil - 15.03.2010, 09:55
Re: Is there a better way ? - by Mike Garber - 15.03.2010, 11:18
Re: Is there a better way ? - by Kyosaur - 15.03.2010, 11:27
Re: Is there a better way ? - by Mike Garber - 15.03.2010, 11:32
Re: Is there a better way ? - by Kyosaur - 15.03.2010, 11:40
Re: Is there a better way ? - by Desert - 15.03.2010, 12:08
Re: Is there a better way ? - by WackoX - 15.03.2010, 12:11
Re: Is there a better way ? - by Finn - 15.03.2010, 12:29
Re: Is there a better way ? - by Kyosaur - 15.03.2010, 12:40

Forum Jump:


Users browsing this thread: 1 Guest(s)