Vehicle interior
#1

Hi! im making a interior with MTA SA for my Camper, but how can i make it when i press G at the camper it teleports me to the interior, iknow its something like
Код:
newstate == PLAYER_STATE_PASSENGER
but idk how i can form that in my script, and also when the Driver of the camper moved the camper, and i exit the interior how can i do it that the player spawns at the place of the camper?


-Luckie12
Reply
#2

:3..
Reply
#3

pawn Код:
//At the top of your script:
new PlayerInCamper[MAX_PLAYERS];

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_PASSENGER)
    {
        new veh = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(veh) == 483) //If player entered a camper
        {
            //Teleport player to camper interior.
            PlayerInCamper[playerid] = veh; //This tells us what vehicle id the player is in, so we can teleport them when they exit.
        }
    }
    return 1;
}

//When the player exits the camper:
PutPlayerInVehicle(playerid, PlayerInCamper[playerid], 1);
RemovePlayerFromVehicle(playerid);
I hope this kind of explains it to you.
Reply
#4

it doesnt do anything, when i enter the Camper, it wont teleport me, but if i enter the camper, and after that i enter a vehicle, and leave the vehicle, it teleports me to the place where the camper is.

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_PASSENGER)
    {
        new veh = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(veh) == 483) //If player entered a camper
        {
			SetPlayerPos(playerid, -105.0361,-377.8486,1.4297);
            PlayerInCamper[playerid] = veh; //This tells us what vehicle id the player is in, so we can teleport them when they exit.
        }
    }
    return 1;
}
Reply
#5

...........
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)