SA-MP Forums Archive
Define SetPlayerPos function - 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: Define SetPlayerPos function (/showthread.php?tid=201953)



Define SetPlayerPos function - BlackWolf120 - 22.12.2010

hi,
ive got a problem once again
i run a minigame server and i use self mapped maps only.
On every map u can find an ammunation shop.
If u enter u are teleported into one of the 6 in gta available ammunation interiors.
But the problem is that i use the same interiors in a few maps and that means that there is an issue with the SetPlayerPos function.
I give u an example: if u enter the ammunation(interiorid 1) in map1 u might be teleported to the ammunation exit position on map2 (if i used the ammunation with the same interoirid 1 there).
I hope u can understand my problem.
So is there a possibility to avoid that, e.g with defining the diverse SetPLayerPos functions somehow?

regards.


Re: Define SetPlayerPos function - Haydz - 22.12.2010

SetPlayerVitrualWorld maybe, not sure if that will help, but you can always try and set a different world for each interior.


Re: Define SetPlayerPos function - BlackWolf120 - 22.12.2010

hi,
thx for ur answer.
I couldnt find this function in the wiki
Could u explain how to do this virtual world thing pls
this is how i teleport the players into their new location:

pawn Код:
//enterammunation
    for(new i = 0; i < MAX_PLAYERS; i++)

        {
            if(IsPlayerInRangeOfPoint(i, 2, -1088.9142,2189.1768,87.5694))
            {
                SetPlayerInterior(i, 6);
                SetPlayerPos(i, -595.6460,2016.9888,77.0469 );

        }
    }
//exitammunation
    for(new i = 0; i < MAX_PLAYERS; i++)

        {
            if(IsPlayerInRangeOfPoint(i, 2, -595.6460,2016.9888,77.0469))
            {
                Streamer_UpdateEx(playerid, -1088.9142,2189.1768,87.5694);
                SetPlayerInterior(i, 0);
                SetPlayerPos(i, -1088.9142,2189.1768,87.5694 );

        }
    }



Re: Define SetPlayerPos function - lewismichaelbbc - 25.02.2011

Hi, can i help you? This is the code for virtual worlds

pawn Код:
SetPlayerVirtualWorld(playerid, 5); // see players in virtual world 5
SetPlayerVirtualWorld(playerid, 0); // see players in the ordinary world
This code should work for what you are trying to do.

pawn Код:
//enterammunation
    for(new i = 0; i < MAX_PLAYERS; i++)

        {
            if(IsPlayerInRangeOfPoint(i, 2, -1088.9142,2189.1768,87.5694))
            {
                SetPlayerInterior(i, 6);
                SetPlayerPos(i, -595.6460,2016.9888,77.0469 );
                SetPlayerVirtualWorld(playerid, 5);                 //Added line for virtual world - this will enable the person to see people in the minigame only




        }
    }
//exitammunation
    for(new i = 0; i < MAX_PLAYERS; i++)

        {
            if(IsPlayerInRangeOfPoint(i, 2, -595.6460,2016.9888,77.0469))
            {
                Streamer_UpdateEx(playerid, -1088.9142,2189.1768,87.5694);
                SetPlayerInterior(i, 0);
                SetPlayerPos(i, -1088.9142,2189.1768,87.5694 );
                SetPlayerVirtualWorld(playerid, 0);                        //Added line for virtual world - this will enable the player to see all players that are in the ordinary world                  


        }
    }



Re: Define SetPlayerPos function - BlackWolf120 - 25.02.2011

haha,
thx for ur help
but this thread is old now and i also got a little smarter with time
but anyway, thx dude