Pickup to interior problem
#1

I created a pickup in San Fierro that when you touch it you are teleported to the intererior of Caligulas Casino. But when you go out of the casino, you go out in Las Venturas, in front of the casino, instead of going out in San Fierro, in front of the pickup. How to fix this?

OBS: this is the code:
Код:
new marker;//in top
marker = CreatePickup(1318,-1,-757.70355224609,537.92999267578,9.1202020645142);//in OnFilterScriptInit
if(pickupid == marker)//in OnPlayerPickupPickup
	{
		GetPlayerInterior(playerid);
		GetPlayerVirtualWorld(playerid);
		SetPlayerInterior(playerid, 1);
		SetPlayerPos(playerid, 2233.8032, 1712.2303, 1011.7632 );
	}
Reply
#2

you could add another pickup or you use the public OnPlayerInteriorChange
pawn Код:
new TeleStatus[MAX_PLAYERS];
enum
{
    T_None,
    T_Caligula
}
pawn Код:
//OnPlayerPickupPickup
if(pickupid == marker)
    {
        SetPlayerInterior(playerid, 1);
        SetPlayerPos(playerid, 2233.8032, 1712.2303, 1011.7632 );
        TeleStatus[playerid] = T_Caligula;
    }
pawn Код:
public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
    {
    if(newinteriorid == 0) //outdoors
        {
        if(oldinteriorid == 1)
            {
            if(TeleStatus[playerid] == T_Caligula)
                {
                SetPlayerPos(playerid, -760.70355224, 537.92999267, 9.12020206);
                TeleStatus[playerid] = T_None;
                return 1;
                }
            }

        }
    return 1;
    }
Reply
#3

Don't work. I'm tried.
Reply
#4

Anyone?
Reply
#5

ive noticed that

walk into the sex vids shop in los santos and you walk out in las venturas
Reply
#6

ok I tested the code, too
Here is a solution which worked for me
Freeze, teleport, unfreeze

pawn Код:
new TeleStatus[MAX_PLAYERS];
enum
{
    T_None,
    T_Caligula
}
pawn Код:
//OnPlayerPickupPickup
if(pickupid == marker)
{
    SetPlayerInterior(playerid, 1);
    SetPlayerPos(playerid, 2233.8032, 1712.2303, 1011.7632 );
    TeleStatus[playerid] = T_Caligula;
}
pawn Код:
public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
{
    if(newinteriorid == 0)
    {
        if(oldinteriorid == 1)
        {
            if(TeleStatus[playerid] == T_Caligula)
            {
                TogglePlayerControllable(playerid, false);
                SetPlayerPos(playerid, -760.70355224, 537.92999267, 9.12020206);
                TogglePlayerControllable(playerid, true);
                TeleStatus[playerid] = T_None;
                return 1;
            }
        }
    }
    return 1;
}
Reply
#7

Again dont' work....
Reply
#8

Quote:
Originally Posted by [BEP
GeoPilot ]
Again dont' work....
Then use a pickup teleporter (like the one you already have)
Reply
#9

How?
Reply
#10

How?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)