Posts: 15
Threads: 5
Joined: Jan 2014
Reputation:
0
Now exist OnPlayerInteriorChange(playerid, newinterior, oldinterior), and virtualworlds? Maybe is good idea add this callback.
Sorry for my bad english, but i have this idea and need expose it.
Posts: 3,324
Threads: 96
Joined: Sep 2013
No.
Virtual worlds can only be changed by your script.
Interiors can be changed by GTA itself, just by entering a building. That's why it was important to have the OnPlayerInteriorChange callback.
For virtual worlds you could just call a custom callback in a SetPlayerVirtualWorld hook.
Posts: 3,324
Threads: 96
Joined: Sep 2013
Quote:
Originally Posted by mooman
I think this should work. Insert it at the start.
Код:
SetPlayerVirtualWorldEx(playerid, worldid);
{
new oldworld = GetPlayerVirtualWorld(playerid);
if(oldworld != worldid) {
SetPlayerVirtualWorld(playerid, worldid);
CallRemoteFunction("OnPlayerVirtualWorldChange", "iii", playerid, oldworld, worlid);
}
}
#if defined _ALS_SetPlayerVirtualWorld
#undef SetPlayerVirtualWorld
#else
#define _ALS_SetPlayerVirtualWorld
#endif
#define SetPlayerVirtualWorld SetPlayerVirtualWorldEx
|
Yup, that'll do the trick. Just make sure you also forward the function:
pawn Код:
forward OnPlayerVirtualWorldChange(playerid, oldworld, newworld);