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. Forum Support

    3. Suggestions

[HELP][SA][CLEO]New Player Money and objectives.


whyperioN
 Share

Recommended Posts

 

 

I want to give money when I destroy the model

 

{$CLEO .cs}

//-------------MAIN---------------
thread 'MONEY'  
wait 0   

[email protected] = 0  // NEW PLAYER MONEY     

Model.Load(#KMB_ATM1)
038B: load_requested_models       

:MONEY                         
wait 0 
if
   Player.Defined($PLAYER_CHAR)
jf @MONEY
[email protected] = Object.Create(#KMB_ATM1, 316.0755, -1776.6301, 4.7053)
jf @MONEY     
03F0: enable_text_draw 1 
060D: draw_text_shadow 0 color_RGBA 0 0 0 0         
033F: set_text_draw_letter_size 0.55 2.2  
081C: draw_text_outline 2 RGBA 0 0 0 255   
0349: set_text_draw_font 3 
045A: draw_text_1number 499.0 139.0 GXT 'MONEY' number [email protected] // fxt file = MONEY ~w~$~1~ 
jf @MONEY
if             
051A:   object [email protected] damaged_by_actor $PLAYER_ACTOR
jf @MONEY
[email protected] += 50        
jump @MONEY              

 

VQ8WyV.png

sorry for bad english :D

Link to comment
Share on other sites

your script  spawns thousand of objects, because everything is running in one loop

make shure to create only one object and remove it from game if user don't play there

 

this OPCODE is INCORRECT

 

051A:   object [email protected] damaged_by_actor $PLAYER_ACTOR

 

it is for actors only

if
051A:   actor 1@ damaged_by_actor $PLAYER_ACTOR
jf

OPCODE 051A: CHECKS ACTOR DAMAGE

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

 

 

check for the object health to display the progress

071E: get_object 1@ health_to 30@ 

check with opcode 0366: if object is shattered

0366:   object 1@ broken

 

 

Test this

 

 {$CLEO .cs}
//2942, kmb_atm1
thread 'MONEY'  
wait 0
      

:MONEY_1                         
wait 0 
if
   Player.Defined($PLAYER_CHAR)
jf @MONEY_1
if 
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 316.07 -1776.63 4.7 radius 70.0 70.0 70.0
jf @MONEY_1
31@ = 0  // NEW PLAYER MONEY     
Model.Load(2942)
038B: load_requested_models 
1@ = Object.Create(2942, 316.0755, -1776.6301, 3.75)
071F: set_object 1@ health_to 5000

:MONEY_2                         
wait 0 
if
   Player.Defined($PLAYER_CHAR)
jf @MONEY_cleanup
if 
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 316.07 -1776.63 4.7 radius 90.0 90.0 90.0
jf @MONEY_cleanup
071E: get_object 1@ health_to 30@   
03F0: enable_text_draw 1
060D: draw_text_shadow 0 color_RGBA 0 0 0 0         
033F: set_text_draw_letter_size 0.55 2.2  
081C: draw_text_outline 2 RGBA 0 0 0 255   
0349: set_text_draw_font 3
045A: draw_text_1number 499.0 170.0 GXT 'number' number 30@ 
060D: draw_text_shadow 0 color_RGBA 0 0 0 0         
033F: set_text_draw_letter_size 0.55 2.2  
081C: draw_text_outline 2 RGBA 0 0 0 255   
0349: set_text_draw_font 3 
045A: draw_text_1number 499.0 139.0 GXT 'number' number 31@ // fxt file = MONEY ~w~$~1~ 

if             
//051A:   object 1@ damaged_by_actor $PLAYER_ACTOR <------INCORRECT OPCODE
//051A:   actor 1@ damaged_by_actor $PLAYER_ACTOR  <------ OPCODE 051A: CHECKS ACTOR DAMAGE
0366:   object 1@ broken
jf @MONEY_2
31@ += 50
00BA: show_text_styled GXT 'FEM_OK' time 1000 style 4
0109: player $PLAYER_CHAR money += 1000000

:MONEY_3                         
wait 0 
if
   Player.Defined($PLAYER_CHAR)
jf @MONEY_cleanup
if 
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 316.07 -1776.63 4.7 radius 50.0 50.0 50.0
jf @MONEY_cleanup
jump @MONEY_3


:MONEY_cleanup
0108: destroy_object 1@
jump @MONEY_1

 

 

If you still need to check the damage then find out how this code works

08FF:   object 1@ received_damage_type 57

 

 

 

 

 

 

Edited by ZAZ
  • Like 2
Link to comment
Share on other sites

  • 1 month later...

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.