Quantcast

Jump to content

» «
Photo

Get Players Personal car and details

24 replies to this topic
bhavinbhai2707
  • bhavinbhai2707

    Rat

  • Members
  • Joined: 26 Mar 2016
  • India

#1

Posted 17 May 2017 - 06:12 AM

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 


Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#2

Posted 17 May 2017 - 01:31 PM

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)


unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#3

Posted 18 May 2017 - 01:02 PM

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


Unknown_Modder
  • Unknown_Modder

    ⭐⭐⭐⭐⭐

  • Members
  • Joined: 07 May 2015
  • Germany

#4

Posted 18 May 2017 - 02:20 PM Edited by Unknown_Modder, 18 May 2017 - 02:20 PM.

 

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).

  • unknown modder likes this

Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#5

Posted 19 May 2017 - 06:12 AM

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

Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#6

Posted 19 May 2017 - 06:17 AM

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

Unknown_Modder
  • Unknown_Modder

    ⭐⭐⭐⭐⭐

  • Members
  • Joined: 07 May 2015
  • Germany

#7

Posted 19 May 2017 - 09:30 AM

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

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


Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#8

Posted 19 May 2017 - 12:04 PM

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


Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#9

Posted 19 May 2017 - 12:10 PM

and can i set this globals?

I mean asd = getGlobalPtr(some ID )

asd = 1;


:D


Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#10

Posted 19 May 2017 - 01:23 PM

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 :)


Unknown_Modder
  • Unknown_Modder

    ⭐⭐⭐⭐⭐

  • Members
  • Joined: 07 May 2015
  • Germany

#11

Posted 19 May 2017 - 04:58 PM

*getGlobalPtr(globalId) = value;

Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#12

Posted 19 May 2017 - 05:00 PM

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


Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#13

Posted 19 May 2017 - 05:19 PM

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

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


Unknown_Modder
  • Unknown_Modder

    ⭐⭐⭐⭐⭐

  • Members
  • Joined: 07 May 2015
  • Germany

#14

Posted 19 May 2017 - 06:28 PM

Take a look at this.

 


Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#15

Posted 19 May 2017 - 06:39 PM

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


Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#16

Posted 19 May 2017 - 07:09 PM

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: )


Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#17

Posted 19 May 2017 - 07:18 PM

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


unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#18

Posted 19 May 2017 - 11:33 PM

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-mod...ed-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

Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#19

Posted 20 May 2017 - 06:59 AM

Thank you! :)


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


unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#20

Posted 20 May 2017 - 12:17 PM

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


Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#21

Posted 22 May 2017 - 07:09 PM

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!


JustAnotherComplexKid
  • JustAnotherComplexKid

    Player Hater

  • Members
  • Joined: 20 Jan 2017
  • United-States

#22

Posted 22 May 2017 - 09:14 PM Edited by JustAnotherComplexKid, 22 May 2017 - 09:17 PM.

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.
}

unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#23

Posted 22 May 2017 - 09:17 PM

 

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


JustAnotherComplexKid
  • JustAnotherComplexKid

    Player Hater

  • Members
  • Joined: 20 Jan 2017
  • United-States

#24

Posted 22 May 2017 - 10:10 PM

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.


unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#25

Posted 23 May 2017 - 01:10 AM

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users