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 A week ago

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 A week ago

//    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 A week ago

//    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 A week ago

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


Jack
  • Jack

    MODEL_SWAT

  • Feroci
  • Joined: 06 Dec 2011
  • Serbia

#5

Posted A week ago

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 A week ago

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 A week ago

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


KayLaJay15
  • KayLaJay15

    Player Hater

  • Members
  • Joined: 04 Sep 2017
  • England

#8

Posted A week ago

Sorry to ask but what is this? 


guru_guru
  • guru_guru

    pajaro culiao

  • Members
  • Joined: 22 Jul 2017
  • Chile

#9

Posted A week ago

The code above,but compiled.

And probably with the damage multiplier unchanged lmao.


DK22Pac
  • DK22Pac

    𝘉eчнo 𝘔oлoдoй...

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

#10

Posted A week ago Edited by DK22Pac, A week ago.


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 A week ago Edited by Jack, A week ago.

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 A week ago

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 A week ago

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 A week ago

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 A week ago

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 6 days ago

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 6 days ago Edited by boludoz, 6 days ago.

 

 


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 5 days ago

 

 

 


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