Raised This Month: $ Target: $400
 0% 

Damage Done, By Single Shot.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dygear
SourceMod Donor
Join Date: Apr 2004
Location: Levittown, NY
Old 07-10-2004 , 00:19   Damage Done, By Single Shot.
Reply With Quote #1

I want this to be called every time someone is shot, and to the player that did the shooting to be sent a message containing how much damage was done by that shot.

Code:
public damage_color(id){     new dyTeam[32], dyDamage[32]     get_user_team(id, dyTeam, 2)     // Place Damage Done Here, please make it read into dyDamage.     if(dyTeam == "co"){         set_hudmessage(0, 0, 255, -0.50, 0.45, 0, 3.0, 6.0, 0, 0, 3)         show_hudmessage(0,"%s",dyDamage)     }else{         set_hudmessage(255, 0, 0, -0.50, 0.45, 0, 3.0, 6.0, 0, 0, 3)         show_hudmessage(0,"%s",dyDamage)     } }
__________________
Dygear is offline
Send a message via AIM to Dygear Send a message via MSN to Dygear Send a message via Skype™ to Dygear
Ryan
Senior Member
Join Date: May 2004
Location: NH, USA
Old 07-10-2004 , 23:44  
Reply With Quote #2

Code:
public Ev_Damage( vIndex ) {     new aIndex = get_user_attacker( vIndex );     new iDamage = read_data( 2 );     new szName[32];     get_user_name( vIndex, szName, 31 );     new szMessage[128];     format( szMessage, 127, "You dealt %i damage to %s.", iDamage, szName );     // .. display this message however.     return PLUGIN_CONTINUE; } register_plugin() {     // ... other stuff in here     register_event( "Damage", "Ev_Damage", "b" );     return PLUGIN_CONTINUE; }

Hope this helps
__________________
Warcraft 3: Expansion
Homepage | Downloads | Forums
Ryan is offline
Send a message via AIM to Ryan
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 07-10-2004 , 23:47  
Reply With Quote #3

have a whole plugin that does this....

Code:
#include <amxmod> public on_damage(id) {   new attacker = get_user_attacker(id)   if (is_user_alive(id) && is_user_alive(attacker)) {     new damage = read_data(2)     set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, 12)     show_hudmessage(attacker,"%i^n", damage)     set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, 13)     show_hudmessage(id,"%i^n",damage)   }   return PLUGIN_CONTINUE } public plugin_init() {    register_plugin("Damage Done","0.4","Manip")    register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")    return PLUGIN_CONTINUE }

its for amx... but I think its an easy port ;)
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
Dygear
SourceMod Donor
Join Date: Apr 2004
Location: Levittown, NY
Old 07-11-2004 , 00:19  
Reply With Quote #4

Thanks soo much, ill take a look at the code, and tell you if it works out.
(My plugin that is going to use this is not like 95% done.)

[EDIT] IT WORKS, YES, YOU GUYS ROCK!.
__________________
Dygear is offline
Send a message via AIM to Dygear Send a message via MSN to Dygear Send a message via Skype™ to Dygear
Dygear
SourceMod Donor
Join Date: Apr 2004
Location: Levittown, NY
Old 07-20-2004 , 05:55  
Reply With Quote #5

I edited the code for this ever so slightly, and I get errors.

Quote:
Originally Posted by The jtp10181 Way
Code:
The instruction at 0x0041c40a referenced memory at 0x00000008.
The memory could not be read.
Code:
/******************************************************************************** * Plugin name       : Damage Done. * Made by       : Dygear * Modules required  : None * Warranties        : This file is provided as is (no warranties). * Thanks to     : TaL for this idea, and Lud for all of his help and puting *             up with me for soo long. ********************************************************************************/ #include <amxmodx> #include <cstrike> public on_damage(id){     new attacker = get_user_attacker(id)     new damage = read_data(2)     if (is_user_alive(id) && is_user_alive(attacker)){         if (cs_get_user_team(id) == "CS_TEAM_CT"){             set_hudmessage(0, 100, 200, -1.0, 0.50, 2, 0.1, 4.0, 0.02, 0.02, 12)             show_hudmessage(attacker,"%i^n", damage)         }else{             set_hudmessage(255, 0, 0, -1.0, 0.50, 2, 0.1, 4.0, 0.1, 0.1, 13)             show_hudmessage(id,"%i^n",damage)         }     return PLUGIN_CONTINUE } public plugin_init(){     register_plugin("Damage Done","0.1","Dygear")     register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")     return PLUGIN_CONTINUE }
Quote:
Originally Posted by The Ryan Way
Code:
The instruction at 0x0041c40a referenced memory at 0x00000008.
The memory could not be read.
Code:
/******************************************************************************** * Plugin name       : Damage Done. * Made by           : Dygear * Modules required  : None * Warranties        : This file is provided as is (no warranties). * Thanks to         : TaL for this idea, and Lud for all of his help and puting *                     up with me for soo long. ********************************************************************************/ #include <amxmodx> #include <cstrike> public ev_damage( vIndex ){     new aIndex = get_user_attacker( vIndex );     new iDamage = read_data( 2 );     if (cs_get_user_team( vIndex ) == "CS_TEAM_CT"){         set_hudmessage(0, 100, 200, -1.0, 0.50, 2, 0.1, 4.0, 0.02, 0.02, 12)         show_hudmessage( vIndex , "%i^n" , iDamage)     }else{         set_hudmessage(255, 0, 0, -1.0, 0.50, 2, 0.1, 4.0, 0.1, 0.1, 13)         show_hudmessage( vIndex , "%i^n" , iDamage)     } } register_plugin(){     register_plugin("Damage Done","0.1","Dygear")     register_event( "Damage", "ev_damage", "b" );     return PLUGIN_CONTINUE; }

Quote:
Originally Posted by The Dygear Way
Code:
The instruction at 0x0041c40a referenced memory at 0x00000008.
The memory could not be read.
Code:
/******************************************************************************** * Plugin name       : Damage Done. * Made by           : Dygear * Modules required  : None * Warranties        : This file is provided as is (no warranties). * Thanks to         : TaL for this idea. *                     Lud for all of his help and puting up with me for soo long. ********************************************************************************/ #include <amxmodx> #include <cstrike> public on_damage(id){     new attacker = get_user_attacker(id)     if (is_user_alive(id) && is_user_alive(attacker)){         if (cs_get_user_team(id) == "CS_TEAM_CT"){             new damage = read_data(2)             set_hudmessage(0, 100, 200, -1.0, 0.50, 2, 0.1, 4.0, 0.02, 0.02, 12)             show_hudmessage(attacker,"%i^n", damage)         }else{             new damage = read_data(2)             set_hudmessage(255, 0, 0, -1.0, 0.50, 2, 0.1, 4.0, 0.1, 0.1, 13)             show_hudmessage(id,"%i^n",damage)         }     }     return PLUGIN_CONTINUE } public plugin_init(){     register_plugin("Damage Done","0.1","Dygear")     register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")     return PLUGIN_CONTINUE }
__________________
Dygear is offline
Send a message via AIM to Dygear Send a message via MSN to Dygear Send a message via Skype™ to Dygear
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 07-20-2004 , 06:19  
Reply With Quote #6

ur missing a closing bracket }
also in hud messages theres only 4 channels.
Freecode is offline
Dygear
SourceMod Donor
Join Date: Apr 2004
Location: Levittown, NY
Old 07-20-2004 , 06:26  
Reply With Quote #7

LOL, its allways the stupid littel things.
[EDIT] Still not working.
__________________
Dygear is offline
Send a message via AIM to Dygear Send a message via MSN to Dygear Send a message via Skype™ to Dygear
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 07-20-2004 , 08:10  
Reply With Quote #8

might want to try and put the read_data thing outaside the if blocks and only have it once.

paste your new code and I will tery it out later
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
AlucarD_fOx
Member
Join Date: Jul 2004
Location: Araraquara, SP - Bra
Old 07-22-2004 , 00:57  
Reply With Quote #9

Sorry, error in my Iexplorer...
AlucarD_fOx is offline
Send a message via ICQ to AlucarD_fOx Send a message via MSN to AlucarD_fOx
AlucarD_fOx
Member
Join Date: Jul 2004
Location: Araraquara, SP - Bra
Old 07-22-2004 , 01:01  
Reply With Quote #10

What´s plugin works correct? I have the bullet_damage and this plugin dont work too, the message of damage dont show in screen of atacker...

Thank´s to help me...
AlucarD_fOx is offline
Send a message via ICQ to AlucarD_fOx Send a message via MSN to AlucarD_fOx
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 15:25.


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