SA-MP Forums Archive
Vehicle entering help - 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: Vehicle entering help (/showthread.php?tid=355482)



Vehicle entering help - grantism - 30.06.2012

Okay, so I've created the base of a garage system for my self, I don't know how to setvehpos, basically at the moment you type /enter at the garage spot and you enter by your self, how can i make you still inside your vehicle /enter and you and your vehicle will be inside?


Re: Vehicle entering help - TyThaBomb - 30.06.2012

Let me give you an example.

pawn Код:
command(enter,playerid,params[])
{
    if(GetPlayerState[playerid] != PLAYER_STATE_DRIVER) // They're NOT in a car
    {
        //SetPLAYERPos, not SetVehiclePos.
        //SetPLAYERInterior here
    }
    else
    {
        new vehicle = GetPlayerVehicleID(playerid);
        //Then, set their VEHICLE position.
        //LinkVehicleToInterior, or whatever that function is.
    }
    return 1;
}
There, you can see I checked their state, if they were a driver of a vehicle or not. Then, if they WEREN'T in a vehicle, I'd set the PLAYER pos, and if they WERE in a vehicle, I'd set the vehicle pos.


Re: Vehicle entering help - grantism - 30.06.2012

Thank you so much man, answered the question perfectly, + rep.