Define SetPlayerPos function
#1

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.
Reply
#2

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

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 );

        }
    }
Reply
#4

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                  


        }
    }
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)