#1

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;
                        } 
Reply
#2

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;
}
}
Reply
#3

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;
}
Reply
#4

Код:
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;
}
Reply
#5

fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)