Jump to content

[SA] ~ CLEO Script Tutorial ~


ZAZ

Recommended Posts

 

Thanks  blush.gif

 

So bottle id is : ? I don't know, going to search now.

Animation should be of CJ drinking like gang members and if drink too much he gets drunk (camera start moving)  http://www.gtagarage.com/mods/show.php?id=201 like in this mod. I havent tried this mod, just saw it. I want animation like on gta samp on roleplay servers , when get drunk camera start shaking, moving and even when u go in a car its alot harder to drive.

as bottle can we use model id 1520

you have to load the animation file "GANGS" for drinking

and if the dealer should do deal animations like pay, give'n take

you have also to load the animation file "DEALER"...

...together with model loading of the actor

 

if you did it right you can add an animation code for testing at that position where i wrote "// dealer script":

 

0605: actor 0@ perform_animation_sequence "DRNKBR_PRTL" from_file "GANGS"  4.0  1  1  1  0  -1

 

 

so do that and post your progress

Link to comment
Share on other sites

 

08E8: assign_external_script_handle 'DEALER' to_model 0@

What does this do ? i need an op to make that actor talk i came near him [so i can press Y or N]

 

 

 

Something like this ?

 

 

if00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  4.5  4.5  4.5thenwait 0If0AB0:   key_pressed 89then00FE:   actor $PLAYER_ACTOR perform_animation_sequence "DRNKBR_PRTL" from_file "GANGS"  4.0  1  1  1  0  -1end

 

 

 

while truewait 0 if     0256:   player $PLAYER_CHAR defined then     if         00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  80.5  80.5  80.5     then         0247: request_model #VBFYCRP         0247: request_model #1520         04ED: load_animation "GANGS"          repeat         wait 0             if                 0248:   model #VBFYCRP available                 0248:   model #1520 available             then                 break             end

or this. ? confused.gif

 

 

Made this too

04ED: load_animation "Gangs" wait 0 if 04EE:   animation "Gangs" loaded else_jump @Actor_1

 

Edited by kalonkas
Link to comment
Share on other sites

 

08E8: assign_external_script_handle 'DEALER' to_model 0@

What does this do ? i need an op to make that actor talk i came near him [so i can press Y or N]

works only in main.scm, it assigne an externscript of script.img to an actor

 

 

 

 

Something like this ?

 

 

if00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  4.5  4.5  4.5thenwait 0If0AB0:   key_pressed 89then00FE:   actor $PLAYER_ACTOR perform_animation_sequence "DRNKBR_PRTL" from_file "GANGS"  4.0  1  1  1  0  -1end

 

it should be closer, maybe 1.5 or 2.5

the keypress check must we implement in another way, i'll show it later, as i said, we have to build sequences

 

 

 

while truewait 0 if     0256:   player $PLAYER_CHAR defined then     if         00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  80.5  80.5  80.5     then         0247: request_model #VBFYCRP         0247: request_model #1520         04ED: load_animation "GANGS"          repeat         wait 0             if                 0248:   model #VBFYCRP available                 0248:   model #1520 available             then                 break             end

or this. ? confused.gif

ok, but as i said:

 

if there are more than one conditions in a check, it needs to determine if it means OR or AND
Link to comment
Share on other sites

So, how i have to do it?

 

Anyway , have you got skype biggrin.gif?

 

 

{$CLEO .cs}:Actor_103A4: name_thread 'Actor'while truewait 0 if     0256:   player $PLAYER_CHAR defined then     if          00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  80.5  80.5  80.5     then         0247: request_model #VBFYCRP         0247: request_model #1520        04ED: load_animation "GANGS"         repeat         wait 0             if  and                 0248:   model #VBFYCRP available                 0248:   model #1520 available                 04EE:   animation "GANGS" loaded              then                 break             end         until false         009A: 0@ = create_actor  4 #VBFYCRP at  -2347.7383 639.5254 42.07         0173: set_actor 0@ Z_angle_to 180.0         0249: release_model #VBFYCRP         while   0256:   player $PLAYER_CHAR defined         wait 0                   if  and                 8118: not  actor 0@ dead                  00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  85.5  85.5  85.5              then                 if00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  2.5  2.5  2.5thenwait 0If0AB0:   key_pressed 89then00FE:   actor $PLAYER_ACTOR perform_animation_sequence "DRNKBR_PRTL" from_file "GANGS"  4.0  1  1  1  0  -1             else                 break             end         end         01C2: remove_references_to_actor 0@          repeat         wait 0         until 80EC: not  actor $PLAYER_ACTOR 0 near_point -2347.7383 639.5254 42.07 radius 85.5 85.5     end endend

 

 

Like this? But when i try to compile it says - Compiled file has no header, so the model name #1520 can not be used. Use number ID instead.

Edited by kalonkas
Link to comment
Share on other sites

 

 

Like this? But when i try to compile it says - Compiled file has no header, so the model name #1520 can not be used. Use number ID instead.

you didn't read the tutorial careful where i wrote in the lesson "Spawn a 3D model"

# marks the connected entry as filename of a loadable model

For Cleo can only be used models which are defined in vehicles.ide, peds.ide or default.ide

Other models needs to use their ID number

 

For exemble to spawn the object 1655, waterjumpx2 of data\maps\generic\multiobj.ide

and posted an example script

 

 

in addition is your if-then-end construct wrong

if

00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  2.5  2.5  2.5

then

wait 0

If

0AB0:   key_pressed 89

then

00FE:   actor $PLAYER_ACTOR perform_animation_sequence "DRNKBR_PRTL" from_file "GANGS"  4.0  1  1  1  0  -1

 

Every IF-THEN needs it's END

It's like a open and a close tag

 

the IF-THEN-END's checks can be written in a rowor checks inside checks like boxes in a box in a boxso it can happens that you find more END's at the end[code]         end    endend

 

 

 

                if  and                   0248:   model #VBFYCRP available                   04EE: animation "GANGS" loaded                   04EE: animation "DEALER" loaded               then                   break               end

 

 

--------------

 

only if-then-else-end is possible

 

if...then...else...end

 

 

but not

if-then-else-else-end

 

 

               if  and                  8118: not  actor 0@ dead                  00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2347.7383 639.5254 42.07 radius  85.5  85.5  85.5              then                  // dealer script              else                  break              end

 

 

 

have you got skype

yes but i don't like to chatt for hours

i don't know why i help you so much, normally you should study the tutorial, try the example scripts, modify it a little bit and get praxis in coding and learn to find informations by yourself

Link to comment
Share on other sites

Thanks for your help , i really appreciate it, but for now i leave that script , last thing - could you help me with your elevator script ?

 

 

 

i use your gates script, it works perfectly, but i want to make an lift with it. I put all coords right but i need that only Z coords move when i press a key, but it doesnt /:

 

 

 

{$CLEO .cs}:ONEDOOR_103A4: name_thread 'ONEDOOR' :ONEDOOR_30001: wait 0 ms if0256:   player $PLAYER_CHAR defined 004D: jump_if_false @ONEDOOR_3if00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -2288.26 582.877 33.706 radius  80.5  80.5  80.5004D: jump_if_false @ONEDOOR_30107: 5@ = create_object 3095 at -2288.26 582.877 33.7060007: 7@ =  -2288.26     // default X (closed)0007: 8@ =  582.877  //default Y (closed)0007: 9@ =  33.706  //default Z (closed)0007: 11@ =  -2288.26    // destination X (open)0007: 12@ =  582.877  // destination Y (open)  0007: 13@ =  50.906  // destination Z (open)0006: 14@ = 00006: 15@ = 00002: jump @ONEDOOR_12:ONEDOOR_120001: wait 0 ms if0256:   player $PLAYER_CHAR defined 004D: jump_if_false @ONEDOOR_75 if 80FE:   not actor $PLAYER_ACTOR  0 (in-sphere)near_point 7@ 8@ 9@ radius  95.5  95.5  95.5004D: jump_if_false @ONEDOOR_13 0002: jump @ONEDOOR_75:ONEDOOR_13if0039:   15@ ==  0  // integer values004D: jump_if_false @ONEDOOR_15 if00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point 7@ 8@ 9@ radius  20.5  20.5  20.50AB0:   key_pressed 76//------------------key = L 004D: jump_if_false @ONEDOOR_150006: 15@ = 1000A: 14@ +=  1  // integer values0002: jump @ONEDOOR_15:ONEDOOR_15if0039:   15@ ==  1  // integer values004D: jump_if_false @ONEDOOR_18:ONEDOOR_16if0039:   14@ ==  1  // integer values004D: jump_if_false @ONEDOOR_17034E: move_object 5@ to  11@ 12@ 13@ speed  0.0 0.0 0.9 flag  0if04E5:  object 5@ near_point 11@ 12@ 13@ radius 1.0 1.0 flag 0004D: jump_if_false @ONEDOOR_170006: 14@ = 20006: 15@ = 10001: wait 500 ms0002: jump @ONEDOOR_29:ONEDOOR_17if0039:   14@ ==  3  // integer values004D: jump_if_false @ONEDOOR_18034E: move_object 5@ to  7@ 8@ 9@ speed  0.0 0.0 0.9 flag  0if04E5:  object 5@ near_point 7@ 8@ 9@ radius 0.1 0.1 flag 0004D: jump_if_false @ONEDOOR_180006: 15@ = 00006: 14@ = 0:ONEDOOR_18if  and0039:   14@ ==  2  // integer values80FE:   not actor $PLAYER_ACTOR  0 (in-sphere)near_point 7@ 8@ 9@ radius  19.0  19.0  15.0004D: jump_if_false @ONEDOOR_190006: 15@ = 10006: 14@ = 30002: jump @ONEDOOR_12:ONEDOOR_19if  and0039:   14@ ==  2  // integer values80FE:   not actor $PLAYER_ACTOR  0 (in-sphere)near_point 7@ 8@ 9@ radius  3.0  3.0  5.00AB0:   key_pressed 76004D: jump_if_false @ONEDOOR_290006: 15@ = 10006: 14@ = 30002: jump @ONEDOOR_12:ONEDOOR_290002: jump @ONEDOOR_12:ONEDOOR_7501C4: remove_references_to_object 5@  // This object will now disappear when the player looks away03F0: text_draw_toggle  0  0001: wait 1000 ms0006: 14@ = 00006: 15@ = 00002: jump @ONEDOOR_3

 

 

 

{$CLEO .cs}:LIFTS_103A4: name_thread 'LIFT':LIFTS_20001: wait 0 ms00D6: if 00256:   player $PLAYER_CHAR defined004D: jump_if_false @LIFTS_200D6: if 000FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -545.9601 2594.1699 53.5156 radius 200.0 200.0 200.0004D: jump_if_false @LIFTS_20247: request_model 167950247: request_model 16797038B: load_requested_models:LIFTS_30001: wait 0 msif  and0248:   model 16795 available0248:   model 16797 available004D: jump_if_false @LIFTS_30107: 1@ = create_object 16795 at -534.84 2632.83 52.50177: set_object 1@ Z_angle_to 268.0  0392: make_object 1@ moveable 10107: 2@ = create_object 16797 at -532.875 2657.53 33.130177: set_object 2@ Z_angle_to -2.340392: make_object 2@ moveable 10006: 3@ = 0:LIFTS_40001: wait 0 ms00D6: if 00256:   player $PLAYER_CHAR defined004D: jump_if_false @LIFTS_1301BB: store_object 1@ position_to 11@  12@  13@00D6: if 000FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -545.9601 2594.1699 53.5156 radius 210.0 210.0 210.0004D: jump_if_false @LIFTS_13if0039:   3@ == 0004D: jump_if_false @LIFTS_5if   or00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -534.84 2632.83 52.5 radius 3.0 3.0 3.000FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -534.48 2640.05 46.39 radius 8.0 8.0 3.0004D: jump_if_false @LIFTS_5      0006: 3@ = 1:LIFTS_5if0039:   3@ == 1004D: jump_if_false @LIFTS_7if0021:   13@ >  46.0  // floating-point values004D: jump_if_false @LIFTS_6034E:    move_object 1@ to -534.84 2632.83 45.0 speed 0.0 0.0 0.04 flag 0      0002: jump @LIFTS_4:LIFTS_60006: 3@ = 20001: wait 2000 ms0002: jump @LIFTS_4:LIFTS_7if0039:   3@ == 2004D: jump_if_false @LIFTS_4if0023:   52.5 > 13@  // floating-point values004D: jump_if_false @LIFTS_8034E:    move_object 1@ to -534.84 2632.83 53.5 speed 0.0 0.0 0.04 flag 00002: jump @LIFTS_4:LIFTS_80006: 3@ = 00001: wait 2000 ms0002: jump @LIFTS_4:LIFTS_13    0108: destroy_object 1@0108: destroy_object 2@0002: jump @LIFTS_2

 

 

This crashes ;'( took it from here - http://www.gtaforums.com/index.php?showtop...entry1058556049

Edited by kalonkas
Link to comment
Share on other sites

 

Thanks for your help , i really appreciate it, but for now i leave that script , last thing - could you help me with your elevator script ?

 

i use your gates script, it works perfectly, but i want to make an lift with it. I put all coords right but i need that only Z coords move when i press a key, but it doesnt /:

 

This crashes ;'( took it from here - http://www.gtaforums.com/index.php?showtop...entry1058556049

the doorscript doesn't work anymore because you edited values, hoping the object would move vertical

but the script works only for object moving horizontal

 

model id 16795 and 16797 don't exist in originaly San Andreas

the member stripprpimp added 2 objects to his game as lift objects and asked for help to realize a special liftscript where you found that script

 

kalonkas, please don't post here anymore. Your way of learning scripting is wrong and your posts look like spam

please post in mission coding section

 

Edited by ZAZ
Link to comment
Share on other sites

Michael-Knight1

Hi Zaz , I Need Help into my kitt prison break on main script . i don't knew why the game crashed when i get spawned from the jail ?? Here is the codes !

 

 

016D: restart_if_busted_at 1410.453 -1586.943 13.549 angle 86.8 town_number 1 

 

 

 

:BUSTED_LSthread 'BUSTED_LS' Audiostream.Load($PRISON_LSMP3, "CLEO\AUDIO\PRISON LOS SANTOS.MP3")054C: use_GXT_table 'KRBTS' :BUSTED_LS_69wait 0 0842: $CURRENT_TOWN_NUMBER = player $PLAYER_CHAR town_number if 0741:   actor $PLAYER_ACTOR busted else_jump @BUSTED_LS_69 if or $CURRENT_TOWN_NUMBER == 1  $CURRENT_TOWN_NUMBER == 0 else_jump @BUSTED_LS_69 Model.Load(#COPCARLA)Model.Load(#LAPD1)Model.Load(#M4)038B: load_requested_models :BUSTED_LS_139wait 0 if and  Model.Available(#COPCARLA)  Model.Available(#LAPD1)  Model.Available(#M4)else_jump @BUSTED_LS_139 wait 5000 jump @BUSTED_LS_198:BUSTED_LS_19801EB: set_traffic_density_multiplier_to 0.0 03DE: set_pedestrians_density_multiplier_to 0.0 02A3: enable_widescreen 1 Camera.SetPosition(1505.497, -1713.624, 14.0469, 0.0, 0.0, 0.0)Camera.PointAt(1551.765, -1674.273, 15.9855, 2)$COPBUSTEDCAR_LS = Car.Create(#COPCARLA, 1414.08, -1589.726, 12.8785)Car.Angle($COPBUSTEDCAR_LS) = 271.1110397: enable_car $COPBUSTEDCAR_LS siren 1 0508: car $COPBUSTEDCAR_LS close_all_doors Car.DoorStatus($COPBUSTEDCAR_LS) = 4072B: put_actor $PLAYER_ACTOR into_car $COPBUSTEDCAR_LS passengerseat 1 0129: $COPBUSTEDPED1_LS = create_actor_pedtype 280 model #LAPD1 in_car $COPBUSTEDCAR_LS driverseat 01C8: $COPBUSTEDPED2_LS = create_actor_pedtype 280 model #LAPD1 in_car $COPBUSTEDCAR_LS passenger_seat 0 fade 0 5000wait 8000 Player.CanMove($PLAYER_CHAR) = False0918: unknown_car $COPBUSTEDCAR_LS driver_flag 1 0704: car $COPBUSTEDCAR_LS drive_to 1593.907 -1691.939 5.8906 Car.SetMaxSpeed($COPBUSTEDCAR_LS, 22.0)Camera.Restore00BB: show_text_lowpriority GXT 'PRLS_1' time 5000 flag 1  // ~r~Michael :~w~Please allow this time to leave me or let me call My Directorwait 5000 00BB: show_text_lowpriority GXT 'PRLS_2' time 5000 flag 1  // ~b~Cop 1 :~w~ Shut up Michael Knightwait 5000 00BB: show_text_lowpriority GXT 'PRLS_3' time 5000 flag 1  // ~g~Cop 2 : ~w~ You should shut up and be serious because you will spend on the following few minutewait 20000 0633: AS_actor $COPBUSTEDPED1_LS exit_car 0633: AS_actor $COPBUSTEDPED2_LS exit_car 0633: AS_actor $PLAYER_ACTOR exit_car wait 2000 Camera.SetPosition(1593.85, -1699.281, 5.897, 0.0, 0.0, 0.0)Camera.PointAt(1597.892, -1697.116, 5.8906, 2)wait 2000 07CD: AS_actor $COPBUSTEDPED1_LS walk_to 1610.677 -1697.393 6.2187 stop_with_angle 270.0287 within_radius 1.0 07CD: AS_actor $COPBUSTEDPED2_LS walk_to 1596.614 -1693.773 5.8906 stop_with_angle 275.8371 within_radius 1.0 07CD: AS_actor $PLAYER_ACTOR walk_to 1610.642 -1693.271 6.2187 stop_with_angle 89.0653 within_radius 1.0 wait 1000 00BB: show_text_lowpriority GXT 'PRLS_4' time 5000 flag 1  // ~r~Michael : ~w~KITT It's the time or never !wait 5000 00BB: show_text_lowpriority GXT 'PRLS_5' time 5000 flag 1  // ~b~KITT : ~w~Michael I Am On The Way !wait 3000 0639: AS_actor $COPBUSTEDPED1_LS rotate_to_actor $PLAYER_ACTOR 0639: AS_actor $PLAYER_ACTOR rotate_to_actor $COPBUSTEDPED1_LS $BUSTEDLS_M4 = 31 $BUSTEDLS_M4_AMMO = 500 01B2: give_actor $COPBUSTEDPED1_LS weapon $BUSTEDLS_M4 ammo $BUSTEDLS_M4_AMMO // Load the weapon model before using this 01B2: give_actor $COPBUSTEDPED2_LS weapon $BUSTEDLS_M4 ammo $BUSTEDLS_M4_AMMO // Load the weapon model before using this 0605: actor $COPBUSTEDPED1_LS perform_animation_sequence "GANG_GUNSTAND" IFP_file "PED" 4.0 loop 0 0 0 0 time 20000 // versionA wait 3000 Car.PutAt($KITT, 1566.993, -1824.04, 12.8944)Car.Angle($KITT) = 0.77870508: car $KITT close_all_doors 0129: $BUSTEDLS_INVPED = create_actor_pedtype 280 model #LAPD1 in_car $KITT driverseat 0337: set_actor $BUSTEDLS_INVPED visibility 0 0918: unknown_car $KITT driver_flag 1 0704: car $KITT drive_to 1603.881 -1690.354 5.4099 Car.SetMaxSpeed($KITT, 35.0)wait 3000 Camera.RestoreAudiostream.PerformAction($PRISON_LSMP3, STOP)Audiostream.PerformAction($PRISON_LSMP3, PLAY)067A: put_camera_on_car $KITT with_offset 0.0 10.0 3.0 point_to_car $KITT tilt 5.0 2 wait 6000 067A: put_camera_on_car $KITT with_offset -4.0 -12.0 3.0 point_to_car $KITT tilt 5.0 2 wait 7500 05E2: AS_actor $COPBUSTEDPED1_LS kill_actor $BUSTEDLS_INVPED 05E2: AS_actor $COPBUSTEDPED2_LS kill_actor $BUSTEDLS_INVPED Camera.SetPosition(1591.619, -1625.219, 13.3828, 0.0, 0.0, 0.0)Camera.PointAt(1588.449, -1637.078, 13.4172, 2)wait 3000 067A: put_camera_on_car $KITT with_offset -4.0 -12.0 3.0 point_to_car $KITT tilt 5.0 2 Car.SetMaxSpeed($KITT, 20.0)wait 4000 00BB: show_text_lowpriority GXT 'PRLS_6' time 2000 flag 1  // ~b~KITT : ~w~Michael Jump in !Camera.Restore_WithJumpCut02A3: enable_widescreen 0 01EB: set_traffic_density_multiplier_to 2.0 03DE: set_pedestrians_density_multiplier_to 2.0 Camera.Restore_WithJumpCutPlayer.CanMove($PLAYER_CHAR) = TruePlayer.WantedLevel($PLAYER_CHAR) = 2Actor.DestroyInstantly($BUSTEDLS_INVPED)08A6: set_car $KITT componentA 2 rotation_to 0.0 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.05 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.1 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.15 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.2 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.25 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.3 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.35 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.4 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.45 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.5 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.55 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.6 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.65 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.7 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.75 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.8 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.85 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.9 wait 10 08A6: set_car $KITT componentA 2 rotation_to 0.95 wait 10 08A6: set_car $KITT componentA 2 rotation_to 1.0 0918: unknown_car $KITT driver_flag 1 wait 2000 Audiostream.PerformAction($PRISON_LSMP3, STOP)00BB: show_text_lowpriority GXT 'PRLS_7' time 2000 flag 1  // ~r~Michael : ~w~Thanks Pal.wait 5000 Actor.RemoveReferences($COPBUSTEDPED1_LS)Actor.RemoveReferences($COPBUSTEDPED2_LS)Car.RemoveReferences($COPBUSTEDCAR_LS)05E2: AS_actor $COPBUSTEDPED1_LS kill_actor $PLAYER_ACTOR 05E2: AS_actor $COPBUSTEDPED2_LS kill_actor $PLAYER_ACTOR jump @BUSTED_LS_69 end_thread

 

 

 

Link to comment
Share on other sites

 

Hi Zaz , I Need Help into my kitt prison break on main script . i don't knew why the game crashed when i get spawned from the jail ?? Here is the codes !

 

 

280 isn't a pedtype as i mentioned in earlier post

 

don't use the actors handle after removing their reference

 

Actor.RemoveReferences($COPBUSTEDPED1_LS)Actor.RemoveReferences($COPBUSTEDPED2_LS)Car.RemoveReferences($COPBUSTEDCAR_LS)05E2: AS_actor $COPBUSTEDPED1_LS kill_actor $PLAYER_ACTOR05E2: AS_actor $COPBUSTEDPED2_LS kill_actor $PLAYER_ACTOR 

 

 

your script then don't crash, you will just get a black screen because you did a fade but didn't fade back

Link to comment
Share on other sites

Michael-Knight1
Hi Zaz , I Need Help into my kitt prison break on main script . i don't knew why the game crashed when i get spawned from the jail ?? Here is the codes !

 

 

280 isn't a pedtype as i mentioned in earlier post

 

don't use the actors handle after removing their reference

 

Actor.RemoveReferences($COPBUSTEDPED1_LS)Actor.RemoveReferences($COPBUSTEDPED2_LS)Car.RemoveReferences($COPBUSTEDCAR_LS)05E2: AS_actor $COPBUSTEDPED1_LS kill_actor $PLAYER_ACTOR05E2: AS_actor $COPBUSTEDPED2_LS kill_actor $PLAYER_ACTOR 

 

 

your script then don't crash, you will just get a black screen because you did a fade but didn't fade back

every crashed ??

Link to comment
Share on other sites

 

Hi Zaz , I Need Help into my kitt prison break on main script . i don't knew why the game crashed when i get spawned from the jail ?? Here is the codes !

 

 

280 isn't a pedtype as i mentioned in earlier post

 

don't use the actors handle after removing their reference

 

Actor.RemoveReferences($COPBUSTEDPED1_LS)Actor.RemoveReferences($COPBUSTEDPED2_LS)Car.RemoveReferences($COPBUSTEDCAR_LS)05E2: AS_actor $COPBUSTEDPED1_LS kill_actor $PLAYER_ACTOR05E2: AS_actor $COPBUSTEDPED2_LS kill_actor $PLAYER_ACTOR 

 

 

your script then don't crash, you will just get a black screen because you did a fade but didn't fade back

every crashed ??

no, i didn't got any crash, i edited first big mistakes

 

pedtype 280 is wrong, doesn't matter if it crash or not

 

i didn't tested actors handle after removing their reference because it's wrong, wrong, wrong, wrong, wrong

Link to comment
Share on other sites

Michael-Knight1
Hi Zaz , I Need Help into my kitt prison break on main script . i don't knew why the game crashed when i get spawned from the jail ?? Here is the codes !

 

 

280 isn't a pedtype as i mentioned in earlier post

 

don't use the actors handle after removing their reference

 

Actor.RemoveReferences($COPBUSTEDPED1_LS)Actor.RemoveReferences($COPBUSTEDPED2_LS)Car.RemoveReferences($COPBUSTEDCAR_LS)05E2: AS_actor $COPBUSTEDPED1_LS kill_actor $PLAYER_ACTOR05E2: AS_actor $COPBUSTEDPED2_LS kill_actor $PLAYER_ACTOR 

 

 

your script then don't crash, you will just get a black screen because you did a fade but didn't fade back

every crashed ??

no, i didn't got any crash, i edited first big mistakes

 

pedtype 280 is wrong, doesn't matter if it crash or not

 

i didn't tested actors handle after removing their reference because it's wrong, wrong, wrong, wrong, wrong

ok , i'll try a gain

Link to comment
Share on other sites

  • 4 weeks later...
Michael-Knight1

ZAZ , i need help about the f*cking fade devil.gif

i don't know why when i use it everytime , he did not stop sneaky2.gif , help .. this is Example icon14.gif

the game still black without end

 

{$CLEO}0000: NOPwhile truerepeatwait 0 msuntil 0256:   player $PLAYER_CHAR defined 016A: fade 0 time 1000wait 1000 end

 

Link to comment
Share on other sites

Just use it properly and it will work fine icon14.gif

 

Why looping it?

Link to comment
Share on other sites

Michael-Knight1

 

Just use it properly and it will work fine icon14.gif

 

Why looping it?

just write example of fade code ...

 

I'll Going To Try , Thanks icon14.gif

Edited by Michael-Knight1
Link to comment
Share on other sites

  • 3 weeks later...

hi ZAZ.. i was make a dance script with custom ifp... but i want the player character can dancing with the homies.. what opcodes should i use???? confused.gif

Link to comment
Share on other sites

Michael-Knight1

Hi Zaz , I make the demo mission of my knight rider back to school v 2.0 , KITT VS GOLIATH but i don't know why the game crashed after jump to label @DEMO2_789 ?? Help Please Now

 

EDIT : Nevermind

 

Edited by Michael-Knight1
Link to comment
Share on other sites

 

 

 

ZAZ I want to thank you for your cleo tutorials...

 

THANK YOU !

You're welcome. Nice to get feedback from someone who understood the lessons.

 

 

 

hi ZAZ.. i was make a dance script with custom ifp... but i want the player character can dancing with the homies.. what opcodes should i use???? confused.gif

Let him do Animations of DANCING.ifp or STRIP.ifp

 

 

Edited by ZAZ
Link to comment
Share on other sites

doublepost blush.gif

Edited by ZAZ
Link to comment
Share on other sites

Michael-Knight1

Zaz how can i make actor follow player and can join The interior wich the player enter it bored.gif

Link to comment
Share on other sites

 

Zaz how can i make actor follow player and can join The interior wich the player enter it  bored.gif

check if interior isn't 0, then get interior and coords from one meter infront of player, then put and link actor to interior

Link to comment
Share on other sites

Michael-Knight1
Zaz how can i make actor follow player and can join The interior wich the player enter it  bored.gif

check if interior isn't 0, then get interior and coords from one meter infront of player, then put and link actor to interior

Thanks As Always icon14.gif

 

Link to comment
Share on other sites

  • 3 weeks later...
ashwinsjaganaath

Hello Zaz, first off thanks a billion for these tutorials. It is very easy to understand and i was able to do small cleo scripts from ur tutorials right when i started learning them which i never dreamed of doing all these years.

I have a doubt abt cleo scripts. Is it possible to create multi-threads in a single cleo script? if that's not possible how can i obtain the value of a variable declared in one cleo script from another one? i saw ur tutorial abt this special cleo global variable but didn't quite get it. I'd be grateful if u could explain me the same. Thank you once again for ur tutorials. smile.gif

Link to comment
Share on other sites

 

I have a doubt abt cleo scripts. Is it possible to create multi-threads in a single cleo script? if that's not possible how can i obtain the value of a variable declared in one cleo script from another one? i saw ur tutorial abt this special cleo global variable but didn't quite get it. I'd be grateful if u could explain me the same. Thank you once again for ur tutorials. smile.gif

You can, but it's almost always obsolete to do so. Could you explain the reason you want a multi-threaded script?

Link to comment
Share on other sites

I confirm to SilentPL

but you can find the answer for your question here

Link to comment
Share on other sites

ashwinsjaganaath

@Zaz and @SilentPL : Thanks for the quick response. Actually i was thinking of creating a small script whereby the player creates a series of explosion on punching. I succeeded in doing so, the player did create a series of explosions in front of him. But that seemed so dangerous cuz if u wanna punch normally without any explosions u wouldn't be able to. So i thought of making the script to execute on entering a cheat. Enter a cheat and this mode gets activated and enter it again to deactivate it. I created another script to do the same. I understood the usage of special cleo global variables(finally! phew) and i used it to link both the scripts. The idea was whenever the player punches the script checks for the value of a particular variable, which is defined by that another script which activates(variable value = 1) and deactivates (variable value = 0). So the script(the one that creates explosions) reads the variable value and it will proceed only if the variable value is 1 or else it will loop back to the first line and wait(forever) until the value becomes 1. THIS ACTUALLY WORKED IN GAME. But my doubt now is : i have used the opcode 0AB3: var 0 = 0, will this line affect any other scripts using var 0? if it does i know that i can use some other say var 2 or 3 or 146 or whatever to avoid the confusion. But lets say, if i share this mod with some others, i can't expect them to change their var # to be able to work this script, right? And i wouldn't know which var # is unused by everyone .

 

And for the same reason, is it possible to use any base memories to make the script check whether the cheat is on or off?

 

and here is how my script works and this is the way i want it to work without any confusions with that var 0 thing

 

 

 

 

 

Thanks a bunch

 

P.s : Shall i also share the lines that i wrote in both of the above-mentioned scripts?

Edited by ashwinsjaganaath
Link to comment
Share on other sites

You made that sound really complex, but I'm pretty sure you can merge this into one script with ease. Mind showing us the codes?

Link to comment
Share on other sites

ashwinsjaganaath

 

You made that sound really complex, but I'm pretty sure you can merge this into one script with ease. Mind showing us the codes?

Oh for sure man here it is

 

 

//Buddha's palm{$CLEO .cs}//Start of threadthread 'Buddha':Buddha_0wait 000D6: if0256:   player $PLAYER_CHAR defined jf @Buddha_000D6: if or02D8:   actor $PLAYER_ACTOR current_weapon ==  002D8:   actor $PLAYER_ACTOR current_weapon ==  1jf @Buddha_00AB4: 0@ = var 0 // - cleo 3 - 00D6: if and00E1:   player 0 pressed_key 170039:   0@ == 1   jf @Buddha_0:Buddha_104C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 2.0 0.2 04C4: store_coords_to 4@ 5@ 6@ from_actor $PLAYER_ACTOR with_offset 0.0 6.0 0.2 04C4: store_coords_to 7@ 8@ 9@ from_actor $PLAYER_ACTOR with_offset 0.0 10.0 0.2 04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 0.0 14.0 0.2 04C4: store_coords_to 13@ 14@ 15@ from_actor $PLAYER_ACTOR with_offset 0.0 18.0 0.2 02AB: set_actor $PLAYER_ACTOR immunities BP 1 FP 1 EP 1 CP 1 MP 1 020C: create_explosion_with_radius 5 at 1@ 2@ 3@wait 200 ms 020C: create_explosion_with_radius 5 at 4@ 5@ 6@ wait 200 ms020C: create_explosion_with_radius 5 at 7@ 8@ 9@ wait 200 ms020C: create_explosion_with_radius 5 at 10@ 11@ 12@ wait 200 ms020C: create_explosion_with_radius 5 at 13@ 14@ 15@02AB: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0wait 1000 msjump @Buddha_0

 

 

This is the script that creates the explosion while he is punching

and the script that activates the cheat is as follows

 

 

{$CLEO .cs}//Cheatthread 'Buddha1':Buddha1_0wait 000D6: if 0256: player $PLAYER_CHAR definedjf @Buddha1_00A8D: 1@ = read_memory 0x00969110 size 4 virtual_protect 0// - cleo 3 -0A8D: 2@ = read_memory 0x00969114 size 2 virtual_protect 0// - cleo 3 -00D6: if04A4:   1@ == 0x4444484104A4:   2@ == 0x4255jf @Buddha1_003E5: show_text_box 'CHEAT1'0A8C: write_memory 0x00969110 size 4 value 0 virtual_protect 0// - cleo 3 -0A8C: write_memory 0x00969114 size 2 value 0 virtual_protect 0// - cleo 3 -0AB3: var 0 = 1 jump @Buddha1_1:Buddha1_1wait 000D6: if 0256: player $PLAYER_CHAR definedjf @Buddha1_10A8D: 1@ = read_memory 0x00969110 size 4 virtual_protect 0// - cleo 3 -0A8D: 2@ = read_memory 0x00969114 size 2 virtual_protect 0// - cleo 3 -00D6: if04A4:   1@ == 0x4444484104A4:   2@ == 0x4255jf @Buddha1_103E5: show_text_box 'CHEAT8'0A8C: write_memory 0x00969110 size 4 value 0 virtual_protect 0// - cleo 3 -0A8C: write_memory 0x00969114 size 2 value 0 virtual_protect 0// - cleo 3 -0AB3: var 0 = 0jump @Buddha1_0

 

 

And as u might've seen in the video, these are the scripts that got the explosions to work.

My head is spinning around man, thinking of how to merge these without using var 0. No wonder i sounded complicated earlier, i'm not able to think straight. I'm sure u will have a simple clean solution to this. Anyway i'm not too bad for the first script i guess, am i?

Edited by ashwinsjaganaath
Link to comment
Share on other sites

Nope, that script looks fine, just lacks if and in two places.

I've also made it a bit better than it used to be - holding LMB won't make it spawn explosions infinitely + made it in high-level (the sooner you learn to code in high level - the better).

 

 

{$CLEO}0000: BUDDHA    // No need for 03A4 in CLEO - script names are made automatically basing on the filenamewhile true   0001: wait 0 ms   0A8D: 1@ = read_memory 0x969110 size 4 virtual_protect 0// - cleo 3 -   0A8D: 2@ = read_memory 0x969114 size 2 virtual_protect 0// - cleo 3 -   if and  // You were missing 'and' here       0039:   1@ == 0x44444841       0039:   2@ == 0x4255   then       if           0039:   0@ == 0 // Let's 0 be our "is activated?" flag - that keeps the code clean and also removes the need of multithreading!       then           03E5: show_text_box "CHEAT1"    // "STRING" is better in CLEO than 'STRING' - it saves space           0006: 0@ = 1       else           03E5: show_text_box "CHEAT8"           0006: 0@ = 0       end       0A8C: write_memory 0x969110 size 1 value 0 virtual_protect 0    // You need to clean only the 1st char of the cheat stack - just lke R*   end   if       0039:   0@ == 1 // That replaces your CLEO variable   then       if           0256:   player 0 defined        // 0 equals to $PLAYER_CHAR, but takes less script space       then           if or               02D8:   actor $PLAYER_ACTOR current_weapon ==  0               02D8:   actor $PLAYER_ACTOR current_weapon ==  1           then               if                   00E1:   player 0 pressed_key 17               then                   04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0 2.0 0.2   // 0 equals to 0.0, but takes less script space                   04C4: store_coords_to 4@ 5@ 6@ from_actor $PLAYER_ACTOR with_offset 0 6.0 0.2                   04C4: store_coords_to 7@ 8@ 9@ from_actor $PLAYER_ACTOR with_offset 0 10.0 0.2                   04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 0 14.0 0.2                   04C4: store_coords_to 13@ 14@ 15@ from_actor $PLAYER_ACTOR with_offset 0 18.0 0.2                   02AB: set_actor $PLAYER_ACTOR immunities BP 1 FP 1 EP 1 CP 1 MP 1   // I think that you could leave all the other immunities untouched and only set EP                   020C: create_explosion_with_radius 5 at 1@ 2@ 3@                   wait 200 ms                   020C: create_explosion_with_radius 5 at 4@ 5@ 6@                   wait 200 ms                   020C: create_explosion_with_radius 5 at 7@ 8@ 9@                   wait 200 ms                   020C: create_explosion_with_radius 5 at 10@ 11@ 12@                   wait 200 ms                   020C: create_explosion_with_radius 5 at 13@ 14@ 15@                   02AB: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0                   while 00E1:   player 0 pressed_key 17       // That will make the script wait until you release Fire key                       0001: wait 0 ms                   end               end           end       end   endend

 

 

Sorries, ZAZ!

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
  • 2 Users Currently Viewing
    1 member, 0 Anonymous, 1 Guest

    • Akiri
×
×
  • Create New...

Important Information

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