Raised This Month: $ Target: $400
 0% 

[HELP] Takedamage help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
neutron
Member
Join Date: Jul 2011
Location: Turkey
Old 08-10-2011 , 04:40   [HELP] Takedamage help
Reply With Quote #1

terrorist > counter terrorist in hits

PHP Code:
/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN    "qwewqeweewq"
#define AUTHOR    "neutron"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_TakeDamage,"player","warn",1)
}

public 
warn(id)
{
    
client_print(0,print_chat,"testttt")

it is in everyone,
I want to have to hit the terrorist ct
sorry bad english
__________________
neutron is offline
Send a message via Skype™ to neutron
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-10-2011 , 04:47   Re: [HELP] Takedamage help
Reply With Quote #2

You must check the team of both attacker and victim by using cs_get_user_team()... see cstrike.inc for values and stuff.

Also, you don't have all params placed into the function, see ham_const.inc.

And note, attacker may be a non-player entity aswell, you need to check if is a player, easiest way is to is_user_connected() on attacker.
__________________
Hunter-Digital is offline
neutron
Member
Join Date: Jul 2011
Location: Turkey
Old 08-10-2011 , 04:55   Re: [HELP] Takedamage help
Reply With Quote #3

editttttttttttttttt
__________________

Last edited by neutron; 08-10-2011 at 07:07.
neutron is offline
Send a message via Skype™ to neutron
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 08-10-2011 , 05:27   Re: [HELP] Takedamage help
Reply With Quote #4

Explain what your trying to do?
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-10-2011 , 05:31   Re: [HELP] Takedamage help
Reply With Quote #5

That is the correct call back

PHP Code:
public fwdPlayerHurt(iVictimiInflictoriAttackerFloat:flDamageiDmgbits 
get_user_team should be cs_get_user_team
Doc-Holiday is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 08-10-2011 , 05:45   Re: [HELP] Takedamage help
Reply With Quote #6

Quote:
Originally Posted by Doc-Holiday View Post
get_user_team should be cs_get_user_team
Not necessarily, either way will work. It depends if he intends on using the CStrike module for anything else, because if he removes the module, he can still check for get_user_team( id ) == 2 or he can just define the team constants himself.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 08-10-2011 , 05:55   Re: [HELP] Takedamage help
Reply With Quote #7

get_user_team returns false results some time, to stay on the safe side, use cs_get_user_team or FM to retrieve player's team
__________________

My Plugins For ZP

Inactive due to College and Studies

Last edited by abdul-rehman; 08-10-2011 at 06:41.
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 08-10-2011 , 05:57   Re: [HELP] Takedamage help
Reply With Quote #8

Oh really? Didn't know that, hasn't happened to me yet :p
In that case stick with the Doc ;)
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-10-2011 , 06:26   Re: [HELP] Takedamage help
Reply With Quote #9

Not only that he uses CS_TEAM_CT so hes already using cstrike.
Doc-Holiday is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-10-2011 , 06:26   Re: [HELP] Takedamage help
Reply With Quote #10

PHP Code:
public fw_HamTakeDamagePostvictim iInflictor iAttacker Float:dmg DmgBits )
{    

    
client_print(victimprint_chat,  " ______DAMAGE %d",floatround(dmg)) 


__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne 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:20.


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