Raised This Month: $ Target: $400
 0% 

increase all weapon's damage


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-12-2011 , 20:52   Re: increase all weapon's damage
Reply With Quote #11

Show the full code.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Jacob
Senior Member
Join Date: Oct 2010
Old 01-13-2011 , 04:37   Re: increase all weapon's damage
Reply With Quote #12

Quote:
Originally Posted by Exolent[jNr] View Post
Show the full code.
i'm very very sorry for reply so late.
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"

public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage"
}
public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
  if (
is_user_connected(attacker))
   if(
get_user_flags(attacker)&ADMIN_LEVEL_A
          
SetHamParamFloat(4damage 2.0)
     return 
HAM_IGNORED

Jacob is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 01-13-2011 , 04:53   Re: increase all weapon's damage
Reply With Quote #13

Code:
if(is_user_connected(attacker) && get_user_flags(attacker)&ADMIN_LEVEL_A) 
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-13-2011 , 13:56   Re: increase all weapon's damage
Reply With Quote #14

Quote:
Originally Posted by Flipper_SPb View Post
Code:
if(is_user_connected(attacker) && get_user_flags(attacker)&ADMIN_LEVEL_A) 
That doesn't change anything.

@Jacob
Your code is fine for doubling the damage done for players with flag "m".
What is the problem?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-13-2011 , 19:00   Re: increase all weapon's damage
Reply With Quote #15

I thought you had to return at least HAM_HANDLED when you change a value in the function.
__________________
fysiks is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-13-2011 , 19:01   Re: increase all weapon's damage
Reply With Quote #16

Quote:
Originally Posted by fysiks View Post
I thought you had to return at least HAM_HANDLED when you change a value in the function.
You don't have to, but it's better to.
It does not change the effect of the function though.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Jacob
Senior Member
Join Date: Oct 2010
Old 01-14-2011 , 02:59   Re: increase all weapon's damage
Reply With Quote #17

Quote:
Originally Posted by Exolent[jNr] View Post
That doesn't change anything.

@Jacob
Your code is fine for doubling the damage done for players with flag "m".
What is the problem?
I augmented damage's multiples ,then used the meathod at #8 to test, but ineffective.
Jacob is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-14-2011 , 03:02   Re: increase all weapon's damage
Reply With Quote #18

Quote:
Originally Posted by Jacob View Post
how to test it,i use this meathod:
PHP Code:
register_event("Damage""show_damage""b""2!0""3=0""4!0")
public 
show_damage(id)
{
new 
attacker get_user_attacker(id)
if (
is_user_connected(id) && is_user_connected(attacker))
{
new 
damage read_data(2)
set_hudmessage(0100200, -1.00.4420.14.00.020.02, -1)
show_hudmessage(attacker,"%i^n"damage)
}


Use this instead:

Code:
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage_Post", 1); public fw_TakeDamage_Post(victim, inflictor, attacker, Float:damage, damagebits) {     if(is_user_connected(attacker))     {         pev(victim, pev_dmg_take, damage);                 set_hudmessage(0, 100, 200, -1.0, 0.44, 2, 0.1, 4.0, 0.02, 0.02, -1)         show_hudmessage(attacker,"%i^n", floatround(damage))     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Jacob
Senior Member
Join Date: Oct 2010
Old 01-14-2011 , 04:23   Re: increase all weapon's damage
Reply With Quote #19

Quote:
Originally Posted by Exolent[jNr] View Post
Use this instead:


Code:
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage_Post", 1);</p><p>&nbsp;</p><p>public fw_TakeDamage_Post(victim, inflictor, attacker, Float:damage, damagebits)</p><p>{</p><p> if(is_user_connected(attacker))</p><p> {</p><p> pev(victim, pev_dmg_take, damage);</p><p>&nbsp;</p><p> set_hudmessage(0, 100, 200, -1.0, 0.44, 2, 0.1, 4.0, 0.02, 0.02, -1)</p><p> show_hudmessage(attacker,"%i^n", floatround(damage))</p><p> }</p><p>}
Thank you!!
Jacob 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 02:07.


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