SA-MP Forums Archive
Same interior at 3 places - 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: Same interior at 3 places (/showthread.php?tid=622994)



Same interior at 3 places - AnoTek - 28.11.2016

I've made 3 banks one in ls one in sf and one in lv and i put the same interior.When i enter in sf bank and i exit it puts me in lv..

Код:
if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, 597.0128,-1248.8169,18.2756)) //LSBank enter
        {
			PlayerInfo[playerid][pInt] = 0;
			SetPlayerInterior(playerid,0);
			SetPlayerPos(playerid,2315.952880,-1.618174,26.742187);
			SetCameraBehindPlayer(playerid);
        }
        else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2315.952880,-1.618174,26.742187)) //LSBank exit
        {
			SetPlayerInterior(playerid, 0);
			SetPlayerPos(playerid,597.0128,-1248.8169,18.2756);
			SetCameraBehindPlayer(playerid);
        }
    }
	if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, -2383.8662,493.6244,29.8460)) //SFBank enter
        {
			PlayerInfo[playerid][pInt] = 0;
			SetPlayerInterior(playerid,0);
			SetPlayerPos(playerid,2315.952880,-1.618174,26.742187);
			SetCameraBehindPlayer(playerid);
        }
        else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2315.952880,-1.618174,26.742187)) //SFBank exit
        {
			SetPlayerInterior(playerid, 0);
			SetPlayerPos(playerid,-2383.8662,493.6244,29.8460);
			SetCameraBehindPlayer(playerid);
        }
    }
	if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, 2462.8411,2244.0120,10.8203)) //LVBank enter
        {
			PlayerInfo[playerid][pInt] = 0;
			SetPlayerInterior(playerid,0);
			SetPlayerPos(playerid,2315.952880,-1.618174,26.742187);
			SetCameraBehindPlayer(playerid);
        }
        else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2315.952880,-1.618174,26.742187)) //LVBank exit
        {
			SetPlayerInterior(playerid, 0);
			SetPlayerPos(playerid,2462.8411,2244.0120,10.8203);
			SetCameraBehindPlayer(playerid);
        }
    }
How can i solve this?


Re: Same interior at 3 places - Yaa - 28.11.2016

You can't make a lots of enters and exits in same place and same interior bro u will explode u server or make it crash :/

try another interior


Re: Same interior at 3 places - valerastar - 28.11.2016

same interior, different worlds. and when player tries to get out, find in which world he is, to know in which bank he was. that's all


Re: Same interior at 3 places - Micko123 - 28.11.2016

As I said.. Learning functions in pawno is not hard as it is thinking how will your code works..
This is exact example..


Re: Same interior at 3 places - Vince - 28.11.2016

Code execution is sequential and does not stop until either a return or the end of the function is reached. Now with that in mind, consider this line in the "sfbank enter" block:
PHP код:
SetPlayerPos(playerid,2315.952880,-1.618174,26.742187); 
And then this line:
PHP код:
else if(IsPlayerInRangeOfPoint(playerid2.02315.952880,-1.618174,26.742187)) //LVBank exit 
Yes, the player will be in range of that point because you just set him to that point.

I suggest you put a return in each block to stop the code at that point. This isn't the best long-term solution though.