Posts: 3,133
Threads: 71
Joined: Dec 2013
Reputation:
0
Virtual worlds (IIRC) can not be changed client side and there are no triggers that change them (e.g: the yellow markers if enabled, they only change interior ID).
That said, you can hook SetPlayerVirtualWorld and call this directly with essentially no negative performance impact already.
Posts: 3
Threads: 1
Joined: May 2014
Reputation:
0
I support this idea. It would help in the issue of some bugs with the virtual world.
Posts: 6,242
Threads: 8
Joined: Jun 2008
You can make this, and the amount of usage it would have is pretty slim...
It's not like an interior that changes often in the game itself, where the VW is forcibly changed by the script anyway, so as Abagail said, you could easily hook into SetPlayerVirtualWorld, and simply track it in this.
Gammix already even made it...
https://sampforum.blast.hk/showthread.php?tid=573961
Quote:
Originally Posted by Gammix
Код:
public OnPlayerVirtualWorldChange(playerid, newworld, oldworld);
|
Posts: 579
Threads: 5
Joined: Oct 2015
Quote:
Originally Posted by raydx
Here you are:
Код:
stock _SetPlayerVirtualWorld(playerid, world)
{
OnPlayerWorldChange(playerid, GetPlayerVirtualWorld(playerid), world);
}
#define SetPlayerVirtualWorld(%0,%1) _SetPlayerVirtualWorld(%0,%1)
|
Nope. This won't change the virtual world, making the Set function fairly useless.
PHP код:
stock S_SetPlayerVirtualWorld( playerid, world )
{
OnPlayerWorldChange( playerid, GetPlayerVirtualWorld(playerid), world );
return SetPlayerVirtualWorld( playerid, world );
}
#if defined _ALS_SetPlayerVirtualWorldOnVirtualWorldChange
#undef SetPlayerVirtualWorld
#else
#define _ALS_SetPlayerVirtualWorld
#endif
#define SetPlayerVirtualWorld S_SetPlayerVirtualWorld
Posts: 6,242
Threads: 8
Joined: Jun 2008
Posts: 1,659
Threads: 17
Joined: Sep 2008
I think what SetPlayerVirtualWorld should be called before OnPlayerWorldChange.
Posts: 6,242
Threads: 8
Joined: Jun 2008
Those 'ALS things' are more advanced than what you are capable of, but do not make them useless.
Posts: 578
Threads: 40
Joined: Dec 2016
why would you even want this when it can only be modified through script and not by a client at all except if the player is using modified game files (asi, samods, cleo etc)
Posts: 1,176
Threads: 2
Joined: Nov 2012
Reputation:
0
client can't change virtual world, so you can create its callback manually, without any incs/plugins.