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

User->Damage World->Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DahVid
Senior Member
Join Date: Jun 2005
Old 08-27-2005 , 00:26   User->Damage World->Damage
Reply With Quote #1

I need someway to tell the difference between damage from falling/etc and someone killing someone. I'm using get_user_attacker.
DahVid is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 08-27-2005 , 00:29  
Reply With Quote #2

when falling the attacker is 0 (world)
Freecode is offline
DahVid
Senior Member
Join Date: Jun 2005
Old 08-27-2005 , 00:32  
Reply With Quote #3

Odd, I may be doing this wrong, but when I fall it beeps.

Code:
new attacker=get_user_attacker(id) if(attacker>0) {       client_cmd(attacker,"spk buttons/blip2.wav") }

is that the world beeping at me?
DahVid is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 08-27-2005 , 00:39  
Reply With Quote #4

wiered. let me see the rest of ocde.
Freecode is offline
DahVid
Senior Member
Join Date: Jun 2005
Old 08-27-2005 , 00:40  
Reply With Quote #5

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fun> public plugin_init()     {     register_plugin("Hit notifications","0.1","DahVid")     register_event("Damage", "got_hit", "b", "2!0")     register_cvar("hn_redflash","1")     register_cvar("hn_shake","1")     register_cvar("hn_beep","1") } public plugin_precache() {     precache_sound("buttons/blip2.wav") } public got_hit(id)     {     if(is_user_alive(id) && is_user_connected(id)) {             if(get_cvar_num("hn_redflash")) {                 message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id)                 write_short(25)                 write_short(25)                 write_short(9)                 write_byte(255)                 write_byte(0)                 write_byte(0)                 write_byte(100)                 message_end()             }             if(get_cvar_num("hn_shake")) {                 message_begin(MSG_ONE,get_user_msgid("ScreenShake"),{0,0,0},id)                 write_short(10000)                 write_short(500)                 write_short(500)                 message_end()             }             if(get_cvar_num("hn_beep")) {                 new attacker=get_user_attacker(id)                 if(attacker>0) {                     client_cmd(attacker,"spk buttons/blip2.wav")                 }         }     } }
DahVid is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 08-27-2005 , 00:41  
Reply With Quote #6

well that will never give you 0 as attacker because you declare this
Code:
"2!0"
if you dont know what that means i suggest you look it up
Freecode is offline
DahVid
Senior Member
Join Date: Jun 2005
Old 08-27-2005 , 00:42  
Reply With Quote #7

Ok, thanks man..
DahVid is offline
DahVid
Senior Member
Join Date: Jun 2005
Old 08-27-2005 , 01:12  
Reply With Quote #8

So, if 2 is the attacker. I erased the 2!0, now it should be able to go to any number right? It still beeps. I even tried 2=0, still beeps.

I guess i didn't understand it as much as I though, and the funcwiki/etc arn't helping.
DahVid is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-27-2005 , 02:02  
Reply With Quote #9

I'm pretty sure 2 is in fact the damage done, not the attacker. It may return as you attacking yourself (attacker == id)
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
DahVid
Senior Member
Join Date: Jun 2005
Old 08-27-2005 , 02:04  
Reply With Quote #10

Quote:
Originally Posted by XxAvalanchexX
I'm pretty sure 2 is in fact the damage done, not the attacker. It may return as you attacking yourself (attacker == id)
Yeah, I got that too. Attacker is 1, right? I did the same for 1 and it didn't work.
DahVid is offline
Reply


Thread Tools
Display Modes

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 17:55.


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