OnPlayerWirtualWorldChange
#1

Hello.

Is there a similar function as the title?
If there isn't,what should I use instead of that?

Thanks.
Reply
#2

https://sampforum.blast.hk/showthread.php?pid=3456977#pid3456977
Check playercalls.inc branch.

pawn Код:
public OnPlayerVirtualWorldChange(playerid, newworld, oldworld)
{
    return 1;
}
Reply
#3

Use a variable to contain the player's virtual world.

pawn Код:
new g_VirtualWorld[MAX_PLAYERS];
Then under OnPlayerUpdate, check if the value within the array doesn't match the player's current virtual world.

pawn Код:
public OnPlayerUpdate(playerid)
{
    new worldid = GetPlayerVirtualWorld(playerid);
 
    if (g_VirtualWorld[playerid] != worldid)
    {
        g_VirtualWorld[playerid] = worldid;

        // Player changed virtual worlds.
    }
    return 1;
}
Only way to do this, AFAIK.
Reply
#4

Why do you need this? Players can only change VW with SetPlayerVirtualWorld, so you can track yourself what you set.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)