help with virtual worlds
#1

hey guys, i'm trying to make a command where if the players virtual world id is higher than 1, they cannot use the command.

i have a /joinrace command and it only bugs when someone in a virtual world tries to join the race.

why would someone be in a virtual world you might ask? well for my script i have multiple burger shots and they all share the same interior/location but each of them have different virtual world ids.

how would i go about this? is it similar to checking if a player has enough money, etc?

Код:
if(GetPlayerVirtualWorld(playerid) > 0) return SendClientMessage(playerid, 0xFFFFFF, "You can't Join the Race in this Interior!");
would that work?
Reply
#2

Код:
if(GetPlayerInterior(playerid) > 0) return SendClientMessage(playerid, 0xFFFFFF, "You can't Join the Race in this Interior!");
??
Reply
#3

As I understand, you're asking if its possible to restrict commands to be used within virtualworld 0 only and unusable from other virtual worlds.
Yes it will work and yes it is similar to if a player has enough money.
Reply
#4

have i done it right in my code above?
Reply
#5

Yes as long as the virtual world is being set when the player enter the burger shot.

If you're not changing it then the virtual world will stay 0 and it won't work.
Reply
#6

Yes.
Reply
#7

ok no worries, the bit of code i pasted actually does work lol, i felt like it wouldnt but it did thanks anyways guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)