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

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

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

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

whyperioN

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

Recommended Posts

whyperioN

 

 

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

Share this post


Link to post
Share on other sites
ZAZ

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

Share this post


Link to post
Share on other sites
whyperioN

It's working thank you, you deserve to the end.

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.


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