Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
Rugz007

how to block player from getting out from a vehicle

Recommended Posts

Rugz007

Hey guys I was busy making mods and I thought how to make the player to

Block from exiting a vehicle ??

 

I tried it many a times ..... Asked few modders..... No use

 

So came to forums :D

Share this post


Link to post
Share on other sites
Noox

You store his vehicle into a variable then you check if he is not inside, if the condition returns true then you put him back into the vehicle.

I'm sure there are better ways

Share this post


Link to post
Share on other sites
leftas

Oh god.

Native functions

Roman 1 Mission

GTA.Native.Function.Call("SET_CHAR_GET_OUT_UPSIDE_DOWN_CAR", Player.Character, 0);GTA.Native.Function.Call("SET_CHAR_STAY_IN_CAR_WHEN_JACKED", Player.Character, 0);GTA.Native.Function.Call("SET_CHAR_CANT_BE_DRAGGED_OUT", Player.Character, 1);GTA.Native.Function.Call("LOCK_CAR_DOORS", Player.Character.CurrentVehicle, 2);GTA.Native.Function.Call("SET_CHAR_CAN_BE_KNOCKED_OFF_BIKE", Player.Character , 0); // with this by wiki you should enable Collision proofOrGTA.Native.Function.Call("SET_CHAR_GET_OUT_UPSIDE_DOWN_CAR", Player.Character, 0);GTA.Native.Function.Call("SET_CHAR_STAY_IN_CAR_WHEN_JACKED", Player.Character, 0);Player.Character.CanBeDraggedOutOfVehicle = false;Player.Character.CurrentVehicle.DoorLock = DoorLock.ImpossibleToOpen;Player.Character.CanBeKnockedOffBike = false; // with this by wiki you should enable Collision proof

Best Regards,

Paul.

Edited by leftas

Share this post


Link to post
Share on other sites
Maro Hannover

@LEFTAS

You are Very intellegent but i was going to say those

Player.Character.CanBeDraggedOutOfVehicle = false and;LOCK_CAR_DOORS

BTW you forgot to write

 

Regards,

Paul.

hehe

 

Regards,

Maro.

Share this post


Link to post
Share on other sites
Compman

Oh god.

Native functions

Roman 1 Mission

 

GTA.Native.Function.Call("SET_CHAR_GET_OUT_UPSIDE_DOWN_CAR", Player.Character, 0);GTA.Native.Function.Call("SET_CHAR_STAY_IN_CAR_WHEN_JACKED", Player.Character, 0);GTA.Native.Function.Call("SET_CHAR_CANT_BE_DRAGGED_OUT", Player.Character, 1);GTA.Native.Function.Call("LOCK_CAR_DOORS", Player.Character.CurrentVehicle, 2);GTA.Native.Function.Call("SET_CHAR_CAN_BE_KNOCKED_OFF_BIKE", Player.Character , 0); // with this by wiki you should enable Collision proofOrGTA.Native.Function.Call("SET_CHAR_GET_OUT_UPSIDE_DOWN_CAR", Player.Character, 0);GTA.Native.Function.Call("SET_CHAR_STAY_IN_CAR_WHEN_JACKED", Player.Character, 0);Player.Character.CanBeDraggedOutOfVehicle = false;Player.Character.CurrentVehicle.DoorLock = DoorLock.ImpossibleToOpen;Player.Character.CanBeKnockedOffBike = false; // with this by wiki you should enable Collision proof

Best Regards,

Paul.

 

Thanks learnt a new thing :D

Share this post


Link to post
Share on other sites
Wiebrendh

@LEFTAS

You are Very intellegent but i was going to say those

Player.Character.CanBeDraggedOutOfVehicle = false and;LOCK_CAR_DOORS

BTW you forgot to write

 

Regards,

Paul.

hehe

 

Regards,

Maro.

 

You are acting like it is a race who answers the question first. And why are you copying the Regards, Paul. And Player.Character.CanBeDraggedOutOfVehicle = false is this:

GTA.Native.Function.Call("SET_CHAR_CANT_BE_DRAGGED_OUT", Player.Character, 1);

Share this post


Link to post
Share on other sites
Rugz007

Regards are AWESOME I like that method of writing

Share this post


Link to post
Share on other sites
Jitnaught

Because he's a special member

Share this post


Link to post
Share on other sites
Compman

Lol ...

 

 

 

 

how did you become a special member?

 

(process)

Share this post


Link to post
Share on other sites
leftas

@Maro

Yes I forgot to add those. And special member don't add you ability to say what I did do and what I didn't do, maybe I don't wanted to add these ? So please stop it. And please take c# lessons, because most of time you go off-topic or directing to similar question but very different.

@Rugz007

So write like that, but not make parody of them. Like use one time and then "f*ck it" :)

I suggest same tip like for Maro To take C# lessons.

@Both of you

But I know that you will be as always "f*ck it, I already know it". I used to be like you, but one-time I understood that I will go no-where if I will be like that.

 

Best Regards,

Paul.

Share this post


Link to post
Share on other sites
Compman

Hey Guys

 

 

leftas is right

 

 

Guess what i just asked at general chat how to get higher rank and now i am a special member by surprise ?

 

what did just happened and what is this? :O

 

?SPECIAL MEMBER?

 

As Maro is one.....may i ask you what is being a special member and benifits or just name?

 

 

(i would not like benefits because i dont to be like.....show others that i am "special"

Share this post


Link to post
Share on other sites
Rugz007

Congo compman

Share this post


Link to post
Share on other sites
Noox

You're both special members because the way you act is weird.

Anyway, I read they gave the special member thing to users who won some challenges back in the time so I think it's pretty useless now and they just give it like something happened.

Edited by Noox

Share this post


Link to post
Share on other sites
Compman

hahaha its useless :) i needed it to be useless not be be SPECIAL than others :D

Share this post


Link to post
Share on other sites
Compman

Oh god.

Native functions

Roman 1 Mission

 

GTA.Native.Function.Call("SET_CHAR_GET_OUT_UPSIDE_DOWN_CAR", Player.Character, 0);GTA.Native.Function.Call("SET_CHAR_STAY_IN_CAR_WHEN_JACKED", Player.Character, 0);GTA.Native.Function.Call("SET_CHAR_CANT_BE_DRAGGED_OUT", Player.Character, 1);GTA.Native.Function.Call("LOCK_CAR_DOORS", Player.Character.CurrentVehicle, 2);GTA.Native.Function.Call("SET_CHAR_CAN_BE_KNOCKED_OFF_BIKE", Player.Character , 0); // with this by wiki you should enable Collision proofOrGTA.Native.Function.Call("SET_CHAR_GET_OUT_UPSIDE_DOWN_CAR", Player.Character, 0);GTA.Native.Function.Call("SET_CHAR_STAY_IN_CAR_WHEN_JACKED", Player.Character, 0);Player.Character.CanBeDraggedOutOfVehicle = false;Player.Character.CurrentVehicle.DoorLock = DoorLock.ImpossibleToOpen;Player.Character.CanBeKnockedOffBike = false; // with this by wiki you should enable Collision proof

Best Regards,

Paul.

Lets get back to topic

 

 

this is not working leftas any of them is not working help :(

Share this post


Link to post
Share on other sites
Compman

THe native LOCK_CAR_DOORS is making it not work ...what should i do?

Share this post


Link to post
Share on other sites
leftas

Show your code. It should work. I tested, for me its working.

 

Best Regards,

Paul.

Share this post


Link to post
Share on other sites
Compman

its works for me now....

when i did put:

spawnedvehiclename..DoorLock = DoorLock.ImpossibleToOpen;

Share this post


Link to post
Share on other sites
leftas

Please don't use purple, it burns my eyes....

will you show me how you did with Native ?

 

Best Regards,

Paul.

Share this post


Link to post
Share on other sites
Jitnaught

Please don't use purple, it burns my eyes....

will you show me how you did with Native ?

 

Best Regards,

Paul.

Ikr :D

Share this post


Link to post
Share on other sites
Rugz007

I think he didn't used that native

I used it as follows and it works

 

Gta.native.function.call("LOCK_CAR_DOORS",vehiclename, 7)

 

I am on my mobile atm so I will post you the perfect code for it :D

Share this post


Link to post
Share on other sites
leftas

Rugz007,
Did you see what 7 does ?

 

7 - locked, player can break in.

 

Best Regards,

Paul.

Edited by leftas

Share this post


Link to post
Share on other sites
Rugz007

Yeah :) 4 makes the player stuck in car

Edited by Rugz007

Share this post


Link to post
Share on other sites
leftas

You wanted to make stuck/block player in vehicle, in your first post. So I gave you solution and you are still using 7(I know that you were on mobile, but still if you remember 7 you should remember 4).

 

Best Regards,

Paul.

Edited by leftas

Share this post


Link to post
Share on other sites
Rugz007

Thanks dude anyways :D great help

Share this post


Link to post
Share on other sites
Compman

and.....

 

 

here goes 1 more question how to make player enter any of the vehicle?

 

:D

Share this post


Link to post
Share on other sites
Noox

Could you explain that better?

You mean make the player enter a random vehicle?

 

if so,

Vehicle[] vehicles = World.GetAllVehicles();Random rnd = new Random();int randomInt = rnd.Next(0, vehicles.Length - 1);if(Exists(vehicles[randomInt] && !player.isInVehicle())    Player.WarpIntoVehicle(vehicles[randomInt]);

I can't test right now as I just finished to install win8.1 and I don't remember if "WarpIntoVehicle" is used like that.

Edited by Noox

Share this post


Link to post
Share on other sites
leftas

Could you explain that better?

You mean make the player enter a random vehicle?

 

if so,

Vehicle[] vehicles = World.GetAllVehicles();Random rnd = new Random();int randomInt = rnd.Next(0, vehicles.Length - 1);if(Exists(vehicles[randomInt] && !player.isInVehicle())    Player.WarpIntoVehicle(vehicles[randomInt]);

I can't test right now as I just finished to install win8.1 and I don't remember if "WarpIntoVehicle" is used like that.

1.I think he want to enter vehicle on foot(But we need to be careful with tasks)

Player.Charachter.Task.EnterVehicle(); // Not sure what this does, but I think it enter nearest vehicle...Player.Charachter.Task.EnterVehicle(vehicles[randomInt], VehicleSeat.Driver);

but we need to check distance from player to car, because that random vehicle can be anywhere. Also it would be better to check distance when using WarpIntoVehicle

2.Yep, WarpIntoVehicle(vehicles[randomInt],VehicleSeat.Driver);

3. You can use easier function World.GetClosestVehicle... :)

4.World.GetVehicles(position,radius) So vehicle wouldn't be everywhere...

 

Best Regards,

Paul.

Edited by leftas

Share this post


Link to post
Share on other sites
Compman

Sorry guys i made a mistake i am very very sorry :p

 

 

how to make the player not enter any of the vehicles ? :D

Share this post


Link to post
Share on other sites
Noox

leftas posted natives above and they work for rugz so you're using them wrong.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.