Jump to content

source id


ajidehak

Recommended Posts

hi

i want use a source id in my script as a txt file,

mean, i have a lot of numbers(id) and now i want use all of this id in my script

but i not want use this:

 

if

id == 111

then

else

if

id == 1223

then

else

.

.

.

 

ok, i want use a txt file for my script but i not know how create it but a little i know it should like this:

 

my id's:

11 112 2234 2343 34345 34 45 54656

443 5665 765

 

ok, if anybody can help me, please try it.

thanks

Link to comment
Share on other sites

if i want use cleo3 then u what suggest to me?

and i want use a thing like this:

0A9D: readfile $hFILE size 2 to $150

 

thanks

Link to comment
Share on other sites

 

if i want use cleo3 then u what suggest to me?

and i want use a thing like this:

0A9D: readfile $hFILE size 2 to $150

 

thanks

study the FreeMovingCamera script, it reads virtual key numbers from ini file for keypressetting

the keynumbers must be written in quotation marks: enable freecam = "119"

the method description from original author, Aschratt/CLEO Sources

0A9A: 0@ = openfile ".\CLEO\blah.ini" mode 0x6272   // Binary Read (TextReading only used for complete strings)0A9D: readfile 0@ size 1 to 10@                     // store 1 byte to the buffer  

 

 

Another method:

Store informations in binary data: mode 0x6277 // binary write

the file then isn't editable with texteditor but you can store car-id, position, angle, color,, etc.. in a file and read it to spawn a "saved" car

 

script snippets:

 

03C0: 31@ = actor $PLAYER_ACTOR car00AA: store_car 31@ position_to 3@ 4@ 5@0174: 6@ = car 31@ Z_angle0441: 7@ = car 31@ model0988: get_car 31@ paintjob 8@03F3: get_car 31@ primary_color_to 9@ secondary_color_to 10@020A: set_car 31@ door_status_to 002AC: set_car 31@ immunities BP 1 FP 1 EP 1 CP 1 MP 10519: set_car 31@ locked 10633: AS_actor $PLAYER_ACTOR exit_car0092: 3@ = float 3@ to_integer0092: 4@ = float 4@ to_integer0092: 5@ = float 5@ to_integer0092: 6@ = float 6@ to_integer1@ = 02@ = 0if 0A9A: 0@ = openfile "CLEO\CarSaver.XD" mode 0x6277  // binary writethen  0A9E: writefile 0@ size 4 from 1@  0A9E: writefile 0@ size 4 from 2@  0A9E: writefile 0@ size 4 from 3@  0A9E: writefile 0@ size 4 from 4@  0A9E: writefile 0@ size 4 from 5@  0A9E: writefile 0@ size 4 from 6@  0A9E: writefile 0@ size 4 from 7@  0A9E: writefile 0@ size 4 from 8@  0A9E: writefile 0@ size 4 from 9@  0A9E: writefile 0@ size 4 from 10@     0A9B: closefile 0@end//////////////if0AAB:   file_exists "CLEO\CarSaver.XD"jf @skipif 0A9A: 0@ = openfile "CLEO\CarSaver.XD" mode 0x6272  // binary readthen  0A9D: readfile 0@ size 4 from 1@  0A9D: readfile 0@ size 4 from 2@  0A9D: readfile 0@ size 4 from 3@  0A9D: readfile 0@ size 4 from 4@  0A9D: readfile 0@ size 4 from 5@  0A9D: readfile 0@ size 4 from 6@  0A9D: readfile 0@ size 4 from 7@  0A9D: readfile 0@ size 4 from 8@  0A9D: readfile 0@ size 4 from 9@  0A9D: readfile 0@ size 4 from 10@     0A9B: closefile 0@end0093: 3@ = integer 3@ to_float0093: 4@ = integer 4@ to_float0093: 5@ = integer 5@ to_float0093: 6@ = integer 6@ to_float0247: load_model 7@:CarSaver0001: wait 0 ms00D6: if0248:   model 7@ available004D: jump_if_false @CarSaver0001: wait 0 ms00A5: 31@ = create_car 7@ at 3@ 4@ 5@0175: set_car 31@ Z_angle_to 6@06ED: set_car 31@ paintjob 8@0229: set_car 31@ primary_color_to 9@ secondary_color_to 10@020A: set_car 31@ door_status_to 002AC: set_car 31@ immunities BP 1 FP 1 EP 1 CP 1 MP 10519: set_car 31@ locked 10249: release_model 7@

 

Link to comment
Share on other sites

thanks for the great help of u, zaz.

but:

i want only read my id source in my script and i not want write anything else.

only read my source id,

if for u possible, please write to me a little closer for my question.

thanks a lot for all help of u.

 

((and one another thing: i updated this page:missile cleo4

if u want use missile by ryosuke in cleo4 , u can use it.))

Edited by ajidehak
Link to comment
Share on other sites

 

thanks for the great help of u, zaz.

but:

i want only read my id source in my script and i not want write anything else.

only read my source id,

if for u possible, please write to me a little closer for my question.

thanks a lot for all help of u.

 

((and one another thing: i updated this page:missile cleo4

if u want use missile by ryosuke in cleo4 , u can use it.))

you wrote you wanna use 0A9D:

but you mean you need a "global var"

 

To realize Global Variables for Cleo scripts exist following Cleo opcode connected with a special expression:

 

Opcode 0AB3: and 0AB4:

 

The expression var together with a number, <var><space><number> is building the Special Global Cleo Variable

 

 

0AB3: var 0 = 10or0006: 13@ =  10  // integer values0AB3: var 0 = 13@and0AB4: 0@= var 0

 

 

var 0 up to var 999 will be stored, in exemble var 0 is stored with 10

 

to get then stored value into your script needs to submit into a local:

 

0AB4: 13@ = var 44if0039:   13@ ==  1  // integer values004D: jump_if_false @nextlabel

 

 

search for the CARSTOR script in my tutorial to try an example

 

Link to comment
Share on other sites

i not want it,

i want only read a txt file of my source id, and i not want write anything on it,

and i not want use 0ab3, and i want only use only and only and only one txt or ini file in my script,

my source id txt file like this:

 

123 222 3445 3445 545 3554 4545 3545

 

it's id of some model in gta and i want use it in my script like this:

 

while 1@ < 20

read my txt file and get number in 21@

1@ += 1

end

 

ok,i want anything like this, are in cleo3 anything like this for me?

if yes,please learn me

if no, locked this topic and burn it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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.