Raised This Month: $ Target: $400
 0% 

Small Problem (BulletDamage)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pepe_thugs
Senior Member
Join Date: Aug 2010
Location: Portugal , Braga
Old 04-06-2012 , 15:20   Small Problem (BulletDamage)
Reply With Quote #1

Hello guys.
I want to put the damage appears only for player with ACESS_FLAG.

PHP Code:
/* VSBulletDamage v1.3 
Description:
 Shows the damage done.
Access flag by default:
 ADMIN_LEVEL_H.
Type:
 Constant.
*/
 
#include <amxmodx>
#include <hamsandwich>
#define ACCESS_FLAG ADMIN_LEVEL_H
 
public plugin_init() 
{
 
register_plugin("VSBulletDamage""1.3""ZETA [M|E|N]");
 
 
RegisterHam(Ham_TakeDamage"player""TakeDamage");
}
 
public 
TakeDamage(idvictimidinflictoridattackerFloat:damagedamagebits)
{
 if (!
is_user_alive(idattacker) || (get_user_team(idvictim) == get_user_team(idattacker)))
 {
  return;
 }
 
 if (
get_user_flags(idattackerACCESS_FLAG))
 {
  
set_hudmessage(1801801800.510.5106.03.0__3);
  
show_hudmessage(idattacker"%d"floatround(damage));
 }

pepe_thugs is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 04-06-2012 , 16:45   Re: Small Problem (BulletDamage)
Reply With Quote #2

use post hook on the take_damage

Also what is your issue?

get user flags returns a bit sum of your flags and is used like

get_user_flags(id) & ADMIN_LEVEL_H

Last edited by Doc-Holiday; 04-06-2012 at 16:45.
Doc-Holiday is offline
Old 04-07-2012, 00:23
StickP0le
This message has been deleted by StickP0le. Reason: cause i want to
StickP0le
Senior Member
Join Date: Jan 2010
Location: cuantocabron.com
Old 04-07-2012 , 00:24   Re: Small Problem (BulletDamage)
Reply With Quote #3

ham_takedamage must return a value, HAM_SUPERCEDE
StickP0le is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-07-2012 , 01:52   Re: Small Problem (BulletDamage)
Reply With Quote #4

Quote:
Originally Posted by StickP0le View Post
ham_takedamage must return a value, HAM_SUPERCEDE
No. Doc Holiday gave the solution.
__________________

Last edited by fysiks; 04-07-2012 at 01:52.
fysiks is offline
StickP0le
Senior Member
Join Date: Jan 2010
Location: cuantocabron.com
Old 04-07-2012 , 02:26   Re: Small Problem (BulletDamage)
Reply With Quote #5

takedamage, doesn´t need to return a value?
StickP0le is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 04-07-2012 , 02:42   Re: Small Problem (BulletDamage)
Reply With Quote #6

Quote:
Originally Posted by StickP0le View Post
takedamage, doesn´t need to return a value?
Its not the reason its not working... With your return value it would stop the takedamage call from being sent
Doc-Holiday is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-07-2012 , 02:43   Re: Small Problem (BulletDamage)
Reply With Quote #7

Quote:
Originally Posted by StickP0le View Post
takedamage, doesn´t need to return a value?
If you don't return anything it will default to HAM_IGNORED which is what you would return if you returned anything in this case. You certainly do not want to use HAM_SUPERCEDE, especially if you don't know 99.9999% about what that would actually do and if that is what you want (which it isn't in this case).
__________________
fysiks is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 04-07-2012 , 02:44   Re: Small Problem (BulletDamage)
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
If you don't return anything it will default to HAM_IGNORED which is what you would return if you returned anything in this case. You certainly do not want to use HAM_SUPERCEDE, especially if you don't know 99.9999% about what that would actually do and if that is what you want (which it isn't in this case).
Its a kewl effect it makes the player bleed but blocks the actual damage...lol that plus fully auto glock and shooting your dad while hes a newb... PURE AWESOMENESS....
Doc-Holiday is offline
pepe_thugs
Senior Member
Join Date: Aug 2010
Location: Portugal , Braga
Old 04-07-2012 , 06:01   Re: Small Problem (BulletDamage)
Reply With Quote #9

Quote:
Originally Posted by Doc-Holiday View Post
use post hook on the take_damage

Also what is your issue?

get user flags returns a bit sum of your flags and is used like

get_user_flags(id) & ADMIN_LEVEL_H


Like this :

PHP Code:
/* VSBulletDamage v1.3 
Description:
 Shows the damage done.
Access flag by default:
 ADMIN_LEVEL_H.
Type:
 Constant.
*/
 
#include <amxmodx>
#include <hamsandwich>
#define ACCESS_FLAG ADMIN_LEVEL_H
 
public plugin_init() 
{
 
register_plugin("VSBulletDamage""1.3""ZETA [M|E|N]");
 
 
RegisterHam(Ham_TakeDamage"player""TakeDamage");
}
 
public 
TakeDamage(idvictimidinflictoridattackerFloat:damagedamagebits)
{
 if (!
is_user_alive(idattacker) || (get_user_team(idvictim) == get_user_team(idattacker)))
 {
  return;
 }
 
 if (
get_user_flags(idattacker) & (ACCESS_FLAG))
 {
  
set_hudmessage(1801801800.510.5106.03.0__3);
  
show_hudmessage(idattacker"%d"floatround(damage));
 } 
But i'm tried this and not working.
pepe_thugs is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 04-07-2012 , 06:44   Re: Small Problem (BulletDamage)
Reply With Quote #10

PHP Code:
#include < amxmodx >
#include < hamsandwich >

new g_iFlags33 ];

public 
plugin_init( )
 
RegisterHamHam_TakeDamage"player""OnDamageTakenPost");

public 
client_infochangedClient )
 
g_iFlagsClient ] = get_user_flagsClient );

public 
OnDamageTakenPostVictimDummyAttackerFloatDamage )
{
 if( 
Attacker 33 && g_iFlagsAttacker ] & ADMIN_LEVEL_H )
 {
  
set_hudmessage1801801800.510.5106.03.0__);
  
show_hudmessageAttacker"%0.0f"Damage ); // Float without decimals.
 
}


Last edited by claudiuhks; 04-07-2012 at 06:47.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
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:22.


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