Raised This Month: $ Target: $400
 0% 

damagebits & DMG_HEGRENADE


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-11-2011 , 10:19   Re: damagebits & DMG_HEGRENADE
Reply With Quote #1

Oh, I see the problem now.

PHP Code:
public ham_takedamage2(idiVictim,inflictorattackerFloat:damagedamagebits
The correct header is:
victim id - inflictor id - attacker id - damage - damage bits
__________________
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:16   Re: damagebits & DMG_HEGRENADE
Reply With Quote #2

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

bool:NotSameTeam(index1index2)
return (
get_user_team(index1) != get_user_team(index2)); 
Or you can define
PHP Code:
#define IsPlayer(%1)             (1 <= %1 <= get_maxplayers())
#define NotSameTeam(%1,%2)         (get_user_team(%1) != get_user_team(%2)) 
weplausss is offline
weplausss
Member
Join Date: Mar 2010
Old 08-11-2011 , 10:27   Re: damagebits & DMG_HEGRENADE
Reply With Quote #3

i don't understand you i edit my code public and code
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;
       }
    }
    }
    }
    } 
weplausss is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-11-2011 , 10:40   Re: damagebits & DMG_HEGRENADE
Reply With Quote #4

Quote:
Originally Posted by weplausss View Post
i don't understand you i edit my code public and code
Look at my post, and try to find what doesn't match up.
__________________
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:45   Re: damagebits & DMG_HEGRENADE
Reply With Quote #5

yes but i have another one code in ham_takedamage2 when i delete id
Error: Undefined symbol "id"
PHP Code:
public ham_takedamage2(iVictim,inflictorattackerFloat:damagedamagebits
PHP Code:
if(is_user_alive(id) && (damagebits DMG_FALL)) {
        if(
Fall[id] >= 1) {
            new 
percent Fall[id] *  5;
            
SetHamParamFloat(4damage * (1.0 - (float(percent) / 100.0)));
        }
    
    } 
weplausss is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-11-2011 , 10:46   Re: damagebits & DMG_HEGRENADE
Reply With Quote #6

Then change it to the proper variable.
__________________
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:50   Re: damagebits & DMG_HEGRENADE
Reply With Quote #7

so it is look like?
PHP Code:
if(is_user_alive(iVictim) && (damagebits DMG_FALL)) {
        if(
Fall[iVictim] >= 1) {
            new 
percent Fall[iVictim] *  5;
            
SetHamParamFloat(4damage * (1.0 - (float(percent) / 100.0)));
        }
    
    } 
weplausss is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-11-2011 , 10:51   Re: damagebits & DMG_HEGRENADE
Reply With Quote #8

Looks fine to me.
__________________
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 , 11:08   Re: damagebits & DMG_HEGRENADE
Reply With Quote #9

everything is ok but he grenade dmg don't takes HP on me and enemies and give xp

HP shall not be deducted but it gives xp
weplausss is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-11-2011 , 11:17   Re: damagebits & DMG_HEGRENADE
Reply With Quote #10

Quote:
Originally Posted by weplausss View Post
everything is ok but he grenade dmg don't takes HP on me and enemies and give xp

HP shall not be deducted but it gives xp
I don't understand what isn't working and what you want.
__________________
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 03:21.


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