Raised This Month: $32 Target: $400
 8% 

damagebits & DMG_HEGRENADE


Post New Thread Reply   
 
Thread Tools Display Modes
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-11-2011 , 08:21   Re: damagebits & DMG_HEGRENADE
Reply With Quote #11

is this correct ?

PHP Code:
public fwd_Ham_TakeDamage(thisinflictorattackerFloat:fDamagebitDamage)
{
    if(
is_user_alive(this) && (bitDamage DMG_DROWN))
    {
        
SetHamParamFloat(40.0);
    }
    return 
HAM_IGNORED;

__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 08-11-2011 at 08:29.
avril-lavigne is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-11-2011 , 08:42   Re: damagebits & DMG_HEGRENADE
Reply With Quote #12

1<<24 is correct for grenade damage. His code works as is for me. Has anyone else tried it?
__________________
Bugsy is offline
5c0r-|3i0
Veteran Member
Join Date: Nov 2008
Location: Việt Nam
Old 08-11-2011 , 08:52   Re: damagebits & DMG_HEGRENADE
Reply With Quote #13

I tried 1 << 24 for He damage multiplier :d .
I think the condition was wrong . It must be
PHP Code:
( ( damage DMG_BULLET) || ( damage DMG_SLASH ) ) && !(damage DMG_HEGRENADE) ) 
So there will be no XP for damaging with using HE grenades .
I tried DMG_BLAST , doesn't work for checking He grenade damage .
5c0r-|3i0 is offline
weplausss
Member
Join Date: Mar 2010
Old 08-11-2011 , 09:03   Re: damagebits & DMG_HEGRENADE
Reply With Quote #14

lock this is my code

PHP Code:
if(attacker == inflictor) {
    if((
damagebits DMG_BULLET) || (damagebits DMG_SLASH) && !(damagebits DMG_HEGRENADE) ){
        
set_hudmessage(255000.450.5020.14.00.10.1, -1)
        
show_hudmessage(attacker,"+%.1f Xp^n"damage/3)
        
iExp[attacker] += floatround(damage)/3;
        }
    } 
and i think here is problem
PHP Code:
if(attacker == inflictor) { 
i don't know
weplausss is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-11-2011 , 09:07   Re: damagebits & DMG_HEGRENADE
Reply With Quote #15

That is the problem, inflictor is the grenade entity id when damage is done by a grenade. If damage done by weapon, inflictor== attacker. That condition is not in your OP, though. Also, change && !( to || ( preceding the grenade damage check if you want it to include grenade damage, just like in your OP.
__________________

Last edited by Bugsy; 08-11-2011 at 09:13.
Bugsy is offline
weplausss
Member
Join Date: Mar 2010
Old 08-11-2011 , 09:46   Re: damagebits & DMG_HEGRENADE
Reply With Quote #16

can you write code i don't understand you
my english is suck
weplausss is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-11-2011 , 09:49   Re: damagebits & DMG_HEGRENADE
Reply With Quote #17

Just use the code exactly as it appears in your first post. Also, explain exactly what you are trying to do so we can make sure you are going about it properly.
__________________
Bugsy is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-11-2011 , 10:06   Re: damagebits & DMG_HEGRENADE
Reply With Quote #18

Quote:
Originally Posted by weplausss View Post
and i think here is problem
PHP Code:
if(attacker == inflictor) { 
i don't know
Why didn't you show that in the first place?
You should have posted the whole forward.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
weplausss
Member
Join Date: Mar 2010
Old 08-11-2011 , 10:06   Re: damagebits & DMG_HEGRENADE
Reply With Quote #19

yes but when i throw grenade hit me and i get XP i dont wan't this
And i have problem attack in same team. when i hit my friend team
i get Exp and i cant fix this i try write many codes but still dont work

PHP Code:
bool:IsPlayer(index)
return (
<= index <= get_maxplayers());

bool:NotSameTeam(index1index2)
return (
get_user_team(index1) != get_user_team(index2));

public 
ham_takedamage2(idiVictim,inflictorattackerFloat:damagedamagebits) {
new 
ExpToGive floatround(damage) / 3;
    if(
is_user_connected(attacker)){
    if(
is_user_connected(iVictim)){
    if(
IsPlayer(attacker) && IsPlayer(iVictim) && attacker != iVictim)
    {
    if((
damagebits DMG_BULLET) || (damagebits DMG_SLASH) && !(damagebits DMG_HEGRENADE) )
    {
    if(
NotSameTeam(attackeriVictim))
    {
    
set_hudmessage(255000.450.5020.14.00.10.1, -1);
    
show_hudmessage(attacker"+%d Xp^n"ExpToGive);
    
iExp[attacker] += ExpToGive;
       }
    }
    }
    }
    } 
Now when i attack my friend i don't get exp and i don't exp for enemies
weplausss is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-11-2011 , 10:08   Re: damagebits & DMG_HEGRENADE
Reply With Quote #20

Show your NotSameTeam() function.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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:54.


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