Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      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

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

[SA|CLEO4]Killed ped opcode


Ghost_Rider3
 Share

Recommended Posts

Ghost_Rider3

Hi.Is there any ocpode that "see" is PLAYER_ACTOR killed any ped ,then for example draw a texture on screen.

Link to comment
Share on other sites

Stat:

121 People you've wasted

 

You have to read this stat in loop.

Read new value, check if new value is higher than previous value. If yes, then do something, then assign a new value to variable.

 

Untested code

 

{$CLEO}0000: NOP:loopwait 00652: get_int_stat 121 store_to [email protected]  // get new valueif001D:   [email protected] > [email protected]   // is new value greater than old valuegoto_if_false @loop0085: [email protected] = [email protected]  // (int)  ; update value of people killed in variable.// do something// draw some texturegoto @loop
  • Like 2
Link to comment
Share on other sites

Ghost_Rider3

@fastman92 Thanks,but your example don't work;i get when i want to compile unknown directive goto_if_false.I put in place of goto_if_false ,else_jump @loop;and i compiled it (now worked),but the game crash at loading screen.(i have a file named ped with texture named 1 in models/txd)

 

This is the code:

{$CLEO}
0000: NOP
0390: load_txd_dictionary "ped"
038F: load_texture "1" as 1

:loop
wait 0
0652: get_int_stat 121 store_to [email protected]
if
001D: [email protected] > [email protected]
else_jump @loop
0085: [email protected] = [email protected]
038D: draw_texture 1 position 570.0 85.0 size 133.0 23.0 RGBA 255 255 255 255
0001: wait 6000
03F0: enable_text_draw 0
goto @loop

 

The i made this code,and don't worked aswell:

{$CLEO}
0000: NOP
thread 'loop'
0390: load_txd_dictionary "ped"
038F: load_texture "1" as 1
0652: get_int_stat 121 store_to [email protected]

:loop
wait 0
0652: get_int_stat 121 store_to [email protected]
if
001D: [email protected] > [email protected]
else_jump @loop
0085: [email protected] = [email protected]
038D: draw_texture 1 position 570.0 85.0 size 133.0 23.0 RGBA 255 255 255 255
0001: wait 6000
03F0: enable_text_draw 0
jump @loop

 

Can you help me,please?






Edited by Ghost_Rider3
Link to comment
Share on other sites

I preferred the first snippet (though the fact you initialised [email protected] before starting the loop in the 2nd deserves bonus credit), so I'll work from that.

 

This is the code:

 

{$CLEO}0000: NOP0390: load_txd_dictionary "ped"038F: load_texture "1" as 1 0652: get_int_stat 121 store_to [email protected]  // good idea, the stat might not start from 0 - in which case the condition would pass immediately the first time:loopwait 00652: get_int_stat 121 store_to [email protected]  if001D:   [email protected] > [email protected]_jump @loop0085: [email protected] = [email protected]

 

Logically valid so far. In fact, you could simply add this to the end and you'd have a working example of what you asked for:

 

 

0ACC: print_string "Look at me, look at me!" time 1000jump @loop

In fact, it's the code you didn't ask for help for which is more concerning:

 

 

038D: draw_texture 1 position 570.0 85.0 size 133.0 23.0 RGBA 255 255 255 2550001: wait 600003F0: enable_text_draw 0  jump @loop
You should look up 03F0.

 

Since you've not set the 03F0 flag, it could currently be anything, depending on other running scripts (including the main.scm in some cases). Really, you should use the 'enable once' mode and re-draw the texture every frame (applying the same flag each time) until you want it to disappear, because otherwise another script can change the setting and cause the draws to stack up infinitely until the game crashes or simply not show the texture at all.

 

EDIT: And once again, GTAF loses half my post. Fixed.

Edited by Deji
  • Like 1
Link to comment
Share on other sites

Ghost_Rider3

Thanks fastman for helping me.I used your cod with 2nd end(with texture draw,not printstring) and the game crash at loadin screen(i have the txd file).I texted on 3 gta sa cleo version cleo 4.3.1 non modded,cleo 4.1.1 modded,cleo 4.1.1 non modded ....crash every time.

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.