How to keep someone in their car
#1

[PAWN] if (strcmp("/entergarage", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, -709.9, 964.1, 581.0;
SendClientMessage(playerid, 0x388e8e, "Welcome to Johns Garage");
return 1;
}
[PAWN]


How can I keep the player in their car when they enter the garage?
Reply
#2

SetVehiclePos ?
Reply
#3

Quote:
Originally Posted by Too
Посмотреть сообщение
[PAWN] if (strcmp("/entergarage", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, -709.9, 964.1, 581.0;
SendClientMessage(playerid, 0x388e8e, "Welcome to Johns Garage");
return 1;
}
[PAWN]


How can I keep the player in their car when they enter the garage?
Lock vehicle with player still in it ?
Reply
#4

pawn Код:
if (strcmp("/entergarage", cmdtext, true, 10) == 0)
    {
        if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new tmpcar = GetPlayerVehicleID(playerid);
            SetVehiclePos(tmpcar, -709.9, 964.1, 581.0);
            //SetVehicleZAngle(tmpcar, 0.0); //Uncomment and set if you want to angle the car a specific way
        }
        else
        {
            SetPlayerPos(playerid, -709.9, 964.1, 581.0);
            //SetPlayerFacingAngle(playerid, 0.0); //Uncomment and set if you want to angle the player a specific way
        }
        SendClientMessage(playerid, 0x388e8e, "Welcome to Johns Garage");
        return 1;
    }
Reply
#5

You could use a variable, on the command put, InGarage[playerid] = 1;
Under OnPlayerExitVehicle
pawn Код:
if(InGarage[playerid] == 1) return PutPlayerInVehicle
Make sure when you exit the garage you set the variable back to 0.
Reply
#6

Код:
if(strcmp("/entergarage", cmdtext, true) == 0)
{
	new veh;
	veh = GetPlayerVehicleID(playerid);
	SetVehiclePos(veh, -709.9, 964.1, 581.0);
	SetPlayerPos(playerid, -709.9, 964.1, 581.0);
	PutPlayerInVehicle(playerid, veh, 0);
        SendClientMessage(playerid, 0x388e8e, "Welcome to Johns Garage");
        TogglePlayerControllable(playerid, 0);
        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)