15.03.2010, 08:07
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?
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; }