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. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    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 IV 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 SA Mods
    10. GTA Vice City

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

      1. Guides & Strategies
      2. Help & Support
      3. GTA III 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

Sign in to follow this  
Danikov

[SA]A few questions

Recommended Posts

Danikov

I wanted to know :

1)How to edit the price for Pay'n'Spray?

2)How to disable the vehicle repair in garages?

3)How to add a text above a pickup?

Share this post


Link to post
Share on other sites
MasterHK

first and second are done by changing.main.scm (or pro scripting for GTA, change memory value of varbles and..., try change main.scm ; ) )

 

and third:

{$CLEO}wait 500003F0: enable_text_draw 1while true wait 0{$I forallpickups} 065B: store_pickup pick position_to [email protected] [email protected] [email protected] [email protected] += 1.0 0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ [email protected] [email protected] [email protected] store_to [email protected] [email protected] 054C: use_GXT_table 'SWEET6' 0341: set_text_draw_align_justify 0 0342: enable_text_draw_centered 1 033E: set_draw_text_position [email protected] [email protected] GXT 'MASTERHK'{$I for_end}end0a93:

Visit these links:

Useful using of $include

getScreenXYFrom3DCoords

Share this post


Link to post
Share on other sites
Danikov

first and second are done by changing.main.scm (or pro scripting for GTA, change memory value of varbles and..., try change main.scm ; ) )

 

and third:

{$CLEO}wait 500003F0: enable_text_draw 1while true wait 0{$I forallpickups} 065B: store_pickup pick position_to [email protected] [email protected] [email protected] [email protected] += 1.0 0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ [email protected] [email protected] [email protected] store_to [email protected] [email protected] 054C: use_GXT_table 'SWEET6' 0341: set_text_draw_align_justify 0 0342: enable_text_draw_centered 1 033E: set_draw_text_position [email protected] [email protected] GXT 'MASTERHK'{$I for_end}end0a93:
Visit these links:

Useful using of $include

getScreenXYFrom3DCoords

Alright,thanks.

 

Does anybody know how can I modify a parked car?

I want to apply some components on a car that is generated from a parked car generator but I don't know how to assign the generated car into the opcodes.

Share this post


Link to post
Share on other sites
Danikov

Well,instead of creating a new topic,I am just gonna bump it with what I want to ask:

 

I made a script that supposedly filters damage inflicted to vehicles by guns.

I use math opcodes to make the vehicle get a lowered damage value.

 

I first tested this with insane amounts of damage and it worked,the car bursted in flames and blew up.

 

Then when making the damage of only about 7 for each shot,the car becomes invulnerable and shooting its petrol cap won't make the car explode.

 

Can anyone explain why this is happening?

And one more thing,I would like to know if there is a way I could store a vehicle's health and display it on my HUD?

Share this post


Link to post
Share on other sites
Danikov

 

And one more thing,I would like to know if there is a way I could store a vehicle's health and display it on my HUD?

http://13.sannybuilder.com/files/SA/CLEO/sources/carhealth.txt

 

 

 

Thanks,but,The game had crashed in about 5-3 seconds after I entered a vehicle.

 

Anyways,I have now set the damage filter to -95 damage for the Desert Eagle,meaning that the car takes more damage,205 damage points in total for each shot,but instead the car bursts in flames.

Someone please help me out with this.

Edited by Danikov

Share this post


Link to post
Share on other sites
aStiffSausage

Could you show us the script? Reading minds isn't exactly our thing... :p

Share this post


Link to post
Share on other sites
Danikov

Could you show us the script? Reading minds isn't exactly our thing... :p

 

 

I have edited the post which had the script inside it,cause I thought I found the solution,but I haven't,so nevermind,here's the script:

{$CLEO .cs}0000:    constPIST_DAM = [email protected] while true    wait 10    {$I stdc}    {$I CLEO\forallcars}    0441: [email protected] = car veh model    if and        0A01: is_this_model_a_car [email protected]        031E: vehicle veh hit_by_weapon 22 // Pistol    then        0227: [email protected] = car veh health        PIST_DAM = 20        gosub @HFILTER1    end        if and        0A01: is_this_model_a_car [email protected]        031E: vehicle veh hit_by_weapon 23 // Silenced Pistol    then        0227: [email protected] = car veh health        PIST_DAM = 22        gosub @HFILTER1    end        if and        0A01: is_this_model_a_car [email protected]        031E: vehicle veh hit_by_weapon 24 // Desert Eagle    then        0227: [email protected] = car veh health        PIST_DAM = 90        gosub @HFILTER1    end                                         {$I CLEO\for_end}{$I CLEO\end}                                        :HFILTER1 005B: [email protected] += [email protected] // (float)0224: set_car veh health_to [email protected]                                    0A93: end_custom_thread m_thread 

EDIT : Oops,forgot to change something,take a look again.

Edited by Danikov

Share this post


Link to post
Share on other sites
MasterHK

1) i think not 031E accept weapon number as correct parameter.

some of known parameters are:

57 = by any weapon

49 = by any vehicle

 

2) write end instead of {$I CLEO\end}

 

3) [email protected] don't have value at first, use [email protected] instead of [email protected] or use [email protected] instead of [email protected]


...

use this one ;)

while true    wait 10    {$I stdc}    {$I CLEO\forallcars}    0441: [email protected] = car veh model    if and        0A01: is_this_model_a_car [email protected]        031E: vehicle veh hit_by_weapon 57 // any weapon    then                0468: clear_car veh last_weapon_damage    end                                         {$I CLEO\for_end}end

____

Note: Better to include stdc at the beginning of the script.

Share this post


Link to post
Share on other sites
Danikov

1) i think not 031E accept weapon number as correct parameter.

some of known parameters are:

57 = by any weapon

49 = by any vehicle

 

2) write end instead of {$I CLEO\end}

 

3) [email protected] don't have value at first, use [email protected] instead of [email protected] or use [email protected] instead of [email protected]

 

...

use this one ;)

while true    wait 10    {$I stdc}    {$I CLEO\forallcars}    0441: [email protected] = car veh model    if and        0A01: is_this_model_a_car [email protected]        031E: vehicle veh hit_by_weapon 57 // any weapon    then                0468: clear_car veh last_weapon_damage    end                                         {$I CLEO\for_end}end

____

Note: Better to include stdc at the beginning of the script.

 

Sorry,but that's not what I want.

I want to apply this only with firearms,not all weapons.

And tried this kind of script for the pistol,it doesn't work.

Share this post


Link to post
Share on other sites
MasterHK

OK, try this one:

{$I stdc}while true    wait 10    {$I CLEO\forallcars}    0441: [email protected] = car veh model    if and        0A01: is_this_model_a_car [email protected]        031E:   car veh hit_by_weapon 57    then        if            0AB1: call_scm_func @GetVehicleDamagingPed 1 veh [email protected]        then            0470: [email protected] = actor [email protected] current_weapon            if or                [email protected] == 22                [email protected] == 23                [email protected] == 24            then			                0468: clear_car veh last_weapon_damage             end        end               end    {$I CLEO\for_end}end

find GetVehicleDamagingPed function at here .

Share this post


Link to post
Share on other sites
aStiffSausage

This should work fine, extend it as you want. Also, tried to improve it as much as I can. :)

Untested.

{$CLEO .cs}//{$I stdc}// No need to run stdc in a loop, and it also includes opcode 0000 to prevent     constPIST_DAM = [email protected] while truewait 0{$I CLEO\forallcars}0441: [email protected] = car veh model    if    0A01: is_this_model_a_car [email protected]        then        if        031E:   car [email protected] hit_by_weapon 22        then        [email protected] = 10        gosub @HFILTER1        end    end                                       {$I CLEO\for_end}end                                        :HFILTER1 0227: [email protected] = car veh health005B: [email protected] += [email protected] // (float)0224: set_car veh health_to [email protected]: clear_car veh last_weapon_damage // This will clear the flag which is used by 031E.return                                    //0A93: end_custom_thread m_thread//^ What's this?

Share this post


Link to post
Share on other sites
madleg

anyway these scripts are not resolving

 

Then when making the damage of only about 7 for each shot,the car becomes invulnerable and shooting its petrol cap won't make the car explode.

i found some trouble in both health opcodes, so i recommend you to replace them with direct memory reading/writing

 

0A97: @ = car @ struct
@ += 1216

read/write...

Share this post


Link to post
Share on other sites
Danikov

Will try these out,thank y'all!

Share this post


Link to post
Share on other sites
MasterHK

you can also extend your script by:

if    0AB1: call_scm_func 2 @RandomOrMission actor_or_car_handle [email protected] type 0 // 0 means ped / 1 means carthen    Actor.RemoveReferences([email protected])    end

if your actor was a random ped his references removed... : )

:RandomOrMissionif    [email protected] == 0then    0A96: [email protected] = actor [email protected] structelse    0A97: [email protected] = car [email protected] [email protected] += 0x16005E0: [email protected] = read_memory [email protected] size 1 virtual_protect [email protected] == 1then    return_trueelse    return_falseendret 0

Share this post


Link to post
Share on other sites
Danikov

Well,tried this and that,still no avail.

 

Here's the subroutine label at the moment:

:HFILTER1 0A97: [email protected] = car veh [email protected] += 121605E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0005B: [email protected] += [email protected] // (float)0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 00468: clear_car veh last_weapon_damage // This will clear the flag which is used by 031E.return  

It still takes ~25 pistol bullets to take down a car.

I must be doing something wrong there,please correct me.

Share this post


Link to post
Share on other sites
MasterHK

what about mine?

Share this post


Link to post
Share on other sites
Danikov

what about mine?

 

I don't really understand what you have posted right there,some explanation would be great.

Share this post


Link to post
Share on other sites
Danikov

So it should be like this?

0A97: [email protected] = car veh [email protected] += 121605E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0005B: [email protected] += [email protected] // (float)0468: clear_car veh last_weapon_damage // This will clear the flag which is used by 031E.0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0return  

If it does,it still doesn't work.

Share this post


Link to post
Share on other sites
aStiffSausage

Hmm could you post the full script again?

Share this post


Link to post
Share on other sites
Danikov

Hmm could you post the full script again?

 

There ya go,pal.

{$CLEO .cs}{$I stdc}// No need to run stdc in a loop, and it also includes opcode 0000 to prevent     constPIST_DAM = [email protected] while truewait 0{$I CLEO\forallcars}0441: [email protected] = car veh model    if    0A01: is_this_model_a_car [email protected]        then        if        031E:   car [email protected] hit_by_weapon 22        then        [email protected] = 10 // or PIST_DAM = 10        gosub @HFILTER1        end    end                                       {$I CLEO\for_end}end                                        :HFILTER1 0A97: [email protected] = car veh [email protected] += 121605E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0005B: [email protected] += [email protected] // (float)0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 00468: clear_car veh last_weapon_damage // This will clear the flag which is used by 031E.return                                    //0A93: end_custom_thread m_thread

Share this post


Link to post
Share on other sites
madleg

here's ur code, works pretty good.

silenced dmg = 40-25

deagle dmg =(basic=70)+(300=true damage)

{$CLEO .cs}  0000: while truewait 0    0A8D: [email protected] = read_memory 0xB74494 size 4 virtual_protect 0    [email protected] += 0x4    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0    for [email protected] = 0 to 27904 step 0x100        0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0        [email protected] += 0x1        005A: [email protected] += [email protected]        if            8495:   car [email protected] burnin            then            if                031E:   car [email protected] hit_by_weapon 23                then                [email protected] = 25.0                gosub @damageCalc            end            if                031E:   car [email protected] hit_by_weapon 24                then                [email protected] = -300.0                gosub @damageCalc            end            end    end                                   end:damageCalc0468: clear_car [email protected] last_weapon_damage   0A97: [email protected] = car [email protected] [email protected] += 12160A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0005B: [email protected] += [email protected] // (float)if    [email protected] > 1000.0    then    [email protected] = 1000.0end0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 00ACE: show_formatted_text_box "car health %.1f" [email protected]

btw cars can have different damage multiplier, so if you need i can improve calculations

Share this post


Link to post
Share on other sites
Danikov

here's ur code, works pretty good.

silenced dmg = 40-25

deagle dmg =(basic=70)+(300=true damage)

{$CLEO .cs}  0000: while truewait 0    0A8D: [email protected] = read_memory 0xB74494 size 4 virtual_protect 0    [email protected] += 0x4    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0    for [email protected] = 0 to 27904 step 0x100        0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0        [email protected] += 0x1        005A: [email protected] += [email protected]        if            8495:   car [email protected] burnin            then            if                031E:   car [email protected] hit_by_weapon 23                then                [email protected] = 25.0                gosub @damageCalc            end            if                031E:   car [email protected] hit_by_weapon 24                then                [email protected] = -300.0                gosub @damageCalc            end            end    end                                   end:damageCalc0468: clear_car [email protected] last_weapon_damage   0A97: [email protected] = car [email protected] [email protected] += 12160A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0005B: [email protected] += [email protected] // (float)if    [email protected] > 1000.0    then    [email protected] = 1000.0end0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 00ACE: show_formatted_text_box "car health %.1f" [email protected]

btw cars can have different damage multiplier, so if you need i can improve calculations

 

 

Ow,wow,thanks for this,but I have got a question,what is this? :

for [email protected] = 0 to 27904 step 0x100

Share this post


Link to post
Share on other sites
MasterHK

 

Ow,wow,thanks for this,but I have got a question,what is this? :

for [email protected] = 0 to 27904 step 0x100

 

It starts an loop for get handle of all cars.(to check are them damaged and...)

Share this post


Link to post
Share on other sites
madleg

what is this?

this is from Dk's $forallvehicles

 

It starts an loop

Edited by madleg

Share this post


Link to post
Share on other sites
Danikov

Alright,thanks,by the way madleg,please check your messages.

 

I got another question,because this is a script that works with damage done to vehicles,I think it would cause some trouble with Bulletproof cars such as the Rhino.

How can I read whether the car is BP or not,I have the list of memory addresses for that,but I don't know how to read it.

Share this post


Link to post
Share on other sites
aStiffSausage

You should see these addresses. There's a way to read/write different immunities through memory, but I unfortunately can't explain much about them now. I do remember Deji having a small tutorial on how to use bits though, and he used vehicle immunities as an example, you should search for it and see if it helps.

Share this post


Link to post
Share on other sites
Danikov

You should see these addresses. There's a way to read/write different immunities through memory, but I unfortunately can't explain much about them now. I do remember Deji having a small tutorial on how to use bits though, and he used vehicle immunities as an example, you should search for it and see if it helps.

 

Alright,thanks.

I think I will just leave this for now,as I am kind of tired of working on that,kinda got frustrated.

 

Anyways,there was something else I have been working on,and its a slowmotion script that depends on a variable...variable.

The issue is,even if not all the requirements are not met and the buttons are pressed,the slowmotion triggers.

The said parts of the script.

:[email protected] == 0 // Slow Mo checking variable,0 - Disabled , 1 - [email protected] >= 25 // the variable variable that the script depends on. 0 is Minimum and 100 is maximum.044B: actor $PLAYER_ACTOR on_foot0AB0: key_pressed 0x02 // RMB0AB0: key_pressed 0x58 // X004D: jump_if_false @sm_100002: jump @sm_3:sm_3 //The game speed changes here//game speed decrease//

The thing is,the slowmotion executes even if [email protected] is not equal or higher to/than 25,it is like its being ignored,can anyone help me out with this?

+label sm_10 is used for add maths.

Edited by Danikov

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.
Note: Your post will require moderator approval before it will be visible.

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  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.