Need help with virtual world enter/exits - 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: Need help with virtual world enter/exits (
/showthread.php?tid=101799)
Need help with virtual world enter/exits -
help! - 12.10.2009
Okay, so I made it so all food places use one interior; the donut shop. I scripted it to detect which world you're in and if you're in that world, it sets you to the correct exit.
But when I go inside, and walk to the door, it does not take me anywhere! It just keeps me inside the shop. I made multiple entrances (since theres alot of food shops) and only 1 seems to be working and the rest don't.
Here is the code that WORKS:
Код:
else if(PlayerToPointStripped(1, playerid,2419.9941,-1509.5865,24.0000, cx,cy,cz))
{//Cluckin Bell near pigpen
SetPlayerVirtualWorld(playerid, 1);
SetPlayerInterior(playerid, 17);
SetPlayerPos(playerid,376.9917,-191.2054,1000.6328);
SetCameraBehindPlayer(playerid);
}
else if(PlayerToPointStripped(1, playerid,377.0908,-193.3048,1000.6328, cx,cy,cz))
{//Cluckin Bell near pigpen exit
if(world == 1)
{
GameTextForPlayer(playerid, "~w~Los Santos", 5000, 1);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid,2422.4314,-1509.2856,23.9922);
SetPlayerVirtualWorld(playerid,0);
SetCameraBehindPlayer(playerid);
}
}
Here is one out of 4 codes that DO NOT WORK:
Код:
else if(PlayerToPointStripped(1, playerid,2398.6240,-1899.2014,13.5469, cx,cy,cz))
{//Cluckin Bell near 10 green
SetPlayerVirtualWorld(playerid, 2);
SetPlayerInterior(playerid, 17);
SetPlayerPos(playerid,376.9917,-191.2054,1000.6328);
SetCameraBehindPlayer(playerid);
}
else if(PlayerToPointStripped(1, playerid,377.0908,-193.3048,1000.6328, cx,cy,cz))
{//Cluckin Bell near 10 green exit
if(world == 2)
{
GameTextForPlayer(playerid, "~w~Los Santos", 5000, 1);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid,2398.6101,-1896.8287,13.3828);
SetPlayerVirtualWorld(playerid,0);
SetCameraBehindPlayer(playerid);
}
}
I see no difference between the code that works and doesn't work. I need help with this please!
Re: Need help with virtual world enter/exits -
help! - 12.10.2009
also
and for "world == blah blah blah"
the new code is:
Код:
new world = GetPlayerVirtualWorld(playerid);
Re: Need help with virtual world enter/exits -
help! - 13.10.2009
Please, I need help with this
Re: Need help with virtual world enter/exits -
help! - 13.10.2009
Nevermind, I got it!