Jump to content

[SA] ~ CLEO Script Tutorial ~


ZAZ

Recommended Posts

Will be able to do so now that if I want the gun somewhere. But I would like that I need enough money that I can take the gun. Is it possible?

Link to comment
Share on other sites

 

ZAZ u have no idea how many people u helped with this inlove.gif  inlove.gif

No, not really. Thanks for nice reply.

Link to comment
Share on other sites

Thanks ZAZ Now Ii start read again and AGAIN every day and think it all and start some day mod project and again THANKS ZAZ you safe my life biggrin.gif

Link to comment
Share on other sites

 

Try the sript below, I assume that you have the required paths and traffic.

Shure the actor isn't a dino but the example with the actor which kills the player shows the effect of the spawning

and the command to kill player give it more dynamic alien.gif

Set the marker mode to 2 because with marker above actor you will see him in any case if you drive fast

 

{$CLEO .cs}:Spawn_by_random_actor_or_carthread 'SPAWNAC':Spawn_10001: wait 0 ms if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @Spawn_1077E: get_active_interior_to 29@if  and//-----check several situations when the spawning don't makes sense0039:   29@ ==  0  // integer values8965:  not actor $PLAYER_ACTOR swimming 84A7:   not actor $PLAYER_ACTOR driving_boat 89AE:   not actor $PLAYER_ACTOR driving_train 004D: jump_if_false @Spawn_1  0819: 30@ = actor $PLAYER_ACTOR distance_from_ground if 0023:   20.0 > 30@ 004D: jump_if_false @Spawn_10006: 1@ =  -1  // integer valuesif00DF: actor $PLAYER_ACTOR driving004D: jump_if_false @Spawn_30050: gosub @Spawn_searchCarsub_1//leads the readingprocess to a subscript//the readingprocess continues here with reading as soon as the return of the subscript is readedif8039:   NOT   1@ ==  -1  // checks if a radondom actor was found to get his coords004D: jump_if_false @Spawn_10006: 1@ =  -1  // integer values0002: jump @Spawn_Actor1:Spawn_30050: gosub @Spawn_searchPedsub_1//leads the readingprocess to a subscript//the readingprocess continues here with reading as soon as the return of the subscript is readedif8039:   NOT   1@ ==  -1  // checks if a radondom actor was found to get his coords004D: jump_if_false @Spawn_101C2: remove_references_to_actor 1@0006: 1@ =  -1  // integer values0002: jump @Spawn_Actor1:Spawn_Actor10247: request_model #WMOICE0247: request_model #AK47:Spawn_Actor30001: wait  0 ms00D6: if  and0248:   model #WMOICE available0248:   model #AK47 available004D: jump_if_false @Spawn_Actor3009A: 2@ = create_actor  24 #WMOICE at  25@ 26@ 27@0173: set_actor 2@ z_angle_to  0.001B2: give_actor 2@ weapon  30 ammo  99999  // Load the weapon model before using this02E2: set_actor 2@ weapon_accuracy_to  100//decrease this value if you don't want to be killed0223: set_actor 2@ health_to  10000946: set_actor 2@ actions_uninterupted_by_weapon_fire 1 060B: set_actor 2@ decision_maker_to 320187: 5@ = create_marker_above_actor 2@ 018B: set_marker 5@ radar_mode 3//set marker to mode 2 to show it only on radar05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR0249: release_model #WMOICE:Spawn_action_Loop0001: wait 0 ms if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @Spawn_Cleanupif and8118:   NOT   actor 2@ dead0104:   actor $PLAYER_ACTOR near_actor 2@ radius  80.0  80.0  10.0 sphere  0004D: jump_if_false @Spawn_Cleanup0002: jump @Spawn_action_Loop:Spawn_Cleanup0164: disable_marker 5@01C2: remove_references_to_actor 2@:Spawn_Restart// an extra loop to give a delay after Player respawn0001: wait 0 ms if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @Spawn_Restartwait 20000002: jump @Spawn_1:Spawn_searchCarsub_1//subscript must end with 0051: return04C4: create_coordinate 14@ 15@ 16@ from_actor $PLAYER_ACTOR offset -100.0  70.0  0.0// increase the y-offset04C4: create_coordinate 18@ 19@ 30@ from_actor $PLAYER_ACTOR offset  100.0  150.0  0.0053E: 0@ = get_random_car_with_model -1 in_rectangle_cornerA 14@ 15@ cornerB 18@ 19@0001: wait  50 msif8039:   NOT   0@ ==  -1  // integer values004D: jump_if_false @Spawn_searchCarsub_30001: wait  50 ms0407: create_coordinate 25@ 26@ 27@ from_car 0@ with_offset 0.0 0.0 1.00001: wait  50 ms00A6: destroy_car 0@0001: wait  250 ms0006: 1@ =  1  // integer values:Spawn_searchCarsub_30051: return:Spawn_searchPedsub_1//subscript must end with 0051: returnif80E1:   not player 0 pressed_key 19004D: jump_if_false @Spawn_searchPedsub_504C4: create_coordinate 14@ 15@ 16@ from_actor $PLAYER_ACTOR offset  0.0  0.0 0.0068D: get_camera_position_to 18@ 19@ 30@ 0087: 21@ = 18@  // floating-point values only0087: 22@ = 19@  // floating-point values only0087: 30@ = 18@  // floating-point values only0087: 31@ = 19@  // floating-point values only0063: 30@ -= 14@  // floating-point values0063: 31@ -= 15@  // floating-point values0013: 30@ *=  -2.0  // floating-point values0013: 31@ *=  -2.0  // floating-point values005B: 18@ += 30@  // floating-point values 005B: 19@ += 31@  // floating-point values0063: 18@ -= 14@  // floating-point values0063: 19@ -= 15@  // floating-point values0013: 18@ *=  -15.0  // floating-point values0013: 19@ *=  -15.0  // floating-point values005B: 21@ += 18@  // floating-point values 005B: 22@ += 19@  // floating-point values08E5: get_actor_in_sphere 21@ 22@ 16@ radius 31.5 handle_as 1@0001: wait  50 msif8039:   NOT   1@ ==  -1  // integer values004D: jump_if_false @Spawn_searchPedsub_5if00DF: actor 1@ driving004D: jump_if_false @Spawn_searchPedsub_304C4: store_coords_to 25@ 26@ 27@ from_actor 1@ with_offset -2.5 0.0 0.50002: jump @Spawn_searchPedsub_5:Spawn_searchPedsub_304C4: store_coords_to 25@ 26@ 27@ from_actor 1@ with_offset -0.5 0.0 0.0 :Spawn_searchPedsub_50051: return

 

Zaz, sorry if this seems odd or late but i was wondering if this code could be activated with a mission marker along with a play audio file opcode? Once activated i would prefer to keep it enabled. Sort of a step into mission marker, hear the audio file, then the ped spawns constantly and attacks.

Link to comment
Share on other sites

 

Zaz, sorry if this seems odd or late but i was wondering if this code could be activated with a mission marker along with a play audio file opcode? Once activated i would prefer to keep it enabled. Sort of a step into mission marker, hear the audio file, then the ped spawns constantly and attacks.

add a check for "if player is near point in sphere 1"

 

:Spawn_10001: wait 0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @Spawn_1if00FE:   actor $PLAYER_ACTOR near_point 1 in_sphere 2491.5  -1667.5  13.35 radius 3.0 3.0 3.0 004D: jump_if_false @Spawn_1

 

 

and a sound code when all checks are passed

 

if 0023:   20.0 > 30@ 004D: jump_if_false @Spawn_10006: 1@ =  -1  // integer values097A: play_audio_at 0.0 0.0 0.0 event 1057

 

Link to comment
Share on other sites

Thanks Zaz, but it would seem it only creates a marker and when the player steps out it simply reappears and nothing else happens. Also i was hoping to play an audio file from a specified folder.

 

 

{$CLEO .cs}:Spawn_by_random_actor_or_carthread 'SPAWNAC':Spawn_10001: wait 0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @Spawn_1if00FE:   actor $PLAYER_ACTOR near_point 1 in_sphere -761.4051 -2040.5336 9.8266 radius 1.0 1.0 1.0004D: jump_if_false @Spawn_1077E: get_active_interior_to 29@if  and//-----check several situations when the spawning don't makes sense0039:   29@ ==  0  // integer values8965:  not actor $PLAYER_ACTOR swimming84A7:   not actor $PLAYER_ACTOR driving_boat89AE:   not actor $PLAYER_ACTOR driving_train004D: jump_if_false @Spawn_1  0819: 30@ = actor $PLAYER_ACTOR distance_from_groundif0023:   20.0 > 30@004D: jump_if_false @Spawn_10006: 1@ =  -1  // integer valuesif00DF: actor $PLAYER_ACTOR driving004D: jump_if_false @Spawn_30050: gosub @Spawn_searchCarsub_1//leads the readingprocess to a subscript//the readingprocess continues here with reading as soon as the return of the subscript is readedif8039:   NOT   1@ ==  -1  // checks if a radondom actor was found to get his coords004D: jump_if_false @Spawn_10006: 1@ =  -1  // integer values0002: jump @Spawn_Actor1:Spawn_30050: gosub @Spawn_searchPedsub_1//leads the readingprocess to a subscript//the readingprocess continues here with reading as soon as the return of the subscript is readedif8039:   NOT   1@ ==  -1  // checks if a radondom actor was found to get his coords004D: jump_if_false @Spawn_101C2: remove_references_to_actor 1@0006: 1@ =  -1  // integer values0002: jump @Spawn_Actor1:Spawn_Actor10247: request_model #WMOICE0247: request_model #AK47:Spawn_Actor30001: wait  0 ms00D6: if  and0248:   model #WMOICE available0248:   model #AK47 available004D: jump_if_false @Spawn_Actor3009A: 2@ = create_actor  24 #WMOICE at  25@ 26@ 27@0173: set_actor 2@ z_angle_to  0.001B2: give_actor 2@ weapon  30 ammo  99999  // Load the weapon model before using this02E2: set_actor 2@ weapon_accuracy_to  100//decrease this value if you don't want to be killed0223: set_actor 2@ health_to  10000946: set_actor 2@ actions_uninterupted_by_weapon_fire 1060B: set_actor 2@ decision_maker_to 320187: 5@ = create_marker_above_actor 2@018B: set_marker 5@ radar_mode 3//set marker to mode 2 to show it only on radar05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR0249: release_model #WMOICE:Spawn_action_Loop0001: wait 0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @Spawn_Cleanupif and8118:   NOT   actor 2@ dead0104:   actor $PLAYER_ACTOR near_actor 2@ radius  80.0  80.0  10.0 sphere  0004D: jump_if_false @Spawn_Cleanup0002: jump @Spawn_action_Loop:Spawn_Cleanup0164: disable_marker 5@01C2: remove_references_to_actor 2@:Spawn_Restart// an extra loop to give a delay after Player respawn0001: wait 0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @Spawn_Restartwait 20000002: jump @Spawn_1:Spawn_searchCarsub_1//subscript must end with 0051: return04C4: create_coordinate 14@ 15@ 16@ from_actor $PLAYER_ACTOR offset -100.0  70.0  0.0// increase the y-offset04C4: create_coordinate 18@ 19@ 30@ from_actor $PLAYER_ACTOR offset  100.0  150.0  0.0053E: 0@ = get_random_car_with_model -1 in_rectangle_cornerA 14@ 15@ cornerB 18@ 19@0001: wait  50 msif8039:   NOT   0@ ==  -1  // integer values004D: jump_if_false @Spawn_searchCarsub_30001: wait  50 ms0407: create_coordinate 25@ 26@ 27@ from_car 0@ with_offset 0.0 0.0 1.00001: wait  50 ms00A6: destroy_car 0@0001: wait  250 ms0006: 1@ =  1  // integer values:Spawn_searchCarsub_30051: return:Spawn_searchPedsub_1//subscript must end with 0051: returnif80E1:   not player 0 pressed_key 19004D: jump_if_false @Spawn_searchPedsub_504C4: create_coordinate 14@ 15@ 16@ from_actor $PLAYER_ACTOR offset  0.0  0.0 0.0068D: get_camera_position_to 18@ 19@ 30@0087: 21@ = 18@  // floating-point values only0087: 22@ = 19@  // floating-point values only0087: 30@ = 18@  // floating-point values only0087: 31@ = 19@  // floating-point values only0063: 30@ -= 14@  // floating-point values0063: 31@ -= 15@  // floating-point values0013: 30@ *=  -2.0  // floating-point values0013: 31@ *=  -2.0  // floating-point values005B: 18@ += 30@  // floating-point values005B: 19@ += 31@  // floating-point values0063: 18@ -= 14@  // floating-point values0063: 19@ -= 15@  // floating-point values0013: 18@ *=  -15.0  // floating-point values0013: 19@ *=  -15.0  // floating-point values005B: 21@ += 18@  // floating-point values005B: 22@ += 19@  // floating-point values08E5: get_actor_in_sphere 21@ 22@ 16@ radius 31.5 handle_as 1@0001: wait  50 msif8039:   NOT   1@ ==  -1  // integer values004D: jump_if_false @Spawn_searchPedsub_5if00DF: actor 1@ driving004D: jump_if_false @Spawn_searchPedsub_304C4: store_coords_to 25@ 26@ 27@ from_actor 1@ with_offset -2.5 0.0 0.50002: jump @Spawn_searchPedsub_5:Spawn_searchPedsub_304C4: store_coords_to 25@ 26@ 27@ from_actor 1@ with_offset -0.5 0.0 0.0:Spawn_searchPedsub_50051: return

 

Link to comment
Share on other sites

 

Thanks Zaz, but it would seem it only creates a marker and when the player steps out it simply reappears and nothing else happens. Also i was hoping to play an audio file from a specified folder.

Because the game don't find random actors or cars in "Back o Beyond" to get spawn coords.

You have to use another method

 

change this parts:

 

if00DF: actor $PLAYER_ACTOR driving004D: jump_if_false @Spawn_30050: gosub @Spawn_searchCarsub_1//leads the readingprocess to a subscript//the readingprocess continues here with reading as soon as the return of the subscript is readedif8039:   NOT   1@ ==  -1  // checks if a radondom actor was found to get his coords004D: jump_if_false @Spawn_10006: 1@ =  -1  // integer values0002: jump @Spawn_Actor1:Spawn_30050: gosub @Spawn_searchPedsub_1//leads the readingprocess to a subscript//the readingprocess continues here with reading as soon as the return of the subscript is readedif8039:   NOT   1@ ==  -1  // checks if a radondom actor was found to get his coords004D: jump_if_false @Spawn_101C2: remove_references_to_actor 1@0006: 1@ =  -1  // integer values0002: jump @Spawn_Actor1:Spawn_Actor10247: request_model #WMOICE0247: request_model #AK47:Spawn_Actor30001: wait  0 ms00D6: if  and0248:   model #WMOICE available0248:   model #AK47 available004D: jump_if_false @Spawn_Actor3009A: 2@ = create_actor  24 #WMOICE at  25@ 26@ 27@0173: set_actor 2@ z_angle_to  0.001B2: give_actor 2@ weapon  30 ammo  99999  // Load the weapon model before using this02E2: set_actor 2@ weapon_accuracy_to  100//decrease this value if you don't want to be killed0223: set_actor 2@ health_to  10000946: set_actor 2@ actions_uninterupted_by_weapon_fire 1 060B: set_actor 2@ decision_maker_to 320187: 5@ = create_marker_above_actor 2@ 018B: set_marker 5@ radar_mode 2//set marker to mode 2 to show it only on radar05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR0249: release_model #WMOICE

 

 

into this:

 

_PostMark

 

097A: play_audio_at 0.0 0.0 0.0 event 105704C4: create_coordinate 25@ 26@ 27@ from_actor $PLAYER_ACTOR offset 10.0  4.0  0.2:Spawn_Actor10247: request_model #WMOICE0247: request_model #AK47:Spawn_Actor30001: wait  0 ms00D6: if  and0248:   model #WMOICE available0248:   model #AK47 available004D: jump_if_false @Spawn_Actor3009A: 2@ = create_actor  24 #WMOICE at  25@ 26@ 27@0173: set_actor 2@ z_angle_to  0.001B2: give_actor 2@ weapon  30 ammo  99999  // Load the weapon model before using this02E2: set_actor 2@ weapon_accuracy_to  100//decrease this value if you don't want to be killed0223: set_actor 2@ health_to  10000946: set_actor 2@ actions_uninterupted_by_weapon_fire 1 060B: set_actor 2@ decision_maker_to 320187: 5@ = create_marker_above_actor 2@ 018B: set_marker 5@ radar_mode 2//set marker to mode 2 to show it only on radar0249: release_model #WMOICE0337: set_actor 2@ visibility 004C4: create_coordinate 24@ 25@ 26@ from_actor $PLAYER_ACTOR offset  0.3  0.7 0.0068D: 16@ 17@ 18@//get_camera_position0087: 18@ = 16@  // floating-point values only0087: 19@ = 17@  // floating-point values only0063: 18@ -= 24@  // floating-point values0063: 19@ -= 25@  // floating-point values0013: 18@ *=  -0.5  // floating-point values0013: 19@ *=  -0.5  // floating-point values005B: 16@ += 18@  // floating-point values 005B: 17@ += 19@  // floating-point values05D3: AS_actor 2@ goto_point 16@ 17@ 26@ mode 7 500 ms // versionAwait 10000337: set_actor 2@ visibility 105E2: AS_actor 2@ kill_actor $PLAYER_ACTOR

 

 

 

 

with this link

http://www.gtaforums.com/index.php?showtop...54542#_PostMark

and with this

http://www.gtaforums.com/index.php?act=ST&...54542#_PostMark

and this

http://www.gtaforums.com/index.php?act=ST&...154542#PostMark

 

Edited by ZAZ
Link to comment
Share on other sites

Michael.Knight1

hello people , I Thinks if You will help me wink.gif

I'am finished in my new Mod Hitman Blood Money for gta san andreas is a full version and the next is Hitman Contracts and Was left to me just hitman Weapons Spawn !!

I make it but in i select a weapons I will not find the weapons at player

that's some of my script , pleasse what is the Error here ??

allways peace

03E5: show_text_box 'AMMU_H' Player.CanMove($PLAYER_CHAR) = False08D4: $WP = create_panel_with_title 'WSPAWN' position 40.0 150.0 width 186.0 columns 1 interactive 1 background 1 alignment 1 08DB: set_panel $WP column 0 header 'SP' data 'SP1' 'SP2' 'SP3' 'SP4' 'SP5' 'SP6' 'SP7' 'SP8' 'SP9' 'DUMMY' 'DUMMY' 'DUMMY' -i put the camera on actor===================================:HITMANWEAPONS_100001: wait 0 ms 00D6: if 8449:   not actor $PLAYER_ACTOR in_a_car 004D: jump_if_false @HITMANWEAPONS_70000D6: if$ONMISSION == 0 004D: jump_if_false @HITMANWEAPONS_5000871: init_jump_table $WEAPONS total_jumps 7 default_jump 0 @HITMANWEAPONS_400 jumps 0 @HITMANWEAPONS_100 1 @HITMANWEAPONS_111 2 @HITMANWEAPONS_122 3 @HITMANWEAPONS_133 4 @HITMANWEAPONS_144 5 @HITMANWEAPONS_155 6 @HITMANWEAPONS_166:HITMANWEAPONS_4000871: init_jump_table $WEAPONS total_jumps 2 default_jump 0 @HITMANWEAPONS_100  jumps 8 @HITMANWEAPONS_177 9 @HITMANWEAPONS_188 10 @HITMANWEAPONS_100 -1 @HITMANWEAPONS_100 -1 @HITMANWEAPONS_100 -1 @HITMANWEAPONS_100 -1 @HITMANWEAPONS_100===================================then i jump all to hitmanweapons_500 ===================================:HITMANWEAPONS_600I GIVE ACTOR WEAPONS [ $WEAPONS]:HITMANWEAPONS_700 I Removethe panel and restor Camera  then i Put the player can move0A92: create_custom_thread "Weapon-Spawn.cs"0A93: end_custom_thread

 

G1T
Link to comment
Share on other sites

pleasse what is the Error here ??

 

You.

Link to comment
Share on other sites

Michael.Knight1

 

pleasse what is the Error here ??

 

You.

You Start The War @SilentPL . . .

You are dumb , stupid and also ugly . . .

Does not take knowledge from the capital of the Stupid .

you must not kidding .

that really pissed me off man, you need to have more respect for people man, seriously, stop being such as dick about it and deal with it, learn to accept the word no, because im tired of asking you to please not use my stuff, i dont mind you using my stuff ok , you need to accept this, when someone says no it means no, dont try and argue about it ok, its just a video game, theres no reason to go all bitchy and asshole about it, sure im an ass about it too, but just because they are annoying assholes who wont listen like you are, so please try and be more respectful and maybe i might not have to be a asshole about everything, anyways im done talking about it, i still dont like you and that will not change ever, so please just credit us and drop it already, goodbye

G1T
Link to comment
Share on other sites

 

pleasse what is the Error here ??

 

You.

You Start The War @SilentPL . . .

You are dumb , stupid and also ugly . . .

Does not take knowledge from the capital of the Stupid .

you must not kidding .

that really pissed me off man, you need to have more respect for people man, seriously, stop being such as dick about it and deal with it, learn to accept the word no, because im tired of asking you to please not use my stuff, i dont mind you using my stuff ok , you need to accept this, when someone says no it means no, dont try and argue about it ok, its just a video game, theres no reason to go all bitchy and asshole about it, sure im an ass about it too, but just because they are annoying assholes who wont listen like you are, so please try and be more respectful and maybe i might not have to be a asshole about everything, anyways im done talking about it, i still dont like you and that will not change ever, so please just credit us and drop it already, goodbye

@SilentPL Hahaha nice one icon14.gif

 

@Michael.Retard1 Why did he start the war? But even if he did, there's absolutely no need to offend him and write that he is dumb, stupid and ugly. First take a look at yourself, tough guy. You just come here, write your gibberish crap. From what I have seen, you are the troublemaker here. You write that SilentPL has no respect but again look at yourself. You are bitching around every time somebody does not understand your gibberish crap because of your crappy english skill. Instead of wasting your time with III Era Coding that you will never understand anyway, go and learn english. It's more important in life. icon14.gif

Link to comment
Share on other sites

  • 2 weeks later...
MichaelKnight1

Zaz I Follow Your Tutorial for Memory Address , but i find problem in this address

0x969130 - Weapon Set 10x969131 - Weapon Set 20x969132 - Weapon Set 3

 

is not work ??

 

{$CLEO .cs}thread 'MAIN'wait 3000:MAIN_10A8D: 1@ = read_memory 0x969130   size 4 virtual_protect 1wait 10003F0: text_draw_toggle  10001: wait  50 ms03F0: text_draw_toggle  00001: wait  50 ms045A: text_draw_1number  250.0  40.0 'NUMBER' 1@0A8C: write_memory 0x969130   size 4 value 2 virtual_protect 10A93: end_custom_thread

 

 

also i use call scm function

0AA5: call 0x438370 _cheatEnableLegimate num_params 1 pop 1 cheat_ID 0

 

http://www.gtaforums.com/index.php?showtop...entry1060963546

everyone not work ??

When the player load a weapons Then after three seconds Leave them ! Why ??

Link to comment
Share on other sites

read_memory

 

the cleo opcodes 0A8D: and 0A8C: to read the content of memory adresses

at first we must know which adress have a function

you can find a list at: gtamodding.com

for exemple:

0x863984 - [int32] Gravity

 

a simple GRAVITY script with text_draw opcodes to show the content of the adress:

 

{$CLEO .cs}thread 'GRAVITY'wait 3000:GRAVITY_10A8D: 1@ = read_memory 0x863984   size 4 virtual_protect 1wait 10003F0: text_draw_toggle  10001: wait  50 ms03F0: text_draw_toggle  00001: wait  50 ms045A: text_draw_1number  250.0  40.0 'NUMBER' 1@0A8C: write_memory 0x863984   size 4 value 2 virtual_protect 1 //clear the buffer0A93: end_custom_thread

 

 

at the end we pushes the value 2 into the memory adress

test the script and look for result

2 seems to have the best effect but this adress is really crazy and if we push a float value the effect is different

try

 

0A8C: write_memory 0x863984   size 4 value 10.0 virtual_protect 1 //clear the buffer

 

and you will see the trees deforming

It's actually float value, not Int32.

By default GTA SA gravity is equal to 1/125 = 0.008

Why do you draw float value as it was integer then? It will look oddly.

 

There are few ways to draw floats, i'll show you my functions:

 

 

:DrawFloatOnScreen{Description:    Draws float on screen using TCFLT or TCFLTN GXT entry. Parameters:  Passed:    0@ - number (float)    1@ - accuracy      2@ - screen pos X    3@ - screen pos Y      Result:    noneExample: 0AB1: call_scm_func @DrawFloatOnScreen 4 number 5@ accuracy 1 position 320.0 240.0}0AB1: call_scm_func @FloatPartsToIntegerValuesLengthSpecified 2 num 0@ after_comma_accuraccy 1 before_point_to 4@ after_point 5@   if    0@ < 0.0   then   045B: draw_text_2numbers 2@ 3@ GXT 'TCFLTN' numbers 4@ 5@   else   045B: draw_text_2numbers 2@ 3@ GXT 'TCFLT' numbers 4@ 5@   end0AB2: ret 0:FloatPartsToIntegerValuesLengthSpecified{Description:    Converts a float part before and after point to integer values Parameters:  Passed:    0@ - number (float)     1@ - precision      Result:    0@ - before point    1@ - after point Example: 0AB1: call_scm_func @FloatPartsToIntegerValuesLengthSpecified 2 num 1.0 after_comma_accuraccy 4 before_point_to 1@ after_point 2@}0097: make 0@ absolute_float0092: 2@ = float 0@ to_integer0093: 3@ = integer 2@ to_float0063: 0@ -= 3@  // (float)   if   1@ > 0   then   4@ = 10.0       while 1@ > 1       4@ *= 10.0           1@ -= 1       end   006B: 0@ *= 4@  // (float)       end 0092: 3@ = float 0@ to_integer 0093: 3@ = integer 3@ to_float 0087: 4@ = 0@ // (float)0063: 4@ -= 3@  // (float)  0092: 0@ = float 0@ to_integer   if   4@ > 0.0   then   0@ += 1   end0AB2: ret 2 2@ 0@

 

,

FloatPartsToIntegerValuesLengthSpecified gives you two parts of number as integer: before comma and after comma.

You must specify the accuracy.

DrawFloatOnScreen draws it on screen using GXT entries:

 

TCFLT ~r~~1~.~1~TCFLTN ~r~-~1~.~1~

 

Link to comment
Share on other sites

can someone tell my how to spawn added cars not replaced ?? because when i try spawn car whit id 18631 it just wont show up. confused.gif

Link to comment
Share on other sites

 

can someone tell my how to spawn added cars not replaced ?? because when i try spawn car whit id 18631 it just wont show up. confused.gif

Try it first with origin car id. Change then the id when you saw that it worked fine.

 

{$CLEO .cs}thread 'CARSPWI' 0@ = 411 // < --- model IDwhile truewait 0    if       Player.Defined($PLAYER_CHAR)   then        if            0AB0:   key_pressed 8// ----- press BACKSPACE        then            04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.2            Model.Load(0@)               while not Model.Available(0@)               wait 0               end            1@ = Car.Create(0@, 11@, 12@, 13@)           Model.Destroy(0@)           Car.RemoveReferences(1@)           wait 1000       end   endend

 

 

Use Cleo carspawner for added cars:

Car Spawner By Fastman92 (cleo4)

AddCar spawner by ZAZ (cleo3/4)

 

Please don't post again here unless you have a question about the tutorial lessons

 

 

Edited by ZAZ
Link to comment
Share on other sites

 

can someone tell my how to spawn added cars not replaced ?? because when i try spawn car whit id 18631 it just wont show up. confused.gif

Try it first with origin car id. Change then the id when you saw that it worked fine.

 

{$CLEO .cs}thread 'CARSPWI' 0@ = 411 // < --- model IDwhile truewait 0    if       Player.Defined($PLAYER_CHAR)   then        if            0AB0:   key_pressed 8// ----- press BACKSPACE        then            04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.2            Model.Load(0@)               while not Model.Available(0@)               wait 0               end            1@ = Car.Create(0@, 11@, 12@, 13@)           Model.Destroy(0@)           Car.RemoveReferences(1@)           wait 1000       end   endend

 

 

Use Cleo carspawner for added cars:

Car Spawner By Fastman92 (cleo4)

AddCar spawner by ZAZ (cleo3/4)

 

Please don't post again here unless you have a question about the tutorial lessons

but can i make that car spawn in some location like in grove street? not whit key pressing. i using this code

014B: $PARKED_1 = init_parked_car_generator #AUDITT color 1 1 1 alarm 0 door_lock 0 0 10000 at 2552.3 -1692.5 9.2797 angle 0.0014C: set_parked_car_generator $PARKED_1 cars_to_generate_to 101 

 

but only cars whit id 612 and 613 spawning

Link to comment
Share on other sites

No

 

Edited by ZAZ
Link to comment
Share on other sites

MichaelKnight1

Hello Zaz sarcasm.gif , I want to know What is The Hex ??

and How To do it , anyways peace

 

Link to comment
Share on other sites

Hello Zaz sarcasm.gif , I want to know What is The Hex ??

and How To do it , anyways peace

...How do you function?

Link to comment
Share on other sites

can someone tell my how to spawn added cars not replaced ?? because when i try spawn car whit id 18631 it just wont show up. confused.gif

Try it first with origin car id. Change then the id when you saw that it worked fine.

 

{$CLEO .cs}thread 'CARSPWI' 0@ = 411 // < --- model IDwhile truewait 0    if       Player.Defined($PLAYER_CHAR)   then        if            0AB0:   key_pressed 8// ----- press BACKSPACE        then            04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.2            Model.Load(0@)               while not Model.Available(0@)               wait 0               end            1@ = Car.Create(0@, 11@, 12@, 13@)           Model.Destroy(0@)           Car.RemoveReferences(1@)           wait 1000       end   endend

 

 

Use Cleo carspawner for added cars:

Car Spawner By Fastman92 (cleo4)

AddCar spawner by ZAZ (cleo3/4)

 

Please don't post again here unless you have a question about the tutorial lessons

but can i make that car spawn in some location like in grove street? not whit key pressing. i using this code

014B: $PARKED_1 = init_parked_car_generator #AUDITT color 1 1 1 alarm 0 door_lock 0 0 10000 at 2552.3 -1692.5 9.2797 angle 0.0014C: set_parked_car_generator $PARKED_1 cars_to_generate_to 101 

 

but only cars whit id 612 and 613 spawning

GTA SA exe function that registers parket generatator checks if ID of vehicle is between 400 and 630 (range intentionally reserved for vehicles). You need ro patch this function in gta_sa.exe menory.

I have no time left to to do it since i started working to understand format of Painkiller's archives. I almost finished and now i only need to decode files that are compressed with ZLib algorithm. So Painkiller modding will be on the run.

Link to comment
Share on other sites

MichaelKnight1

I salute all the people , I always say Peace , ok will go into the heart of the matter , in This Script While I Wanna To Active The Code Number 2 or 3 . . . Does not work . But The Code 1 is Work Is there a mistake of the Jump To Label ?? so This Pt. in my script , anyways peace icon14.gif

{$CLEO}thread 'NEWKEYPCC' 0662: NOP "NEW KEYPRESS CHEAT CODE" 0662: NOP "CHEAT DISABLED BY FASTMA92" 0662: NOP "VERSION : 1.0" 0662: NOP "AUTHOR : MICHAEL.KNIGHT1" 0662: NOP "VISIT WWW.GTAUNITEDGANG.UCOZ.COM" :NEWKEYPCC_157wait 0 if   Player.Defined($PLAYER_CHAR)  Actor.Defined($PLAYER_ACTOR)jf @NEWKEYPCC_157 if   Player.Controllable($PLAYER_CHAR)jf @NEWKEYPCC_157 :NEWKEYPCC_198wait 0 if and0AB0:   key_pressed 72 0AB0:   key_pressed 65 0AB0:   key_pressed 77 jf @NEWKEYPCC_198 03E6: remove_text_box 03E5: show_text_box 'C_ACTIVE' 0AA5: call 4427328 1 pop 1 3 wait 1500 :NEWKEYPCC_265wait 0 if and0AB0:   key_pressed 72 0AB0:   key_pressed 65 0AB0:   key_pressed 77 jf @NEWKEYPCC_265 03E6: remove_text_box Player.Money($PLAYER_CHAR) += -250000Actor.Armour($PLAYER_ACTOR) = -100Actor.Health($PLAYER_ACTOR) = 1003E5: show_text_box 'C_DEACTI' wait 1500 jump @NEWKEYPCC_157 :NEWKEYPCC_349wait 0 if and0AB0:   key_pressed 87 0AB0:   key_pressed 65 0AB0:   key_pressed 78 jf @NEWKEYPCC_349 03E5: show_text_box 'C_ACTIVE' 0AA5: call 4427408 1 pop 1 4 wait 1500 jump @NEWKEYPCC_157 :NEWKEYPCC_421wait 0 if and0AB0:   key_pressed 67 0AB0:   key_pressed 87 0AB0:   key_pressed 76 jf @NEWKEYPCC_421 03E5: show_text_box 'C_ACTIVE' 0AA5: call 4427552 1 pop 1 5 jump @NEWKEYPCC_157 :NEWKEYPCC_488wait 0 if and0AB0:   key_pressed 83 0AB0:   key_pressed 87 0AB0:   key_pressed 76 jf @NEWKEYPCC_488 03E5: show_text_box 'C_ACTIVE' 0AA5: call 4427552 1 pop 1 66 jump @NEWKEYPCC_157 :NEWKEYPCC_555wait 0 if and0AB0:   key_pressed 83 0AB0:   key_pressed 87 jf @NEWKEYPCC_555 03E5: show_text_box 'C_ACTIVE' 0AA5: call 4427584 1 pop 1 6 jump @NEWKEYPCC_157 :NEWKEYPCC_618wait 0 if and0AB0:   key_pressed 86 0AB0:   key_pressed 83 0AB0:   key_pressed 87 jf @NEWKEYPCC_618 03E5: show_text_box 'C_ACTIVE' 0AA5: call 4427600 1 pop 1 7 jump @NEWKEYPCC_157 :NEWKEYPCC_685wait 0 if and0AB0:   key_pressed 79 0AB0:   key_pressed 67 0AB0:   key_pressed 87 jf @NEWKEYPCC_685 03E5: show_text_box 'C_ACTIVE' 0AA5: call 4427616 1 pop 1 8 jump @NEWKEYPCC_157

 

Edited by MichaelKnight1
Link to comment
Share on other sites

Please write the keypress names as comment behind their number

 

0AB0:   key_pressed 72//  h key

 

 

Bind your checks like a chain like in this Teleport lesson

study how i extended the simple script to a larger one

Link to comment
Share on other sites

MichaelKnight1
Please write the keypress names as comment behind their number

 

0AB0:   key_pressed 72//  h key

 

 

Bind your checks like a chain like in this Teleport lesson

study how i extended the simple script to a larger one

Thanks Zaz is Work , I Will Continued For My Work ++ icon14.gif

Link to comment
Share on other sites

ChuckFeedSeed

I want to teleport inside a building like...the hospital near G-street how do i get there?

Link to comment
Share on other sites

 

I want to teleport inside a building like...the hospital near G-street how do i get there?

read Teleport lesson

Link to comment
Share on other sites

 

 

 

 

This Post Have Been Sloved For personal reasons

 

Edited by SA-Modding
G1T
Link to comment
Share on other sites

Learn first writing normal scripts. Mission script is advanced coding and to execute much code. Atm. you really don't need this method because you can run several scenes in serie by writing one cs script.

Read the tutorial lessons careful, study and test the example scripts. Do that again and again.

I recomand to understand these lessons complete:

 

 

The first 6 chapters are written in this first post, below of the index

 

Chapter lesson
First Steps in Cleo scripting

with Sannybuilder

- Start for newbies
The Editor - The main functions

- Option: different view of the decompiled code

- Classes and Keywords

Data types - locals @, globals $, "strings '

and hash # to enter modelname

Scripting/Writing a Thread

 

coding in praxis,

a must-read for newbies

- Using conditional checks

- The IF - Variation

- Script structure simple

- Script structure extended

- Script exemble: Slowmotion

- Spawn a 3D model

- Placing cars by using parked_car_generator

Special Particularities in Cleo - enable_thread_saving

- special cleo global var

- Script Exemble by using Special Global Cleo Variable/ Store a car at any place

- Template for Cleo Mission Script

gosub ... to read a subscript - basic knowledge to understand mission scripts

 

Math coding

 

the lessons are in one post

 

- give access with math coding

- Access check with local variables

- Declare or not declare (first reason)

- Time check for milliseconds in real time

- Time check for game hours

- Integer values and floating points

- Declare or not declare (second reason)

- Integer to float and reversed

- Show the calculated values with text_draw opcode

- Math calculations

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.