SA-MP Forums Archive
Really bad with playerrange[+REP] - 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: Really bad with playerrange[+REP] (/showthread.php?tid=320185)



Really bad with playerrange[+REP] - Mark_Weston - 21.02.2012

Hey there, I am trying to do two banks, in two different citys.

This is the one for FC.

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2.0, -179.188339,1133.098266,19.742187)) {
            SetPlayerPos(playerid, 2325.0097, 2369.2297, 2022.9257);
            SetPlayerVirtualWorld(playerid, 3);
        }
        else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2325.0097,2369.2297,2022.9257)) {  //2306.8481,-16.0682,26.7496
            SetPlayerPos(playerid, -179.188339,1133.098266,19.742187);
            SetPlayerVirtualWorld(playerid, 0);
        }
I also want to add this cord
Код:
2140.0405, 1362.4843, 10.8540, 177.8677
how would I do that?


Re: Really bad with playerrange[+REP] - ReneG - 21.02.2012

Please go into more detail?


Re: Really bad with playerrange[+REP] - Think - 21.02.2012

Quote:
Originally Posted by Mark_Weston
Посмотреть сообщение
Hey there, I am trying to do two banks, in two different citys.

This is the one for FC.

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2.0, -179.188339,1133.098266,19.742187)) {
            SetPlayerPos(playerid, 2325.0097, 2369.2297, 2022.9257);
            SetPlayerVirtualWorld(playerid, 3);
        }
        else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2325.0097,2369.2297,2022.9257)) {  //2306.8481,-16.0682,26.7496
            SetPlayerPos(playerid, -179.188339,1133.098266,19.742187);
            SetPlayerVirtualWorld(playerid, 0);
        }
I also want to add this cord
Код:
2140.0405, 1362.4843, 10.8540, 177.8677
how would I do that?
Add another else if block;

PHP код:
        if(IsPlayerInRangeOfPoint(playerid2.0, -179.188339,1133.098266,19.742187)) {
            
SetPlayerPos(playerid2325.00972369.22972022.9257);
            
SetPlayerVirtualWorld(playerid3);
        }
        else if(
IsPlayerInRangeOfPoint(playerid2.02325.0097,2369.2297,2022.9257)) {  //2306.8481,-16.0682,26.7496
            
SetPlayerPos(playerid, -179.188339,1133.098266,19.742187);
            
SetPlayerVirtualWorld(playerid0);
        }
        else if(
IsPlayerInRangeOfPoint(playerid2.02140.04051362.484310.8540)) {  //2306.8481,-16.0682,26.7496
            
SetPlayerPos(playerid/* Player Coordinates here */);
            
SetPlayerVirtualWorld(playerid/* Player Virtual World here */);
        } 



Re: Really bad with playerrange[+REP] - Mark_Weston - 21.02.2012

Quote:
Originally Posted by Think
Посмотреть сообщение
Add another else if block;

PHP код:
        if(IsPlayerInRangeOfPoint(playerid2.0, -179.188339,1133.098266,19.742187)) {
            
SetPlayerPos(playerid2325.00972369.22972022.9257);
            
SetPlayerVirtualWorld(playerid3);
        }
        else if(
IsPlayerInRangeOfPoint(playerid2.02325.0097,2369.2297,2022.9257)) {  //2306.8481,-16.0682,26.7496
            
SetPlayerPos(playerid, -179.188339,1133.098266,19.742187);
            
SetPlayerVirtualWorld(playerid0);
        }
        else if(
IsPlayerInRangeOfPoint(playerid2.02140.04051362.484310.8540)) {  //2306.8481,-16.0682,26.7496
            
SetPlayerPos(playerid/* Player Coordinates here */);
            
SetPlayerVirtualWorld(playerid/* Player Virtual World here */);
        } 
One problem. If I enter at the last code I exit at FC bank, and not at LV bank. ( If I enter at LV bank and exit it, it sends me to FC bank exit point )


Re: Really bad with playerrange[+REP] - JhnzRep - 22.02.2012

Give us the exit code


Re: Really bad with playerrange[+REP] - Mark_Weston - 22.02.2012

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
Give us the exit code
As far as I know


pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2.0, -179.188339,1133.098266,19.742187)) { //fc entrance
            SetPlayerPos(playerid, 2325.0097, 2369.2297, 2022.9257);  //bank interior door
            SetPlayerVirtualWorld(playerid, 3);
        }

        else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2325.0097,2369.2297,2022.9257)) {  //bank interior door
            SetPlayerPos(playerid, -179.188339,1133.098266,19.742187); //send back to fc entrance
            SetPlayerVirtualWorld(playerid, 0);
        }



Re: Really bad with playerrange[+REP] - JhnzRep - 22.02.2012

The code you showed should work.


Re: Really bad with playerrange[+REP] - Mark_Weston - 22.02.2012

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
The code you showed should work.
because its the original one, I stated it on the first post.

I said I want 'two banks' in 'two different city's' or one in a county and on in a city...


Re: Really bad with playerrange[+REP] - JhnzRep - 22.02.2012

Get the coordinates of the entrance, and the the interior. Then post it here.


Re: Really bad with playerrange[+REP] - Mark_Weston - 22.02.2012

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
Get the coordinates of the entrance, and the the interior. Then post it here.
Entrance:2140.0405, 1362.4843, 10.8540, 177.8677

Interior:2325.0097, 2369.2297, 2022.9257