SA-MP Forums Archive
[HELP!]Virtual World in GodFather! - 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: [HELP!]Virtual World in GodFather! (/showthread.php?tid=152460)



[HELP!]Virtual World in GodFather! - Manuel_Luna - 04.06.2010

hello, I put a lot of houses on my server with the same interior, but with different Virtual
Worl, but when I write / exit, does not recognize the virtual world and you appear on the same site with all the houses. What can happen?



Re: [HELP!]Virtual World in GodFather! - TTJJ - 04.06.2010

Hi Manuel,

You could try comparing the position of the player in comparison to the exit position of the house. Then confirm they're virtual world corrisponds with the house one.

eg.


Код:
if(strcmp(cmd,"/exit",true) == 0)
{

  for(new i=0; i<sizeof(HouseInfo); i++)
  {
    if(IsPlayerInRangeOfPoint(playerid,5.0,HouseInfo[i][hExitX],HouseInfo[i][hExitY],HouseInfo[i][hExitZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hVirtualWorld])
	{

	  SetPlayerPos(playerid,HouseInfo[i][hEntranceX],HouseInfo[i][hEntranceY],HouseInfo[i][hEntranceZ]);
	  SetPlayerVirtualWorld(playerid,0);
      SetPlayerInterior(playerid,0);
      return 1;
    }
  }
  return 1;

}
Give it a try, see what you can come up with.

Cheers, TJ