Raised This Month: $ Target: $400
 0% 

Damage multiplier for all weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jsaissac
Junior Member
Join Date: Sep 2011
Old 09-22-2011 , 02:40   Damage multiplier for all weapons
Reply With Quote #1

Hi, i'm trying to make a damage multiplier for all weapons, i can't make it work.

I have this:

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <amxmisc>

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

new cvar_dmgmultiplier


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_concmd("amx_dmgmultiplier","dmgmultiplier")
    
cvar_dmgmultiplier register_cvar("amx_dmg_multiplier""5")
    
    
// Add your code here...
}

public 
dmgmultiplier(id,Float:damage)
{
    if(!(
get_user_flags(id) & ADMIN_RCON))
    {
        
SetHamParamFloat(4damage get_pcvar_floatcvar_dmgmultiplier ) )
    }

The code is bad, and i don't know how i define "damage" (the underlined).
I want to make this plugin only for rcon admins.
Sorry for my bad english, thanks, jsaissac.
jsaissac is offline
D.Moder
I uploaded 2 great gameplay plugins here
Join Date: Sep 2009
Location: Sin city
Old 09-22-2011 , 02:52   Re: Damage multiplier for all weapons
Reply With Quote #2

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

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

new cvar_dmgmultiplier

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

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if (
victim == attacker || inflictor != attacker || !is_user_connected(attacker))
        return 
HAM_IGNORED
    
    SetHamParamFloat
(4get_pcvar_float(cvar_dmgmultiplier))
    
    return 
HAM_IGNORED

fixed it for ya

just change the cvar for different damage multiplication
__________________
Creator of COD-Life (Half COD, Half Life)
https://forums.alliedmods.net/showthread.php?t=261162
twitter: @D_Moder_61216
D.Moder is offline
e12harry
Member
Join Date: Apr 2010
Old 09-22-2011 , 03:15   Re: Damage multiplier for all weapons
Reply With Quote #3

change
PHP Code:
SetHamParamFloat(4get_pcvar_float(cvar_dmgmultiplier)) 
to
PHP Code:
SetHamParamFloat(4damage get_pcvar_float(cvar_dmgmultiplier)) 
Also as far as I know wouldn't
PHP Code:
inflictor != attacker 
be true if damage was given by HE grenade?
e12harry is offline
jsaissac
Junior Member
Join Date: Sep 2011
Old 09-22-2011 , 03:41   Re: Damage multiplier for all weapons
Reply With Quote #4

Hi, thanks for help, but not work, and I think is missing this:
PHP Code:
register_concmd("amx_dmgmultiplier","fw_takedamage"
or something like this, because, if not how do I make it multiply the damage of the rcon admin?
jsaissac is offline
e12harry
Member
Join Date: Apr 2010
Old 09-22-2011 , 03:52   Re: Damage multiplier for all weapons
Reply With Quote #5

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) )
    {
    
SetHamParamFloat(4damage get_pcvar_float(cvar_dmgmultiplier))
    }

If you don't need checking teams delete #include <cstrike> and cs_get_user_team(id) == cs_get_user_team(attacker)

Moltiply is set with cvar amx_dmg_multiplier (by default set to 5)
Try to set amx_cvar amx_dmg_multiplier 100 and any damage should kill oponent
e12harry is offline
jsaissac
Junior Member
Join Date: Sep 2011
Old 09-22-2011 , 04:32   Re: Damage multiplier for all weapons
Reply With Quote #6

Don't work, autmatically detec if is an admin rcon and multiply his dmg? or it have to be activated by a comand?
jsaissac is offline
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
jsaissac
Junior Member
Join Date: Sep 2011
Old 09-23-2011 , 02:12   Re: Damage multiplier for all weapons
Reply With Quote #8

what i'm doing bad?

edit: yes i have steam, but i was testing with bots from nosteam. id: jsaissac
Attached Files
File Type: log L0923000.log (5.8 KB, 193 views)
File Type: ini modules.ini (1.1 KB, 199 views)
File Type: ini plugins.ini (1.6 KB, 179 views)
File Type: sma Get Plugin or Get Source (dmgmultiplier.sma - 576 views - 1.0 KB)

Last edited by jsaissac; 09-23-2011 at 02:15.
jsaissac is offline
e12harry
Member
Join Date: Apr 2010
Old 09-23-2011 , 02:59   Re: Damage multiplier for all weapons
Reply With Quote #9

Ham_TakeDamage has no effects on bots. Try with real player.
I have seen somewhere registering ham for entities (like bots), but i have never done that so I can't help you with this.
e12harry is offline
jsaissac
Junior Member
Join Date: Sep 2011
Old 09-23-2011 , 03:13   Re: Damage multiplier for all weapons
Reply With Quote #10

Ok, i'm going to test with players.

EDIT: isn't working with players :/

Last edited by jsaissac; 09-23-2011 at 03:37.
jsaissac is offline
Reply



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:31.


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