SA-MP Forums Archive
Quick 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: Quick Question (/showthread.php?tid=165241)



Quick Question (Solved) - Kayla.S - 04.08.2010

What's the easiest/shortest way in doing this. I'm wanting to add more then one virtual world. I'm needing to do this with many commands. Right now it's only disabled for world 1. But I would like 2 other worlds added onto it. Isn't it possible to do it all in one line? Thanks.

pawn Код:
if(GetPlayerVirtualWorld(playerid) != 3) return SendClientMessage(playerid, 0xAFFFFAF, "ERROR: You cannot use this command here.");



Re: Quick Question - PotH3Ad - 04.08.2010

It's possible to do it all in one line like this...

pawn Код:
if(GetPlayerVirtualWorld(playerid) != 3 && GetPlayerVirtualWorld(playerid) != 4) return SendClientMessage(playerid, 0xAFFFFAF, "ERROR: You cannot use this command here.");
But its better to store the player's virtual world in a variable:

pawn Код:
new pWorld = GetPlayerVirtualWorld(playerid);
if(pWorld != 3 && pWorld != 4) return SendClientMessage(playerid, 0xAFFFFAF, "ERROR: You cannot use this command here.");
//If the player isn't in virtual world 3 or 4...



Re: Quick Question - Kayla.S - 04.08.2010

Thank you PotH3Ad!