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



/vw - Dan_Barocu - 29.03.2012

i got this cmd and i tried too many times how can i set it so i can use it only in interior 0?

PHP код:
if(strcmp(cmdtext"/vw"true) == 0) {
                        
SetPlayerInterior(playerid0);
                        
SetPlayerVirtualWorld(playerid0);
                        
SendClientMessage(playeridCOLOR_RED"** Ti-ai resertat Virtual World la 0.");
                        return 
1;
                        } 



Re: /vw - Shabi RoxX - 29.03.2012

Try this.
pawn Код:
if(strcmp(cmdtext, "/vw", true) == 0) {
if(GetPlayerInterior(playerid) == 0)
{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SendClientMessage(playerid, COLOR_RED,
return 1;
}
}



Re: /vw - park4bmx - 29.03.2012

Above code does the same but just to show you a shorter example
so u dont get confused with brackets
pawn Код:
if(strcmp(cmdtext, "/vw", true) == 0) {
if(GetPlayerInterior(playerid) > 0) return SendClientMessage(playerid, COLOR_RED, "You can only use this in Interior 0!");
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SendClientMessage(playerid, COLOR_RED, "** Ti-ai resertat Virtual World la 0.");
return 1;
}



Re: /vw - Finest - 29.03.2012

Код:
if(strcmp(tmp, "/vw", true) == 0)
{
	if(IsPlayerConnected(playerid))
	{
		new plvworld = GetPlayerVirtualWorld(playerid);
		if(plvworld == 0)
		{
			SendClientMessage(playerid, COLOR_RED, "** Ti-ai resertat Virtual World la 0.");
		}
		else
		{
			SendClientMessage(playerid, COLOR_RED, "** You can only use this command in vw 0."); 
		}
	}
return 1;
}



Re: /vw - Dan_Barocu - 29.03.2012

fixed