SA-MP Forums Archive
Pickup to interior problem - 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: Pickup to interior problem (/showthread.php?tid=127812)



Pickup to interior problem - [BEP]AcerPilot - 15.02.2010

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



Re: Pickup to interior problem - Nero_3D - 15.02.2010

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



Re: Pickup to interior problem - [BEP]AcerPilot - 15.02.2010

Don't work. I'm tried.


Re: Pickup to interior problem - [BEP]AcerPilot - 16.02.2010

Anyone?


Re: Pickup to interior problem - adsy - 16.02.2010

ive noticed that

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


Re: Pickup to interior problem - Nero_3D - 17.02.2010

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



Re: Pickup to interior problem - [BEP]AcerPilot - 17.02.2010

Again dont' work....


Re: Pickup to interior problem - Nero_3D - 17.02.2010

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


Re: Pickup to interior problem - [BEP]AcerPilot - 17.02.2010

How?


Re: Pickup to interior problem - [BEP]AcerPilot - 19.02.2010

How?