CLEO Help Getting car model ID crashes game?

CLEO related
Status
Not open for further replies.

Dalrae

Member
Joined
Sep 25, 2017
Messages
7
Reaction score
0
here is the script: 

Code:
03C0: 10@ = actor $PLAYER_ACTOR car
0137: 3@ = car 10@ model
0AD4: 2@ = scan_string 3@ format "%d"
0AF8: samp add_message_to_chat "%d" color 0x5ff441 

It doesn't error or anything, it just says it has stopped unexpectedly. 

I am sure there is something obvious, would appreciate any help!
 

Codex1337

Active member
Joined
Mar 1, 2014
Messages
170
Reaction score
1
03C0: 10@ = actor $PLAYER_ACTOR car
0137: 3@ = car 10@ model
0AD4: 2@ = scan_string 3@ format "%d" 4@
0AF8: samp add_message_to_chat "%d" color 0x5ff441    _carModelToPrint 4@
 

Dalrae

Member
Joined
Sep 25, 2017
Messages
7
Reaction score
0
Codex1337 said:
03C0: 10@ = actor $PLAYER_ACTOR car
0137: 3@ = car 10@ model
0AD4: 2@ = scan_string 3@ format "%d" 4@
0AF8: samp add_message_to_chat "%d" color 0x5ff441    _carModelToPrint 4@
hmm, that is still crashing.
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
Code:
03C0: 10@ = actor $PLAYER_ACTOR car
 0441: 3@ = car 10@ model
 CHATMSG samp add_message_to_chat "Model ID: %d" color 0x5ff441 3@

Model ID is an integer and cannot be scanned to get a string out of it.

Use 0ADB if you want the name of the car.
 

Dalrae

Member
Joined
Sep 25, 2017
Messages
7
Reaction score
0
0B36 said:
Code:
03C0: 10@ = actor $PLAYER_ACTOR car
 0441: 3@ = car 10@ model
 CHATMSG samp add_message_to_chat "Model ID: %d" color 0x5ff441 3@

Model ID is an integer and cannot be scanned to get a string out of it.

Use 0ADB if you want the name of the car.

I'm thinking that you can't scan it, but it IS a integer. I used this code:

Code:
:Loop
wait 0
0@ += 1
0AD1: show_formatted_text "Car model is on %d" time 10 0@
if
    0137:   car 10@ model == 0@
004D: jump_if_false @Loop
0AF8: samp add_message_to_chat "Vehicle ID: %d" color 0x5ff441 0@

and it worked perfectly, finding the ID, and making it the variable 0@.
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
Vehicle ID and Model ID are NOT the same thing. Vehicle IDs is allocated by the sa-mp server and are dynamic as they change when a vehicle is spawned, whereas model ID is static and allocated by the game itself. You can find vehicle ids by the built in sa-mp client command /dl.
 

Dalrae

Member
Joined
Sep 25, 2017
Messages
7
Reaction score
0
0B36 said:
Vehicle ID and Model ID are NOT the same thing. Vehicle IDs is allocated by the sa-mp server and are dynamic as they change when a vehicle is spawned,  whereas model ID is static and allocated by the game itself. You can find vehicle ids by the built in sa-mp client command /dl.

There IS a way to get it without that ID. All that I did was loop through the numbers from the vehicles ID (400 - 600 or something) and check to see if that is the ID.
 
Status
Not open for further replies.
Top