SA-MP Forums Archive
Garage teleport? - 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: Garage teleport? (/showthread.php?tid=238673)



Garage teleport? - patfay - 12.03.2011

Okay, well I was wondering how I would make a garage command. For example, if you are in the PD (reason for this) and you walk/drive up to a garage door and type /pdgarage it will teleport you to a location (I have it)
If on foot you will be teleported on foot, but if you are in a vehicle it will teleport you and the vehicle there, and you will still be in the vehicle (Passengers aswell) The script I am using is ZCMD.

(Cords for outside are: Interior: 0 620.584 -596.347 16.945)
(Cords for inside (garage) are: Interior 0 -1387.886 -134.092 5.727)


Re: Garage teleport? - antonio112 - 12.03.2011

pawn Код:
CMD:pdgarage( playerid, params[] )
{
    if( IsPlayerInRangeOfPoint( playerid, 5.0, 620.584, -596.347, 16.945 ) )
    {
        if( !IsPlayerInAnyVehicle( playerid ) )
        {
        SetPlayerInterior( playerid, 0 );
        SetPlayerPos( playerid, -1387.886, -134.092, 5.727 );
        }
        else return SetVehiclePos( GetPlayerVehicleID( playerid ), -1387.886, -134.092, 5.727 );
    }
    return 1;
}
This should work.