Raised This Month: $51 Target: $400
 12% 

Problems changing the damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sasske
Senior Member
Join Date: Nov 2012
Old 01-28-2014 , 15:15   Problems changing the damage
Reply With Quote #1

Hello AlliedModders!

First: Sorry for my english :/

I have problems changing the damage of weapon only for one player.

PHP Code:
public FwdTakeDamage(victiminflictorattackerFloat:damagedamage_bits)  
{    
    if(
victim == attacker || !is_user_alive(victim) || !is_user_alive(attacker)) //Checks for no bugs
        
return HAM_IGNORED
     
    if(
g_PlayerClass[attacker] != 1//Checks for the player can/canīt use the damage multiplier
        
return HAM_IGNORED
    
    SetHamParamFloat
damage 3.0  )  //Setting the damage
    
return HAM_HANDLED  

PD: I check the event with:

PHP Code:
RegisterHam(Ham_TakeDamage"player""FwdTakeDamage"0
The problem is the player with g_PlayerClass = 1 no multiplier the damage, but if a bot/player attack the player with g_PlayerClass = 1, the bot/player multiplier the damage!

My idea is: if player has g_PlayerClass = 1 and attack other player, cause more damage to the other player.

Can help me?

Thanks for all!

Last edited by sasske; 01-28-2014 at 15:26.
sasske is offline
Send a message via MSN to sasske
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-29-2014 , 19:09   Re: Problems changing the damage
Reply With Quote #2

Try to change:

PHP Code:
if(g_PlayerClass[attacker] != 1//Checks for the player can/canīt use the damage multiplier 
        
return HAM_IGNORED 


PHP Code:
if(g_PlayerClass[attacker] == 1//Checks for the player can/canīt use the damage multiplier 
        
return HAM_SUPERCEDE 
__________________
What are you looking for here?

Last edited by DavidJr; 01-29-2014 at 19:09.
DavidJr is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-30-2014 , 01:09   Re: Problems changing the damage
Reply With Quote #3

Correct code would be :

Spoiler



If this is not working, check where you set g_PlayerClass if it is correctly done (consider DavidJr post (not the supercede part since you don't want to block damage), you may have inversed what you wanted to do).
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-31-2014 at 00:53.
ConnorMcLeod is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 01-30-2014 , 08:28   Re: Problems changing the damage
Reply With Quote #4

Also, ham doesn't work properly with bots.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
sasske
Senior Member
Join Date: Nov 2012
Old 01-30-2014 , 13:22   Re: Problems changing the damage
Reply With Quote #5

Quote:
Originally Posted by GuskiS View Post
Also, ham doesn't work properly with bots.
Oh, I testing with bots, Sorry for all problems, and Thanks for all codes!

See you later

Last edited by sasske; 01-30-2014 at 13:27.
sasske is offline
Send a message via MSN to sasske
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-30-2014 , 17:45   Re: Problems changing the damage
Reply With Quote #6

But you can use Ham Bots API
__________________
What are you looking for here?
DavidJr is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-31-2014 , 00:54   Re: Problems changing the damage
Reply With Quote #7

I've added support for czero bots.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 01-31-2014 , 01:31   Re: Problems changing the damage
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
I've added support for czero bots.
Can't this be added into ham automatically? Like, in the newest amxx version?
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS 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 16:06.


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