Players in the specific world
#7

Quote:
Originally Posted by Dragonsaurus
Посмотреть сообщение
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);
This is not how hooking works.

https://sampforum.blast.hk/showthread.php?tid=441293

Moreover the OnPlayerVirtualWorldChange must be called when the virtual world is different because if the player move from the a virtual world to the same virtual world, it will call OnPlayerVirtualWorldChange. However, the virtual world was NOT changed.
Reply


Messages In This Thread
Players in the specific world - by ixesas - 04.10.2013, 11:28
Re: Players in the specific world - by Dragonsaurus - 04.10.2013, 11:46
Re: Players in the specific world - by ixesas - 04.10.2013, 11:51
Re: Players in the specific world - by ixesas - 04.10.2013, 12:20
Re: Players in the specific world - by Dragonsaurus - 04.10.2013, 13:05
Re: Players in the specific world - by ixesas - 04.10.2013, 14:27
Re: Players in the specific world - by Konstantinos - 04.10.2013, 14:35
Re: Players in the specific world - by Dragonsaurus - 04.10.2013, 14:40
Re: Players in the specific world - by ixesas - 04.10.2013, 14:54
Re: Players in the specific world - by Dragonsaurus - 04.10.2013, 15:18

Forum Jump:


Users browsing this thread: 1 Guest(s)