• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [HELP] Securicar Interior
#2
First:
Code:
new IsInSecuricar[MAX_PLAYERS];

To enter interior:
Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER)
{
if (GetVehicleModel(vehicleid) == SECURICAR ID)
{

SetPlayerPos(playerid, INTERIOR POS);
SetPlayerFacingAngle(playerid, ANGLE);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, INTERIORID);
IsInSecuricar[playerid] = vehicleid;
}
}

To Exit car interior:
Code:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    if (newkeys == 16 && IsInSecuricar[playerid] > 0)
    {
        new Float:X,Float:Y,Float:Z;
        GetVehiclePos(IsInSecuricar[playerid], X, Y, Z);
        SetPlayerPos(playerid, X, Y, Z);
        SetPlayerInterior(playerid, 0);
        IsInSecuricar[playerid] = 0;
    }
  Reply


Messages In This Thread
[HELP] Securicar Interior - by Necmi07 - 2020-12-30, 10:44 PM
RE: [HELP] Securicar Interior - by xbruno1000x - 2020-12-31, 04:46 PM
RE: [HELP] Securicar Interior - by Necmi07 - 2021-01-06, 11:28 PM
RE: [HELP] Securicar Interior - by M.D. - 2021-01-12, 08:38 PM

Forum Jump: