i decide to modify weapon penetration power with rage,
from meTaLiCroSS advice
https://forums.alliedmods.net/showthread.php?t=233756
i got this example script from rage module thread.
it seems to change weapon max distance, on this:
RageSetParam( 5, 500.0 ); // max distance
but it not work, i still can shoot enemy more than 500 unit
when i change param to penetration, like this.
RageSetParam( 6, 50.0 ); // i think this is for penetration
its not work too.
please help.
this is the example script i got from rage thread.
PHP Code:
#include <amxmodx>
#include <rage>
#include <fakemeta>
public plugin_init()
{
new RageFunc:handleFunc = RageGetFunction( "CBaseEntity::FireBullets3" );
RageCreateHook( handleFunc, "OnFireBullets3_Pre", RageHookPre );
RageCreateHook( handleFunc, "OnFireBullets3_Post", RageHookPost );
}
public OnFireBullets3_Pre( entity, Float:source[3], Float:dirShooting[3], Float:spread, Float:distance, penetration, bulletType, damage, Float:rangerModifier, attacker, bool:isPistol, sharedRand )
{
log_amx( "%d, %f %f %f, %f %f %f, %f, %f, %d, %d, %d, %f, %d, %d, %d", entity, source[0], source[1], source[2], dirShooting[0], dirShooting[1], dirShooting[2], spread, distance, penetration, bulletType, damage, rangerModifier, attacker, isPistol, sharedRand );
RageSetParam( 5, 500.0 ); // max distance
}
public OnFireBullets3_Post( entity, Float:source[3], Float:dirShooting[3], Float:spread, Float:distance, penetration, bulletType, damage, Float:rangerModifier, attacker, bool:isPistol, sharedRand )
{
new Float:origReturn[3];
RageGetReturn( origReturn );
log_amx( "origReturn = %f %f %f", origReturn[0], origReturn[1], origReturn[2] );
}
Note:
Rage module is running well