SA-MP Forums Archive
SetPlayerVirtualWorld Question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetPlayerVirtualWorld Question (/showthread.php?tid=233433)



SetPlayerVirtualWorld Question - LiamM - 01.03.2011

Hey guys well im coding a gangwars server and I have the LSPD in the gamemode, they can /want and /jail but problem is with Jail everyone spawns on the same virtual world and DM each other in the cell, So I enabled Invulrability to stop DM'ing but is there a way to stick them all on Virtual worlds and for it to detect if one of those worlds are occupied by a prisoner and putting them onto another world.

Thanks


Re: SetPlayerVirtualWorld Question - Marricio - 01.03.2011

Just use a random..
pawn Код:
SetPlayerVirtualWorld(playerid,random(15000));
and if you want them free..
pawn Код:
SetPlayerVirtualWorl(playerid,0);
It will be hard for adding 2 players into one vw of 15000 worlds.


Re: SetPlayerVirtualWorld Question - LiamM - 01.03.2011

Thank you very much I didnt even consider randomizing it. Thank you!


Re: SetPlayerVirtualWorld Question - JaTochNietDan - 01.03.2011

Using random may still end up putting them in the same place, why not just put them in a number unique to their playerid? That also means less functions and more optimization, and for other sakes more predictability of which world they will be in, for example:

pawn Код:
SetPlayerVirtualWorld(playerid, 1000 + playerid);
So then player 0 will be in world 1000, player 50 will be in world 1050 and so on