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. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    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  
bhavinbhai2707

Get Players Personal car and details

Recommended Posts

bhavinbhai2707

Hey guys. . . .its been months since i stopped coding in gta v due to my exams n i am completely blank now ,how can i know that the car traveled by the player is their personal car, and how can i get its complete information like plate number,color etc

Share this post


Link to post
Share on other sites
Tarackgame

Get the vehicle player is in, and if the car is a bagger, bodhi buffalo2 or tailgater, you know this vehicles are personal vehicles. Only one exist in gta v. Like bodhi,etc.. (Sorry bad english)

Share this post


Link to post
Share on other sites
unknown modder

Hey guys. . . .its been months since i stopped coding in gta v due to my exams n i am completely blank now ,how can i know that the car traveled by the player is their personal car, and how can i get its complete information like plate number,color etc

go hunting in the scripts, players personal vehicles are stored in a global variables, no idea where though, just that it will be there. Alternatively you could check if the vehicle has a blip, that'll tell you if its their vehicle

Share this post


Link to post
Share on other sites
alloc8or

 

Hey guys. . . .its been months since i stopped coding in gta v due to my exams n i am completely blank now ,how can i know that the car traveled by the player is their personal car, and how can i get its complete information like plate number,color etc

go hunting in the scripts, players personal vehicles are stored in a global variables, no idea where though, just that it will be there. Alternatively you could check if the vehicle has a blip, that'll tell you if its their vehicle

 

It's Global_68531 in b1011/1032 (vehicle handle is stored in Global_68531.f_581).

Edited by Unknown_Modder

Share this post


Link to post
Share on other sites
Tarackgame

Sorry for that but how can i /we acess to global variables? It is very useful :) Thank you!

Share this post


Link to post
Share on other sites
Tarackgame

And can we edit the globals? Or how can i acess

Share this post


Link to post
Share on other sites
alloc8or

And can we edit the globals? Or how can i acess

getGlobalPtr (ScriptHookV) and Game.Globals (SHVDN).

Share this post


Link to post
Share on other sites
Tarackgame

and what is global id? and how cani use? please :)

Share this post


Link to post
Share on other sites
Tarackgame

and can i set this globals?

I mean asd = getGlobalPtr(some ID )

asd = 1;

?
:D

Share this post


Link to post
Share on other sites
Tarackgame

And can i set the global value to string? Example: in all mission scripts, to handle dialogue, they sets a global to char with stringCopy :)

Share this post


Link to post
Share on other sites
alloc8or

 


*getGlobalPtr(globalId) = value;

 

Share this post


Link to post
Share on other sites
Tarackgame

Yes. But how can i set the value to char* like in dialogue_handler?

Share this post


Link to post
Share on other sites
Tarackgame

And what is the global id? Example: 0x101700 + 0x2095 + 0x539 + 0x1635 + 0x5 this?

And how can i acess global ids wich contains [iVar0] example?

Share this post


Link to post
Share on other sites
alloc8or

Take a look at this.

 

Share this post


Link to post
Share on other sites
Tarackgame

But this is in c#? I want to c++ :)

Share this post


Link to post
Share on other sites
Tarackgame

If you know, how can i copy a string to a global using strncpy_s or something please tell, i really want this. :) Very useful for me: )

Share this post


Link to post
Share on other sites
Tarackgame

Example: i want to start the dialogue_handler. With globals. but i have to use char* globals

Share this post


Link to post
Share on other sites
unknown modder

Example: i want to start the dialogue_handler. With globals. but i have to use char* globals

you sound like you need a more in depth understanding of c++. anyway here is an example using code from R*s scripts decompiler here https://www.gta5-mods.com/tools/decompiled-scripts-b757

 

//StringCopy(&Global_36886, "DRUNK", 16); found in a script - auto ptr = reinterpret_cast<char*>(getGlobalPr(36886));strcpy_s(ptr, 16, "DRUNK");ptr[15] = '\0'; //strcpy_s wont append a null terminator if the source string overflows the buffer. whereas StringCopy in the scripts always forces the string to be null terminated

Share this post


Link to post
Share on other sites
Tarackgame

Thank you! :)


Last question: I dont need to use 0x before the global?

Share this post


Link to post
Share on other sites
unknown modder

Thank you! :)

 

Last question: I dont need to use 0x before the global?

If you are using the scripts I provided, then the global indexes are already in decimal so you shouldn't prefix with 0x

Share this post


Link to post
Share on other sites
Tarackgame

And how can i set the global contains f_xx?? Like this?: getGlobalPtr(xxxxx + xxx) ?
If i'm right, how can i set the global wich contains this: Global_xxxxx[xxx(example: iVar1)]?

Thank you!

Share this post


Link to post
Share on other sites
JustAnotherComplexKid

Seconday if your close enough for GET_VEHICLE_PED_IS_IN or GET_VEHICLE_PED_IS_USING to return their vehicle, then to simply determine if its personal or not you could run,

 

Also @Unknown_Modder since you mentioned the global that stores their PV, Is there one that will return a vehicle a player is in (if they're in one) since the 2 natives above are distance based (technically) and will return null if so far from them. I can look for the Global myself just need to know if there is one so I don't waste my time.

if(DECOR_EXIST_ON(vehicle, "Player_Vehicle")){      //it's a personal vehicle also to get the value of that decor run,     int val = DECOR_GET_INT(vehicle, "Player_Vehicle");    The value it will return will be a hash if you want to match a player name with that hash the hash is generated by R* with    NETWORK_HASH_FROM_PLAYER_HANDLE <--   0xBC1D768F2F5D6C05     you can also check if this decor exist as well "PV_Slot" it simple just returns the slot it was in, in one of their garages.    tho the slot it returns it not eg 2/10. its the slot it was in out of the total slots of all their owned garages.. So if they say own 3 - 10 car garages it might return slot 27 which is oc out of 30 total slots.}
Edited by JustAnotherComplexKid

Share this post


Link to post
Share on other sites
unknown modder

 

Seconday if your close enough for GET_VEHICLE_PED_IS_IN or GET_VEHICLE_PED_IS_USING to return their vehicle, then to simply determine if its personal or not you could run,

 

if(DECOR_EXIST_ON(vehicle, "Player_Vehicle")){      //it's a personal vehicle also to get the value of that decor run,     int val = DECOR_GET_INT(vehicle, "Player_Vehicle");    The value it will return will be a hash if you want to match a player name with that hash the hash is generated by R* with    NETWORK_HASH_FROM_PLAYER_HANDLE <--   0xBC1D768F2F5D6C05     you can also check if this decor exist as well "PV_Slot" it simple just returns the slot it was in, in one of their garages.    tho the slot it returns it not eg 2/10. its the slot it was in out of the total slots of all their owned garages.. So if they say own 3 - 10 car garages it might return slot 27 which is oc out of 30 total slots.}

What you are talking about is GTA:Online only and doesn't belong in these forums

Share this post


Link to post
Share on other sites
JustAnotherComplexKid

Getting someones personal vehicle is online only as well. There is no personal vehicle in SP. There is vehicles that you have saved as your last vehicle in SP, but it's not considered a 'Personal Vehicle' as the name. So that's why I mentioned that.

Share this post


Link to post
Share on other sites
unknown modder

Getting someones personal vehicle is online only as well. There is no personal vehicle in SP. There is vehicles that you have saved as your last vehicle in SP, but it's not considered a 'Personal Vehicle' as the name. So that's why I mentioned that.

you do have a personal vehicle, franklin has the buffalo(and bagger), micheal has the tailgaiter and trevor has that pickup

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  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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