SA-MP Forums Archive
Auto enter - 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: Auto enter (/showthread.php?tid=479247)



Auto enter - iBots - 03.12.2013

I am making a system which is if u are near a business or entrance it will automaticly put u inside the interior where to find the details and where to put it?


Re: Auto enter - Blademaster680 - 03.12.2013

You can make a system so when the player gets in range of a 3dtextdraw or something that it will send them to the chosen interior. Just let me know if you need help making it


Respuesta: Auto enter - [CG]Milito - 04.12.2013

You will need these functions:

pawn Код:
CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld);
SetPlayerInterior(playerid,interiorid);
SetPlayerPos(playerid,Float:X, Float:Y, Float:Z);
SetPlayerVirtualWorld(playerid,virtualworld);
SetPlayerFacingAngle(playerid,Float:angle);

CallBacks
pawn Код:
public OnPlayerPickUpPickup(playerid,pickupid)
Example script:

pawn Код:
new bank;
 
public OnGameModeInit()
{
    bank = CreatePickup(1318,23,2355.2417,1544.3804,10.8203,-1);
    return 1;
}
 
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == bank)
    {
         SetPlayerPos(playerid,2315.952880,-1.618174,26.742187);
         SetPlayerFacingAngle(playerid, 275.4359);
     SetPlayerInterior(playerid, 0);
         SetPlayerVirtualWorld(playerid, 354);
    }
    return 1;
}