Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Summer Special
      2. The Diamond Casino Heist
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

Sign in to follow this  
maoffense01

My First Mod Problem

Recommended Posts

maoffense01

This is GTA San Andreas,not III or VC



Hi guys! I have new mod now yesss! Seriously,I'm a DYOMer that would like to code or to create a scm mod.This is my first modification.And I would like to be a professional modder,because I hate skins,mapping,etc.I only like Cleo's!
For now,this is my modification named "Play As Sweet".Now,I can understand how to code,but it's only 25%-40%!Thanks for Dutchy's Tutorial !
But I saw that there's a problem in my mod named "Play As Sweet".The problem is --------------------------------------
"Compiled file has no header, so the model name #SWEET can not be used. Use number ID instead.". But the special actors don't have it's numerical ID,right?

Here's the full code of my mod! :

{$CLEO .cs}:playsweet03A4: name_thread 'playsweet':playsweet1wait 0 ms if 00DF:   actor $PLAYER_ACTOR walkingjump @playsweet2:playsweet2wait 0 msif00E1:   player 0 pressed_key 45023C: load_special_actor 'SWEET' as 1 // models 290-299038B: load_requested_models          jump @playsweet3:playsweet3wait 0 ms          if                                                                     823D:   not special_actor 1 loaded else_jump @playsweet4 wait 0 ms jump @playsweet3:playsweet4009A: [email protected] = create_actor_pedtype PLAYER1 model #SWEET at $X_Johnson_House $Y_Johnson_House $Z_Johnson_House0173: set_actor $PLAYER_ACTOR Z_angle_to 262.0jump @playsweet5:playsweet5// Load models0247: load_model #MINIGUN  0247: load_model #M4038B: load_requested_models:playsweet6wait 0 msif or8248: not model #MINIGUN available8248: not model #M4 availableelse_jump @playsweet7 wait 0 msjump @playsweet6:playsweet7wait 0 ms 01B2: give_actor $Player_actor weapon 38 ammo 9999 // Load the weapon model before using this01B2: give_actor $Player_actor 31 ammo 9999 // Load the weapon model before using this01B9: set_actor $Player_actor armed_weapon_to 38   wait 0 ms0A93: end_custom_thread

That's the whole code of my mod,but I think it's wrong because I'm just a new modder!
Please,give some report and give the right code so that I have my first mod! I'm so,so excited!
Thank you! :lol: :colgate:

Edited by maoffense01

Share this post


Link to post
Share on other sites
Jack

Problems in your code:
- First you need to check if a player is controllable by using the opcode 0256.
- I think that the key 45 doesn't exist - go sanny - help - contents - SCM documentation - gta SA - keypress numbers.
-

009A: [email protected] = create_actor_pedtype PLAYER1 model #SWEET at $X_Johnson_House $Y_Johnson_House $Z_Johnson_House
Use #SPECIAL01 instead of #SWEET and define a pedtype (check scm documentation about the pedtypes). Also you must define 3D coordinates (either use float values or create coordinates from player by using local variables).
- Model load opcodes (0247 and 038B) should be all on the same place.

I wasn't sure if you're trying to create new ped with the SWEET model or to change the player model to Sweets model (you said play as SWEET) so I made 2 codes:
This one creates the new ped with the SWEET model:
{$CLEO}03A4: name_thread 'playsweet'REPEAT    wait 250UNTIL 0256:   player $PLAYER_CHAR definedREPEAT    wait 0UNTIL 00E1:   player 0 pressed_key 17  // fire key0247: load_model #MINIGUN  0247: load_model #M4023C: load_special_actor 'SWEET' as 1038B: load_requested_models04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 3.0 0.5009A: [email protected] = create_actor_pedtype 4 model #SPECIAL01 at [email protected] [email protected] [email protected]: set_actor [email protected] Z_angle_to 262.001B2: give_actor [email protected] weapon 38 ammo 999901B2: give_actor [email protected] 31 ammo 999901B9: set_actor [email protected] armed_weapon_to 38   0A93: end_custom_thread

And this one changes the player model:
{$CLEO}03A4: name_thread 'playsweet'REPEAT    wait 250UNTIL 0256:   player $PLAYER_CHAR definedREPEAT    wait 0UNTIL 00E1:   player 0 pressed_key 17 // fire key0247: load_model #MINIGUN  0247: load_model #M4023C: load_special_actor 'SWEET' as 1038B: load_requested_models09C7: change_player $PLAYER_CHAR model_to #SPECIAL010173: set_actor $PLAYER_ACTOR Z_angle_to 262.001B2: give_actor $PLAYER_ACTOR weapon 38 ammo 999901B2: give_actor $PLAYER_ACTOR 31 ammo 999901B9: set_actor $PLAYER_ACTOR armed_weapon_to 38   0A93: end_custom_thread




  • Like 1

Share this post


Link to post
Share on other sites
maoffense01

Woah,thanks bro! I'm about to study about 'repeat-wait-until' command! Thank you,bro!

Share this post


Link to post
Share on other sites
maoffense01

The only problem that I putted the X Y Z as Johnson House because when I used "Coordnates Manager",nothing happened.So that's why I used Johnson house.What's the coordinate of Grove Street? I want to make the player as Sweet to Grove Street!

Share this post


Link to post
Share on other sites
maoffense01

 

And this one changes the player model:

 

{$CLEO}03A4: name_thread 'playsweet'REPEAT    wait 250UNTIL 0256:   player $PLAYER_CHAR definedREPEAT    wait 0UNTIL 00E1:   player 0 pressed_key 17 // fire key0247: load_model #MINIGUN  0247: load_model #M4023C: load_special_actor 'SWEET' as 1038B: load_requested_models09C7: change_player $PLAYER_CHAR model_to #SPECIAL010173: set_actor $PLAYER_ACTOR Z_angle_to 262.001B2: give_actor $PLAYER_ACTOR weapon 38 ammo 999901B2: give_actor $PLAYER_ACTOR 31 ammo 999901B9: set_actor $PLAYER_ACTOR armed_weapon_to 38   0A93: end_custom_thread

 

This one doesn't work;it crashes! I've changed the key pressed to 0AB0 to avail the 45 as the insert key! But nothing happened! It still crash.I don't know why.

By the way,I learned new skills to use it in coding:

-Repeat-wait-until structure

-Checking the player with 0256 opcode

-Differences of 0AB0 and 00E1 opcode

-Special Actors' IDs can be also changed into #SPECIAL01-10

-Change the model of player by using 09C7 opcode

-$Player_actor armed_weapon_to (number ID) will hold the weapon based in the weapons' ID

For now,it's time to make some awesome mod! Oh yeah! :colgate:

 

Thanks to Jack,for his fantastic help! Because of him,I got 6 new skills! Thanks,Jack!

Edited by maoffense01

Share this post


Link to post
Share on other sites
maoffense01

Can anyone please help me to my another problem?

This topic isn't my problem now! I've recode it again. But I wish this new code won't crash! Can anyone determine that this script will crash or not?

The code's inside the spoiler. :

 

{$CLEO}
create_thread @Main
0A95: enable_thread_saving

wait 0 ms
if
0256: player $PLAYER_CHAR defined
if and
80DF: actor $PLAYER_ACTOR not driving
jump @MAIN2

:MAIN2
wait 0 ms
if and
0AB0: key_pressed 16
0AB0: key_pressed 83
then
023C: load_special_actor 'SWEET' as 1 // models 290-299
0247: load_model #M4
0247: load_model #MINIGUN
038B: load_requested_models
end
jump @MAIN4

:MAIN4
wait 0 ms
if and
823D: not special_actor 1 loaded
8248: not model #M4 available
8248: not model #MINIGUN available
else_jump @MAIN5
wait 0 ms
jump @MAIN4

:MAIN5
fade 1 1000 ms
09C7: change_player $PLAYER_CHAR model_to #SPECIAL01
01B2: give_actor $PLAYER_ACTOR weapon 31 ammo 9999 // Load the weapon model before using this
01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 9999 // Load the weapon model before using this
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 31
end_thread

 

 

That's my problem,please determine whether that script will crash or not. I wish,not!

And please,test it by changing it to .cs,put the .cs to cleo,then run GTA San Andreas then say if it works correctly!

Thanks!

 

Note: I know how to change it to .cs file!

Share this post


Link to post
Share on other sites
ZAZ

this is wrong (not for cleo scripts but for main.scm):

create_thread @Main

go sanny - help - contents - CLEO 3 Code Library - CLEO 3: opcodes and search for the cleo equivalent


this is useless in your script

0A95: enable_thread_saving

this is wrong (not for cleo scripts but for main.scm or cleo mission scripts with *.cm extension):

end_thread

go sanny - help - contents - CLEO 3 Code Library - CLEO 3: opcodes and search for the cleo equivalent

 

 

 

By the way,I learned new skills to use it in coding:

-Repeat-wait-until structure

why didn't you use it then?

Edited by ZAZ

Share this post


Link to post
Share on other sites
maoffense01

Oh,I'm sorry,ZAZ! I'm just a newbie modder.I'm really thinking if I use that!

Share this post


Link to post
Share on other sites
maoffense01

Is this whole code correct now?

{$CLEO}0000: :SWEETcreate_thread @SWEET0A95: enable_thread_savingrepeat wait 0 msuntil 0256: player $PLAYER_CHAR defined  // repeatif    80DF:   not actor $PLAYER_ACTOR driving  if and 0AB0:   key_pressed 16  // Shift0AB0:   key_pressed 83  // Sthen023C: load_special_actor 'SWEET' as 1 // models 290-2990247: load_model #M4 0247: load_model #MINIGUN 038B: load_requested_modelsendjump @SWEET4  :SWEET4wait 0 msif and823D:   not special_actor 1 loaded8248:   not model #M4 available8248:   not model #MINIGUN availableelse_jump @SWEET5wait 0 msjump @SWEET4   :SWEET5fade 1 1000 ms09C7: change_player $PLAYER_CHAR model_to #SPECIAL0101B2: give_actor $PLAYER_ACTOR weapon 31 ammo 9999 // Load the weapon model before using this01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 9999 // Load the weapon model before using this01B9: set_actor $PLAYER_ACTOR armed_weapon_to 310459: end_thread_named 'SWEET'

Share this post


Link to post
Share on other sites
ZAZ

better, but still wrong

why did you put this code in your script?

create_thread @SWEET

Share this post


Link to post
Share on other sites
maoffense01

Because Sweet will be the player,so that I put SWEET!

 

What? Is that code wrong? What should I put in code "create_thread"?

Share this post


Link to post
Share on other sites
ZAZ

Yes, totally wrong. create_thread is a code to initialize a script, thread means script or the running process of the script codes.
Please enable "write opcodes" in sannybuilder option, then decompile the main.scm and search for this opcode inside the source text
With opcode does it look like that: 004F: create_thread @CRANES
You can insert the opcode 004F: at GTAG - Modding - Opcode Database to get a description
The main.scm contains a lot of threads (scripts), main.scm will be started be gta_sa.exe and in this way also the main thread of main.scm.
The main thread contains a bunch of create_thread codes to start a part of the scripts. There're also other codes to start other kinds of scripts.
Missions start codes to start missions and codes to start external scripts.

But back to Cleo. A cleo script will be started automaticly by cleo program if the script file have the extension *.cs
Now is it possible to start another script with extension *.s by using the cleo equivalent

0A92: create_custom_thread "another_cleoscript.s" 

So remove that code, you don't need it in your script, in addition it cause a crash

 

then the next ...

why did you put this code in your script?

0A95: enable_thread_saving

Share this post


Link to post
Share on other sites
maoffense01

I put "enable_thread_saving" opcode so that if they saved the game,the script will be saved,too.

What? What's wrong in the code?

Share this post


Link to post
Share on other sites
ZAZ

Why do you think that it need to save the script?

It could really make sense for some cases, but it's not neccesary in general.

You should study my tutorial, i don't like to write again what i already wrote.

Edited by ZAZ

Share this post


Link to post
Share on other sites
maoffense01

I've read your tutorial 5 times,whole text! So that I know them now! My only problem is that the thread is crashing.

By the way,is this code correct now?

{$CLEO .cs}0000: :CHANGEPLAYER03A4: name_thread 'CHANGEPLAYER'repeat wait 0 msuntil 0256: player $PLAYER_CHAR defined  // repeatif    80DF:   not actor $PLAYER_ACTOR driving  if and 0AB0:   key_pressed 16  // Shift0AB0:   key_pressed 83  // Sthen023C: load_special_actor 'SWEET' as 1 // models 290-2990247: load_model #M4 0247: load_model #MINIGUN 038B: load_requested_modelsendjump @CHANGEPLAYER4  :CHANGEPLAYER4wait 0 msif or823D:   not special_actor 1 loaded8248:   not model #M4 available8248:   not model #MINIGUN availableelse_jump @CHANGEPLAYER5wait 0 msjump @CHANGEPLAYER4   :CHANGEPLAYER5fade 1 1000 ms09C7: change_player $PLAYER_CHAR model_to #SPECIAL0101B2: give_actor $PLAYER_ACTOR weapon 31 ammo 9999 01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 9999 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 31 0A93: end_custom_thread 

Share this post


Link to post
Share on other sites
ZAZ

better, but this conditional check is uncomplete

if    80DF:   not actor $PLAYER_ACTOR driving 

Share this post


Link to post
Share on other sites
maoffense01

Here's the redo code! Hope it's correct now!

{$CLEO .cs}0000: :CHANGEPLAYER03A4: name_thread 'CHANGEPLAYER'repeat wait 0 msuntil player $PLAYER_CHAR defined if    80DF:   actor $PLAYER_ACTOR not driving  else_jump @CHANGEPLAYER2wait 0 msjump @CHANGEPLAYER:CHANGEPLAYER2if and 0AB0:   key_pressed 16  // Shift0AB0:   key_pressed 83  // Sthen023C: load_special_actor 'SWEET' as 1 // models 290-2990247: load_model #M4 0247: load_model #MINIGUN 038B: load_requested_modelsendjump @CHANGEPLAYER4  :CHANGEPLAYER4wait 0 msif or823D:   not special_actor 1 loaded8248:   not model #M4 available8248:   not model #MINIGUN availableelse_jump @CHANGEPLAYER5wait 0 msjump @CHANGEPLAYER4   :CHANGEPLAYER5fade 1 1000 ms09C7: change_player $PLAYER_CHAR model_to #SPECIAL0101B2: give_actor $PLAYER_ACTOR weapon 31 ammo 9999 01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 9999 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 31 0A93: end_custom_thread

Share this post


Link to post
Share on other sites
ZAZ

Have you tested? Does it work?

Share this post


Link to post
Share on other sites
maoffense01

I tried the previous,ZAZ,but it still crashes! By the way,I have new redo code.I re-did it whole. I erased them all,and I create a new whole code.Here's the code:

 

The uncompiled code:

{$CLEO .cs}0000: :PLYASWEET03A4: name_custom_thread 'PLAY_AS_SWEET'repeat wait 0 msuntil 0256:   player $PLAYER_CHAR definedjump @PLYASWEET2:PLYASWEET2023C: load_special_actor 'SWEET' as 1 // models 290-2990247: load_model #M40247: load_model #MINIGUN038B: load_requested_modelsjump @PLYASWEET3:PLYASWEET3if and823D:   special_actor 1 not loaded8248:   model #M4 not available8248:   model #MINIGUN not availablejf @PLYASWEET4 wait 0 msjump @PLYASWEET2:PLYASWEET4if and0AB0:   key_pressed 160AB0:   key_pressed 83then09C7: change_player $PLAYER_CHAR model_to #SPECIAL0101B2: give_actor $PLAYER_ACTOR weapon 31 ammo 9999 // Load the weapon model before using this01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 9999 // Load the weapon model before using this01B9: set_actor $PLAYER_ACTOR armed_weapon_to 310330: set_player $PLAYER_CHAR infinite_run 1000109: player $PLAYER_CHAR money += 1000000055E: set_player $PLAYER_CHAR max_health += 200055F: set_player $PLAYER_CHAR max_armour += 5007A1: set_walk_speed 802E2: set_actor $PLAYER_ACTOR weapon_accuracy_to 100endjump @PLYASWEET5:PLYASWEET5fade 1 time 10003E5: show_text_box 'SUCCESS'  // Successfully changed the player into Sweet!0ABA: end_custom_thread_named 'PLAY_AS_SWEET'

The compiled code:

// This file was decompiled using SASCM.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$CLEO .cs}//-------------MAIN---------------0000: NOP 03A4: name_thread 'PLAY_AS_SWEET' :PLAY_AS_SWEET_210001: wait 0 ms 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @PLAY_AS_SWEET_21 0002: jump @PLAY_AS_SWEET_44 :PLAY_AS_SWEET_44023C: load_special_actor 'SWEET' as 1 // models 290-299 0247: load_model #M4 0247: load_model #MINIGUN 038B: load_requested_models 0002: jump @PLAY_AS_SWEET_76 :PLAY_AS_SWEET_7600D6: if and823D:   not special_actor 1 loaded 8248:   not model #M4 available 8248:   not model #MINIGUN available 004D: jump_if_false @PLAY_AS_SWEET_112 0001: wait 0 ms 0002: jump @PLAY_AS_SWEET_44 :PLAY_AS_SWEET_11200D6: if and0AB0:   key_pressed 16 0AB0:   key_pressed 83 004D: jump_if_false @PLAY_AS_SWEET_209 09C7: change_player $PLAYER_CHAR model_to #SPECIAL01 01B2: give_actor $PLAYER_ACTOR weapon 31 ammo 9999 // Load the weapon model before using this 01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 9999 // Load the weapon model before using this 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 31 0330: set_player $PLAYER_CHAR infinite_run 100 0109: player $PLAYER_CHAR money += 1000000 055E: set_player $PLAYER_CHAR max_health += 200 055F: set_player $PLAYER_CHAR max_armour += 50 07A1: set_walk_speed 8 02E2: set_actor $PLAYER_ACTOR weapon_accuracy_to 100 :PLAY_AS_SWEET_2090002: jump @PLAY_AS_SWEET_216 :PLAY_AS_SWEET_216016A: fade 1 time 100 03E5: show_text_box 'SUCCESS' 0ABA: end_custom_thread_named 'PLAY_AS_SWEET' 

I tried this new whole code,but it still crashes.But I did all now I can,but it still doesn't work. Please,say what's wrong in the code! Thanks!

Share this post


Link to post
Share on other sites
ZAZ

this is wrong

 

03A4: name_custom_thread 'PLAY_AS_SWEET'
this is wrong

 

0ABA: end_custom_thread_named 'PLAY_AS_SWEET'
A script for your plan isn't difficult

You're just confused because you don't know the meaning of several codes, methods, meaning of conditional checks and loops

 

Replacing Player model with a ped model requests only that the player is available

Therefor a check for 0256: player $PLAYER_CHAR defined

 

To can loop a conditional check needs a wait code, wait 0, otherwise we will get a crash.

Same for all other loop constructs!!!

 

Then you should just know: If Player model has been changed with a ped model, then you can't watch a mission cutscene,

so don't start new game, because this will start the intro cutscene

also you can't play features like food eating, cloth changing, gymnastics

 

Your script:

 

{$CLEO .cs}thread 'PLAYSWT'repeat wait 0 msuntil 0256:   player $PLAYER_CHAR defined023C: load_special_actor 'SWEET' as 1 // models 290-2990247: load_model #M40247: load_model #MINIGUN:PLYASWEET3if or823D:   not special_actor 1 loaded8248:   not model #M4 available8248:   not model #MINIGUN availablejf @PLYASWEET4 wait 0 msjump @PLYASWEET3:PLYASWEET409C7: change_player $PLAYER_CHAR model_to #SPECIAL0101B2: give_actor $PLAYER_ACTOR weapon 31 ammo 9999 // Load the weapon model before using this01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 9999 // Load the weapon model before using this01B9: set_actor $PLAYER_ACTOR armed_weapon_to 310330: set_player $PLAYER_CHAR infinite_run 1// requires a bole, means either 1 or 00109: player $PLAYER_CHAR money += 1000000055E: set_player $PLAYER_CHAR max_health += 200055F: set_player $PLAYER_CHAR max_armour += 50//07A1: set_walk_speed 8 can't be used in this way//02E2: set_actor $PLAYER_ACTOR weapon_accuracy_to 100// don't makes sense because user is aiming0296: unload_special_actor  103E5: show_text_box 'SUCCESS'  // Successfully changed the player into Sweet!0A93: end_custom_thread
About thread related codes:

[table]

004E: end_thread

 

This code terminates a thread (script)

 

can be used in main.scm or in cleo mission scripts with extension *.cm

 

 

 

0A93: end_custom_thread

 

This code terminates a thread (script)

 

it's the cleo equivalent to 004E: and can only be used in cleo scripts with extension *.cs or *.s

 

 

 

03A4: name_thread 'MYSCRPT'

 

Gives the thread a name (not really required to make a script)

 

Max. 7 charackter as name are valid. Can be used in every threads

 

 

 

0459: end_thread_named 'INT'

 

 

used to terminate another thread (script) by calling the thread name

requires that the thread have a valid thread name with max. 7 charackter

 

can only be used in main.scm

 

 

 

0ABA: end_custom_thread_named 'MYSCRPT'

 

used to terminate another cleo script (thread) by calling the thread name

requires that the other cleo script (thread) have a valid thread name with max. 7 charackter

 

it's the cleo equivalent to 0459: and can only be used in cleo scripts

 

[/table][table]

 

0A95: enable_thread_saving

 

This code advise Cleo to store the script state by making a savegame

 

A cleo script will be started automaticly by cleo program always from beginning.

If such a script includes parked car generator for example and you make then a save game and then you load this savegame,

then the script execute the same parked car generator again.

In this way it will be created duplicates of the items, in this case a duplicate of a parked car generator.

This happens with parked car generator, pickups, placed objects, radar icons.

Opcode 0A95: prevents this cleo problem with duplicates

Opcode 0A95: can also makes sense in other cases, when it's needed to continue a script at certain script block

after making savegame and loading that savegame

 

[/table]

 

Back to your learning. You don't know the meaning of conditional checks and loops.

 

simple script that shows a conditional check that loops

so it needs to put there a wait code

if the check is passed, then it enable thermal_vision and then the script will be terminated

 

{$CLEO .cs}:Akt03A4: name_thread 'AKT'08B2: toggle_thermal_vision 1:Akt_01//----------------------------Loop adresse0001: wait 0 msif0AB0: key_pressed 8else_jump @Akt_01//--------jump instruction by negation08B2: toggle_thermal_vision 00A93: end_custom_thread
Then the same script again

But now will let the script restart instead terminating the script with 0A93:

 

{$CLEO .cs}:Akt03A4: name_thread 'AKT':Akt_010001: wait 0 msif0256: player $PLAYER_CHAR definedelse_jump @Akt_01if0AB0: key_pressed 8//-----------------key = Backspaceelse_jump @Akt_0108B2: toggle_thermal_vision 10001: wait 3000 ms08B2: toggle_thermal_vision 0jump @Akt_01//--------Normal jump instruction to 1.LoopAdress
  • Like 1

Share this post


Link to post
Share on other sites
maoffense01

Finally,I have my first mod now! Thank you,ZAZ! Thanks for all of your help! I'll use this lessons for my next mods! By the way,I rated your profile as 5 stars!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

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