Quantcast

Jump to content

» «
Photo

Change Projectile Damage

17 replies to this topic
KayLaJay15
  • KayLaJay15

    Player Hater

  • Members
  • Joined: 04 Sep 2017
  • England

#1

Posted 13 November 2017 - 12:16 AM

So i'm trying to change the damage for grenades in SA using "SA Ammunation Tool" but then I found out that you can't change a projectile weapons damage, I was just wondering if there is anyway way at all to change the damage of grenades?


Jack
  • Jack

    MODEL_SWAT

  • Feroci
  • Joined: 06 Dec 2011
  • Serbia

#2

Posted 13 November 2017 - 03:12 PM

//    The part of CExplosion::AddExplosion();
#include "plugin.h"

using namespace plugin;
float DamagePercentage = 1.0;
int INT_DamagePercentage = (int)DamagePercentage;

class ExplosionDamage {
public:
    ExplosionDamage() {
        plugin::patch::SetUInt(0x736AEF, INT_DamagePercentage);   //  explo->m_fDamagePercentage = 1.0;    explo->m_fRadius = 1.0
    }
} ed;


But this can only affect vehicles (not peds).

KayLaJay15
  • KayLaJay15

    Player Hater

  • Members
  • Joined: 04 Sep 2017
  • England

#3

Posted 13 November 2017 - 03:23 PM

//    The part of CExplosion::AddExplosion();
#include "plugin.h"

using namespace plugin;
float DamagePercentage = 1.0;
int INT_DamagePercentage = (int)DamagePercentage;

class ExplosionDamage {
public:
    ExplosionDamage() {
        plugin::patch::SetUInt(0x736AEF, INT_DamagePercentage);   //  explo->m_fDamagePercentage = 1.0;    explo->m_fRadius = 1.0
    }
} ed;

But this can only affect vehicles (not peds).

 

This is EXACTLY what I need thank you sooo much


KayLaJay15
  • KayLaJay15

    Player Hater

  • Members
  • Joined: 04 Sep 2017
  • England

#4

Posted 13 November 2017 - 04:56 PM

One question though how do I put this code in the game?


Jack
  • Jack

    MODEL_SWAT

  • Feroci
  • Joined: 06 Dec 2011
  • Serbia

#5

Posted 13 November 2017 - 07:03 PM

Do you have any experience with the scm language? Have you ever build up a simple CLEO code?

 

Btw the above code is ASI (c++). Most of the beginers start with scm.


KayLaJay15
  • KayLaJay15

    Player Hater

  • Members
  • Joined: 04 Sep 2017
  • England

#6

Posted 13 November 2017 - 07:31 PM

Oh ok I see and no unfortunately I have no experience with (c++) or the scm language.  


boludoz
  • boludoz

    Rat

  • Members
  • Joined: 10 Dec 2009
  • Argentina

#7

Posted 13 November 2017 - 08:16 PM

https://drive.google...iew?usp=sharing


KayLaJay15
  • KayLaJay15

    Player Hater

  • Members
  • Joined: 04 Sep 2017
  • England

#8

Posted 13 November 2017 - 09:08 PM

Sorry to ask but what is this? 


guru_guru
  • guru_guru

    pajaro culiao

  • Members
  • Joined: 22 Jul 2017
  • Chile

#9

Posted 14 November 2017 - 11:29 AM

The code above,but compiled.

And probably with the damage multiplier unchanged lmao.


DK22Pac
  • DK22Pac

  • Feroci
  • Joined: 12 Apr 2009
  • Ukraine
  • Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
    Contribution Award [Mods]
    Helpfulness Award [Mods]

#10

Posted 14 November 2017 - 12:18 PM Edited by DK22Pac, 14 November 2017 - 12:19 PM.


This won't work, because value @0x736AEF is a float

RyFwrLy.png

You should use patch::SetFloat for this case:
#include "plugin.h"

class ExplosionDamage {
public:
    ExplosionDamage() {
        plugin::patch::SetFloat(0x736AEF, 1.0f);
    }
} ed;
  • Jack likes this

Jack
  • Jack

    MODEL_SWAT

  • Feroci
  • Joined: 06 Dec 2011
  • Serbia

#11

Posted 14 November 2017 - 12:37 PM Edited by Jack, 14 November 2017 - 01:31 PM.

This won't work, because value @0x736AEF is a float

 

 

It doesn't really matter right now but my code works. I converted float to int before I wrote the value:

float DamagePercentage = 1.0;
int INT_DamagePercentage = (int)DamagePercentage;

KayLaJay15
  • KayLaJay15

    Player Hater

  • Members
  • Joined: 04 Sep 2017
  • England

#12

Posted 14 November 2017 - 01:04 PM

Thank you everyone, so what do I do with the code? 


Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer

  • Feroci
  • Joined: 19 Aug 2006
  • Unknown
  • Contribution Award [Mods]

#13

Posted 14 November 2017 - 01:21 PM

Jack, you were meant to type-pun a float to an unsigned int without changing the underlying bits, not to type-cast which implies a conversion.
  • Jack likes this

Jack
  • Jack

    MODEL_SWAT

  • Feroci
  • Joined: 06 Dec 2011
  • Serbia

#14

Posted 14 November 2017 - 01:34 PM

Sh*t you're both right. The code doesn't work.

 

I'm sorry. (Jack cries).


KayLaJay15
  • KayLaJay15

    Player Hater

  • Members
  • Joined: 04 Sep 2017
  • England

#15

Posted 14 November 2017 - 03:12 PM

Sh*t you're both right. The code doesn't work.

 

I'm sorry. (Jack cries).

It's ok 


boludoz
  • boludoz

    Rat

  • Members
  • Joined: 10 Dec 2009
  • Argentina

#16

Posted 18 November 2017 - 12:38 AM

Sh*t you're both right. The code doesn't work.

 

I'm sorry. (Jack cries).

works only for vehicles

boludoz
  • boludoz

    Rat

  • Members
  • Joined: 10 Dec 2009
  • Argentina

#17

Posted 18 November 2017 - 12:59 AM Edited by boludoz, 18 November 2017 - 01:22 AM.

 

 


This won't work, because value @0x736AEF is a float

RyFwrLy.png

You should use patch::SetFloat for this case:
#include "plugin.h"

class ExplosionDamage {
public:
    ExplosionDamage() {
        plugin::patch::SetFloat(0x736AEF, 1.0f);
    }
} ed;
now I compile it with the sdk, despite the fact that the previous code was tested with 0 and worked correctly, but only on vehicles.
 
 
I took the courage to leave the value in 9.0f, it works only with grenades and in vehicles, an explosion is generated that ignites the vehicle in flames, and then it detonates, (as in the normal game), It seems that 0x736AEF is related to what I was testing, not with the damage, but with the necessary radius to affect the vehicle.
 

KayLaJay15
  • KayLaJay15

    Player Hater

  • Members
  • Joined: 04 Sep 2017
  • England

#18

Posted 18 November 2017 - 05:51 PM

 

 

 


This won't work, because value @0x736AEF is a float

RyFwrLy.png

You should use patch::SetFloat for this case:
#include "plugin.h"

class ExplosionDamage {
public:
    ExplosionDamage() {
        plugin::patch::SetFloat(0x736AEF, 1.0f);
    }
} ed;
now I compile it with the sdk, despite the fact that the previous code was tested with 0 and worked correctly, but only on vehicles.
 
 
I took the courage to leave the value in 9.0f, it works only with grenades and in vehicles, an explosion is generated that ignites the vehicle in flames, and then it detonates, (as in the normal game), It seems that 0x736AEF is related to what I was testing, not with the damage, but with the necessary radius to affect the vehicle.
 

 

Thank you very much, but how do I open the file?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users