SA-MP Forums Archive
SetPlayerVirtualWorld(playerid, i); - 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)
+--- Thread: SetPlayerVirtualWorld(playerid, i); (/showthread.php?tid=389823)



SetPlayerVirtualWorld(playerid, i); - MrBlake - 03.11.2012

SetPlayerVirtualWorld(playerid, i);

Код:
Undefined symbol "i"
Why cant use a random virtualworld?

Its for houses with the same interior...


Re: SetPlayerVirtualWorld(playerid, i); - Eric - 03.11.2012

'i' is not a random integer. You have to define it first (as the error says).

pawn Код:
new i = random(128);
should work. Put that above.
You can change the 128 to set the max number it'll randomize to.


Re: SetPlayerVirtualWorld(playerid, i); - MrBlake - 03.11.2012

Quote:
Originally Posted by Eric
Посмотреть сообщение
'i' is not a random integer. You have to define it first (as the error says).

pawn Код:
new i = random(128);
should work. Put that above.
You can change the 128 to set the max number it'll randomize to.
The compiler will crash if I define "i".
I dont know why

Another way to make a random virtual world?
On define random(12; pawno crash


Re: SetPlayerVirtualWorld(playerid, i); - MrBlake - 03.11.2012

I need fast help, i meet other players in my house...


Re: SetPlayerVirtualWorld(playerid, i); - Eric - 03.11.2012

Try
pawn Код:
new x = random(128);
Change the 'i' variables to 'x'.


Re: SetPlayerVirtualWorld(playerid, i); - MrBlake - 03.11.2012

Eric, i tried another variables, like "rvw = random(12;" but the compiler crash


Re: SetPlayerVirtualWorld(playerid, i); - niels44 - 03.11.2012

use:

pawn Код:
new PlayerVirtualWorld = random(128);
SetPlayerVirtualWorld(playerid, PlayerVirtualWorld);
should work

or if you want to have a special virtual world for EACH player, so NOone will be in the same, i recommend you to use:
pawn Код:
SetPlayerVirtualWorld(playerid, playerid); // this will set every players interior to the id he has, so everyone will have a different one



Re: SetPlayerVirtualWorld(playerid, i); - MrBlake - 03.11.2012

This problem is solved (I added hWorld at enum hInfo, every house have an different virtual world)