04.10.2013, 13:05
pawn Код:
//First remove the World[100]; from the command and place it on top of your script
new World[100];
// Put this under any public callback (Not inside)
public OnPlayerVirtualWorldChange(playerid, oldworldid, newworldid)
{
World[newworldid]++;
World[oldworldid]--;
return 1;
}
// The code below at the end of your script.
stock SetPlayerVirtualWorld(playerid, worldid)
{
CallLocalFunction("OnPlayerVirtualWorldChange", "ddd", playerid, GetPlayerVirtualWorld(playerid), worldid);
return SetPlayerVirtualWorld(playerid, worldid);
}
#if defined _ALS_SetPlayerVirtualWorld
#undef SetPlayerVirtualWorld
#else
#define _ALS_SetPlayerVirtualWorld
#endif
#define SetPlayerVirtualWorld _ALS_SetPlayerVirtualWorld
forward OnPlayerVirtualWorldChange(playerid, oldworldid, newworldid);