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.