AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   increase all weapon's damage (https://forums.alliedmods.net/showthread.php?t=147659)

Jacob 01-12-2011 07:42

increase all weapon's damage
 
PHP Code:

public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
     if (!
is_user_connected(attacker))
     return 
HAM_IGNORED
 
     
new Float:newdamage
     newdamage
=damage 2.0     
     SetHamParamFloat
(4,new_damage)
     return 
HAM_IGNORED


is it right?i use it to increase weapon's damage, but ineffective.

Flipper_SPb 01-12-2011 07:54

Re: increase all weapon's damage
 
You don't need to create the new var newdamage

PHP Code:

public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
     if (
is_user_connected(attacker))
          
SetHamParamFloat(4,damage 2.0)
     return 
HAM_IGNORED



Flipper_SPb 01-12-2011 07:58

Re: increase all weapon's damage
 
And you can replace (is_user_connected(attacker)) by (0 < attacker < 33)

Arkshine 01-12-2011 08:02

Re: increase all weapon's damage
 
How you declare the forward ?

Jacob 01-12-2011 10:41

Re: increase all weapon's damage
 
Quote:

Originally Posted by Arkshine (Post 1391921)
How you declare the forward ?

Yes.

Arkshine 01-12-2011 11:39

Re: increase all weapon's damage
 
I'm telling you to show how you declare the forward...

fysiks 01-12-2011 18:56

Re: increase all weapon's damage
 
Quote:

Originally Posted by Jacob (Post 1392005)
certainly.

The "?" means it's a question :).

Jacob 01-12-2011 20:23

Re: increase all weapon's damage
 
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)
}




Arkshine 01-12-2011 20:26

Re: increase all weapon's damage
 
Jacob, I ask you : Show how you declare Ham_TakeDamage.

Jacob 01-12-2011 20:49

Re: increase all weapon's damage
 
Quote:

Originally Posted by Arkshine (Post 1392400)
Jacob, I ask you : Show how you declare Ham_TakeDamage.

RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")


All times are GMT -4. The time now is 02:07.

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