Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

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

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    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. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. 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. Red Dead Redemption 2

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

    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
    1. Announcements

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

How to I maker a timer countdown?


skatefilter5
 Share

Recommended Posts

skatefilter5

I was wondering how do I put a timer when my homie dies until being revived like in saints row.

 

But in the opcode I only see these:

014E: start_timer_at $7234 count_in_direction 1 // global_variable
014F: stop_timer $1923
0890: enable_sound_when_timer $253 reach 3 seconds // global_variable
03C3: set_timer_to $1923 type 1 GXT 'BB_19' // global_variable // Time
If I add like that, when there's no start of "$782 = timer" it will crash when I use these.
I type "timer" and that's it shows.

 

 

SPACE + 4

VVVVVVVV

//-------------MAIN---------------0000: NOP :NONAME_2wait 0 if and0AB0:   key_pressed 32 0AB0:   key_pressed 52 else_jump @NONAME_2 wait 0 Model.Load(#MP5LNG)Model.Load(#CHROMEGUN)Model.Load(#AK47)Model.Load(#SAWNOFF)Model.Load(#DESERT_EAGLE)Model.Load(#BAT)Model.Load(#KNIFECUR)Model.Load(#SILENCED)Model.Load(#SHOTGSPA)Model.Load(#M4)Model.Load(#MICRO_UZI)Model.Load(#VWMYCD)04ED: load_animation "MEDIC" 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 2.0 -1.0 038B: load_requested_models [email protected] = Actor.Create(Gang2, #VWMYCD, [email protected], [email protected], [email protected])jump @NONAME_174 :[email protected] = Actor.Create(Gang2, #VWMYCD, [email protected], [email protected], [email protected]):[email protected] = Marker.CreateAboveActor([email protected])Marker.SetColor([email protected], 2)018B: set_marker [email protected] radar_mode 2 Actor.Health([email protected]) = 180007AF: $PLAYER_GROUP = player $PLAYER_CHAR group 0631: put_actor [email protected] in_group $PLAYER_GROUP 0630: put_actor [email protected] in_group $PLAYER_GROUP as_leader 04D8: set_actor [email protected] drowns_in_water 0 060F: set_actor [email protected] melee_accuracy_to 60.0 Actor.WeaponAccuracy([email protected]) = 6507DD: set_actor [email protected] attack_rate 75 // previously known as temper_to 087E: set_actor [email protected] weapon_droppable 0 0446: set_actor [email protected] dismemberment_possible 0 Actor.GiveWeaponAndAmmo([email protected], Shotgun, 9999)wait 800 :NONAME_288wait 0 if    Actor.Dead([email protected])else_jump @NONAME_578 else_jump @NONAME_288 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 -1.0 wait 1000 Marker.SetColor([email protected], 4)018B: set_marker [email protected] radar_mode 3 0ACD: show_text_highpriority "You have to revive your ~p~homie~w~." time 3500 :NONAME_406wait 0 if 00F3:   actor $PLAYER_ACTOR near_actor [email protected] radius 1.0 1.0 sphere 0 on_foot else_jump @NONAME_406 0ACD: show_text_highpriority "Press F/Enter to revive your ~p~homie~w~." time 3500 :NONAME_489wait 0 if 00E1:   player 0 pressed_key 15 else_jump @NONAME_406 else_jump @NONAME_489 00BE: text_clear_all 0605: actor $PLAYER_ACTOR perform_animation "CPR" IFP "MEDIC" framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 0 time 9200 wait 4850 Marker.Disable([email protected])Actor.DestroyInstantly([email protected])wait 0 jump @NONAME_155 :NONAME_578wait 0 if and0AB0:   key_pressed 32 0AB0:   key_pressed 52 else_jump @NONAME_288 else_jump @NONAME_578 Marker.Disable([email protected])Actor.DestroyInstantly([email protected])wait 1000 jump @NONAME_2 
Link to comment
Share on other sites

If I add like that, when there's no start of "$782 = timer" it will crash when I use these.

What did you mean by this? Nevermind, if you're going to use timers you should now that these opcodes work only with global variables and that it's not a good idea to create a global variable in a CLEO script. Seemann wrote some functions that allow you to create a timer or a counter without global variables, so if you want you can use them instead. I wrote an example:

 

 

{$CLEO}0000:/****** EXAMPLE ******/:loopwait 0if 0ADC: test_cheat "TIMERS"jf @[email protected] = 11000 //[email protected] = 100   //[email protected] = 0    //timerb0AB1: call_scm_func @SetTimer 3 VARNUMBER = 0 TYPE = 1 GXT = @GXT0AB1: call_scm_func @SetStatusText 4 VARNUMBER = 33 TYPE = 0 GXT = @GXT LINE = 0 0AB1: call_scm_func @SetStatusText 4 VARNUMBER = 1 TYPE = 1 GXT = @GXT LINE = [email protected] = 0while [email protected] > 0    wait 0    if [email protected] > 0    then        //i decrease status bar each second        if [email protected] >= 1000        then            [email protected] -= 10            [email protected] = 0        end    else       0AB1: call_scm_func @RemoveStatusText 1 ( VARNUMBER = 1 )    endend0AB1: call_scm_func @StopTimer 1 ( VARNUMBER = 0 )0AB1: call_scm_func @RemoveStatusText 1 ( VARNUMBER = 33 )jump @loop0A93: end_custom_thread/****** COPY AND PASTE THESE FUNCTIONS ******/:SetStatusText //03C4: set_status_text                0AB1: call_scm_func @__VarToOffset 1 [email protected] [email protected]: call_scm_func @__LabelToOffset 1 [email protected] [email protected]: call_method 0x0044CDA0 struct 0x00BA1788 num_params 4 pop 0 ( LINE = [email protected] GXT = [email protected] TYPE = [email protected] VARNUMBER = [email protected] )0AB2: ret 0 :RemoveStatusText //0151: remove_status_text0AB1: call_scm_func @__VarToOffset 1 [email protected] [email protected]: call_method 0x0044CE80 struct 0x00BA1788 num_params 1 pop 0 ( VARNUMBER = [email protected] )0AB2: ret 0 :SetTimer //03C3: set_timer_to0AB1: call_scm_func @__VarToOffset 1 [email protected] [email protected]: call_scm_func @__LabelToOffset 1 [email protected] [email protected]: call_method 0x0044CD50 struct 0x00BA1788 num_params 3 pop 0 ( TYPE = [email protected] GXT = [email protected] VARNUMBER = [email protected] )0AB2: ret 0 :StopTimer //014F: stop_timer0AB1: call_scm_func @__VarToOffset 1 [email protected] [email protected]: call_method 0x0044CE60 struct 0x00BA1788 num_params 1 pop 0 ( VARNUMBER = [email protected] )0AB2: ret 0 :__VarToOffset0A90: [email protected] = [email protected] * 40AC7: [email protected] = var [email protected] offset005A: [email protected] += [email protected] // (int)[email protected] -= 0xA499600AB2: ret 1 [email protected]:__LabelToOffsetif [email protected] == 0then 0AB2: ret 1 0end0AC6: [email protected] = label [email protected] [email protected] += 30AB2: ret 1 [email protected]//:GXT1//0900: 'BB_18'//etc... you can add more:GXT0900: 'BB_19' //You can change this value.0000:

 

 

VARNUMBER

Number of a variable that should store the time/count, for example 2, 33, ...

 

TYPE

SetStatusText:

- 0 show number

- 1 show status bar

SetTimer:

- 0 increasing

- 1 decreasing

 

GXT

GXT key of text that you want to show (eg. 'BB_19' = TIME). If you don't want text, set 0.

To set GXT you need to use label and 0900 like shown in this example.

 

LINE

You can use up to 4 counters.

So LINE can have values 0, 1, 2, 3.

- You can have only one timer.

Edited by kosticn101
Link to comment
Share on other sites

I feel like if you still use global variables in CLEO scripts when told not to, you should really start studying how to code...

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
 Share

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