Stopping the player from leaving a vehicle?
#1

How do I stop a player from leaving any vehicle?
Reply
#2

You mean like; Locking the doors so the player cant get out ?
Reply
#3

Maybe this will work .. Add this under public OnPlayerStateChange
pawn Код:
if (newstate == PLAYER_STATE_ONFOOT)
{
if(oldstate == PLAYER_STATE_DRIVER)
{
new veh = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(playerid,veh);
}
}
Reply
#4

pawn Код:
public OnPlayerExitVehicle(playerid,vehicleid)
{
  PutPlayerInVehicle(playerid,vehicleid,GetPlayerVehicleSeat(playerid));
  return 1;
}
State change is called when state changes, so if your new state is on foot, how would you get vehicle id?
Reply
#5

Lolz, I've thought of that, but won't it play the get out animation, then spawn the play back in the vehicle

I'll try that later, I just don't want it to play the animation of the player getting out.
Reply
#6

Quote:
Originally Posted by Zinglish
Lolz, I've thought of that, but won't it play the get out animation, then spawn the play back in the vehicle

I'll try that later, I just don't want it to play the animation of the player getting out.
I think it wont play the animation .. you should try using it atleast lol
Reply
#7

Quote:
Originally Posted by ►Peter Corneile [ideal-host.co.uk
◄ ]
Quote:
Originally Posted by Zinglish
Lolz, I've thought of that, but won't it play the get out animation, then spawn the play back in the vehicle

I'll try that later, I just don't want it to play the animation of the player getting out.
I think it wont play the animation .. you should try using it atleast lol
I will now, I'll report back XD
Reply
#8

Quote:
Originally Posted by Zinglish
Quote:
Originally Posted by ►Peter Corneile [ideal-host.co.uk
◄ ]
Quote:
Originally Posted by Zinglish
Lolz, I've thought of that, but won't it play the get out animation, then spawn the play back in the vehicle

I'll try that later, I just don't want it to play the animation of the player getting out.
I think it wont play the animation .. you should try using it atleast lol
I will now, I'll report back XD
Alright
Reply
#9

Darn, it does play the anim, maybe the only way is to detect when the player presses the exit vehicle button and place him in the vehicle

Could work huh
Reply
#10

Hmm maybe like if a person is in a car and he presses F or Enter , he may be freezed for 1 second .. it would work
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)