Raised This Month: $ Target: $400
 0% 

Getting headshot.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 08-27-2005 , 23:41   Getting headshot.
Reply With Quote #1

Hi, I'm updating my easyinfo plugin. I was trying to add headshots. (I thought it was read_data(3) in the CurWeapon event, maybe I'm wrong.)

Here's what I got, and it always displays 0 for headshots.

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init() {     register_plugin("Stats","0.2","Dah-Veeeed")     set_task(2.0,"the_main",0,_,_,"b")     register_event("Damage","damage_event","b","2!0","3=0","4!0")     register_cvar("amx_info","1") } new damage[33] = 0 new headshot[33] = 0 public client_putinserver(id) {     damage[id] = 0     headshot[id] = 0 } public client_disconnect(id) {     damage[id] = 0     headshot[id] = 0 } public damage_event(id) {     new attacker = get_user_attacker(id)     new dmg = read_data(2)     new hs = read_data(3)         damage[attacker] += dmg     headshot[attacker] += hs } public the_main() {     if(!get_cvar_num("amx_info")) {         return PLUGIN_HANDLED     }     new players[32],num,i     new message[200]     get_players(players,num)     for(i = 0; i <= num; i++)     {         new id = players[i]                 if(is_user_connected(id)) {             new name[33]             new ping             new loss             get_user_name(id,name,32)             new frags = get_user_frags(id)             new deaths = get_user_deaths(id)             get_user_ping(id,ping,loss)                         set_hudmessage (0,0,255, 0.01, 0.29, 0, 6.0, 2.0, 0.1, 0.2, 4 )             format(message,199," %s ^n Frags: %i ^n Deaths: %i ^n Headshots: %i ^n Total Damage: %i ^n Ping: %i",name,frags,deaths,headshot[id],damage[id],ping)             show_hudmessage(id,message)         }     }     return PLUGIN_CONTINUE }
pdoubleopdawg is offline
 



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 14:18.


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