Raised This Month: $ Target: $400
 0% 

Damage multiplier for all weapons


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
e12harry
Member
Join Date: Apr 2010
Old 09-22-2011 , 04:53   Re: Damage multiplier for all weapons
Reply With Quote #7

It should automaticly detect if attacker has ADMIN_RCON flag and multiply his damage.
I assum you have required modules enabled in modules.ini and you have added your plugin to plugins.ini?

Try this (ang give log to see thats wrong):

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

#define PLUGIN "Damage multiplier"
#define VERSION "1.0"
#define AUTHOR "jsaissac"

new cvar_dmgmultiplier
new g_iMaxPlayers

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
cvar_dmgmultiplier register_cvar("amx_dmg_multiplier""5")
    
g_iMaxPlayers get_maxplayers()
}

public 
fw_TakeDamage(idinflictorattackerFloat:damagedamage_type)
{
    if(
attacker != id && <= attacker <= g_iMaxPlayers && (get_user_flags(attacker) & ADMIN_RCON) && cs_get_user_team(id) == cs_get_user_team(attacker) )
    {
        new 
Float:newDmg damage get_pcvar_float(cvar_dmgmultiplier);
        
SetHamParamFloat(4newDmg)
        
log_amx("[DMG_MULTIPLIER] Old Dmg=%f, New Dmg=%f"damagenewDmg);
    } else {
        
log_amx("[DMG_MULTIPLIER] id:%d, attacker:%d, g_iMaxPlayers:%d, ADMIN_RCON:%d"idattackerg_iMaxPlayersget_user_flags(attacker) & ADMIN_RCON);
    }
    return 
HAM_IGNORED;


Last edited by e12harry; 09-22-2011 at 04:55.
e12harry is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode