Exit mixing (VirtualWorlds)
#1

Hello. I dont know how to make an exit for my banks with same interiors.

When I enter bank with this:

Код:
if(strcmp(cmd, "/enter", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
			//2305.688964|-16.088100|26.749599
			if (PlayerToPoint(3.0, playerid,981.6595,-1161.3964,25.0962))
			{
			  GameTextForPlayer(playerid, "~w~Sveicinati SEB Banka", 5000, 1);
			  SetPlayerInterior(playerid,0);
			  PlayerInfo[playerid][pInt] = 0;
			  SetPlayerVirtualWorld(playerid, 2);
				SetPlayerPos(playerid,2305.688964,-16.088100,26.749599);
			}
			if (PlayerToPoint(3.0, playerid,1112.0267,-1370.2819,13.9844))
			{
			  GameTextForPlayer(playerid, "~w~Sveicinati SwedBank", 5000, 1);
			  SetPlayerInterior(playerid,0);
			  PlayerInfo[playerid][pInt] = 0;
			  SetPlayerVirtualWorld(playerid, 3);
				SetPlayerPos(playerid,2305.688964,-16.088100,26.749599);
			}
			if (PlayerToPoint(3.0, playerid,1270.8789,-1667.8645,19.7344))
			{
			  GameTextForPlayer(playerid, "~w~Sveicinati Parex Banka", 5000, 1);
			  SetPlayerInterior(playerid,0);
			  PlayerInfo[playerid][pInt] = 0;
			  SetPlayerVirtualWorld(playerid, 4);
				SetPlayerPos(playerid,2305.688964,-16.088100,26.749599);
			}
			if (PlayerToPoint(3.0, playerid,1720.2047,-1740.9485,13.5469))
			{
			  GameTextForPlayer(playerid, "~w~Sveicinati GE Money Banka", 5000, 1);
			  SetPlayerInterior(playerid,0);
			  PlayerInfo[playerid][pInt] = 0;
			  SetPlayerVirtualWorld(playerid, 5);
				SetPlayerPos(playerid,2305.688964,-16.088100,26.749599);
			}
		}
		return 1;
	}
So when I enter it seems to be okey, but when I exit from it, it mixes up and exits in other bank locations not in that what I need.
Exit command.

Код:
if(strcmp(cmd, "/exit", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
			//BANKAS 2305.688964,-16.088100,26.749599
			if (PlayerToPoint(3.0, playerid,2305.688964,-16.088100,26.749599))
  			{
				if(GetPlayerVirtualWorld(playerid) != 2)
				{
			  	GameTextForPlayer(playerid, "~w~Los Santos", 5000, 1);
			  	SetPlayerInterior(playerid,0);
			  	PlayerInfo[playerid][pInt] = 0;
			  	SetPlayerVirtualWorld(playerid, 0);
					SetPlayerPos(playerid,981.6595,-1161.3964,25.0962);
				}
				else if(GetPlayerVirtualWorld(playerid) != 3)
				{
			  	GameTextForPlayer(playerid, "~w~Los Santos", 5000, 1);
			  	SetPlayerInterior(playerid,0);
			  	PlayerInfo[playerid][pInt] = 0;
			  	SetPlayerVirtualWorld(playerid, 0);
					SetPlayerPos(playerid,1112.0267,-1370.2819,13.9844);
				}
				else if(GetPlayerVirtualWorld(playerid) != 4)
				{
 	 				GameTextForPlayer(playerid, "~w~Los Santos", 5000, 1);
			  	SetPlayerInterior(playerid,0);
			  	PlayerInfo[playerid][pInt] = 0;
			  	SetPlayerVirtualWorld(playerid, 0);
					SetPlayerPos(playerid,1270.8789,-1667.8645,19.7344);
				}
				else if(GetPlayerVirtualWorld(playerid) != 5)
				{
			  	GameTextForPlayer(playerid, "~w~Los Santos", 5000, 1);
			  	SetPlayerInterior(playerid,0);
			  	PlayerInfo[playerid][pInt] = 0;
			  	SetPlayerVirtualWorld(playerid, 0);
					SetPlayerPos(playerid,1720.2047,-1740.9485,13.5469);
				}
				return 1;
			}
			//BANKS =[END]=
		return 1;
	}
I dont know how to get that virtual world right...
Reply
#2

Just correct this:

pawn Код:
if(GetPlayerVirtualWorld(playerid) != 2)
With this:

pawn Код:
if(GetPlayerVirtualWorld(playerid) == 2)
Little tip:

!= - differs
== - equals
Reply
#3

big thanks.

solved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)