Raised This Month: $ Target: $400
 0% 

get_stats


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Magici3n
BANNED
Join Date: Oct 2009
Location: Beautiful Beach
Old 10-12-2009 , 06:34   get_stats
Reply With Quote #1

how to take players HEADSHOT by using get_stats and display it in MOTD.....everytime i restart my server all states become zero i.e. headshot wid player is cleared. n and played again in server it shows....
Magici3n is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 10-12-2009 , 06:43   Re: get_stats
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?p=710055 ?
dFF is offline
Magici3n
BANNED
Join Date: Oct 2009
Location: Beautiful Beach
Old 10-12-2009 , 23:21   Re: get_stats
Reply With Quote #3

get_user_stats doesnt work.. I want only amount of headshots on current map, by hooking damage and count headshots in some global variable.

Last edited by Magici3n; 10-12-2009 at 23:33.
Magici3n is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 10-13-2009 , 08:29   Re: get_stats
Reply With Quote #4

Use Ham_TraceAttack, check if TR_iHitrgoup is HIT_HEAD and count the headshots for every client, than format a string and send it as a MOTD message to the client.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Magici3n
BANNED
Join Date: Oct 2009
Location: Beautiful Beach
Old 10-13-2009 , 08:58   Re: get_stats
Reply With Quote #5

if(TR_iHitgroup == HIT_HEAD)

Showing error on compiling & how to count the headshots for every client and save in some variable
Magici3n is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-13-2009 , 12:23   Re: get_stats
Reply With Quote #6

Quote:
Originally Posted by Magici3n View Post
if(TR_iHitgroup == HIT_HEAD)

Showing error on compiling & how to count the headshots for every client and save in some variable
That's because TR_iHitgroup and HIT_HEAD are both constants. You need to retrieve the hit group using TR_iHitgroup.
__________________
fysiks is offline
Magici3n
BANNED
Join Date: Oct 2009
Location: Beautiful Beach
Old 10-13-2009 , 13:11   Re: get_stats
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
That's because TR_iHitgroup and HIT_HEAD are both constants. You need to retrieve the hit group using TR_iHitgroup.
how to retrieve the hit group using TR_iHitgroup &
how to store headshot counter in some variable
Magici3n is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-13-2009 , 13:45   Re: get_stats
Reply With Quote #8

http://forums.alliedmods.net/showthread.php?t=106265
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Magici3n
BANNED
Join Date: Oct 2009
Location: Beautiful Beach
Old 10-13-2009 , 14:09   Re: get_stats
Reply With Quote #9

I tried and made a code it is working

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

public plugin_init() 

    
register_plugin("HeadShot","0.1.0","Magici3n")
    
register_event"DeathMsg""Event_PlayerKilled""a""1>0""3=1" );
}

public 
Event_PlayerKilled () 

{   
   
ColorChat(0RED"HEADSHOT !!!"


But how to Store headshot in some variable and show in MOTD....
Magici3n is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-13-2009 , 14:15   Re: get_stats
Reply With Quote #10

Code:
#include < amxmodx > #include < cstrike > new g_iHeadShots[ 33 ]; public plugin_init( ) {     register_event( "DeathMsg", "EventDeathMsg", "a", "1>0", "3=1" ); } public client_disconnect( client ) {     g_iHeadShots[ client ] = 0; } public EventDeathMsg( ) {     new iKiller = read_data( 1 );     new iVictim = read_data( 2 );     if( is_user_connected( iKiller ) && iKiller != iVictim && cs_get_user_team( iKiller ) != cs_get_user_team( iVictim ) ) {         g_iHeadShots[ iKiller ]++;     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 22:41.


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