AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get_stats (https://forums.alliedmods.net/showthread.php?t=106185)

Magici3n 10-12-2009 06:34

get_stats
 
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....

dFF 10-12-2009 06:43

Re: get_stats
 
http://forums.alliedmods.net/showthread.php?p=710055 ?

Magici3n 10-12-2009 23:21

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

ot_207 10-13-2009 08:29

Re: get_stats
 
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.

Magici3n 10-13-2009 08:58

Re: get_stats
 
if(TR_iHitgroup == HIT_HEAD)

Showing error on compiling & how to count the headshots for every client and save in some variable

fysiks 10-13-2009 12:23

Re: get_stats
 
Quote:

Originally Posted by Magici3n (Post 960698)
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.

Magici3n 10-13-2009 13:11

Re: get_stats
 
Quote:

Originally Posted by fysiks (Post 960823)
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

Exolent[jNr] 10-13-2009 13:45

Re: get_stats
 
http://forums.alliedmods.net/showthread.php?t=106265

Magici3n 10-13-2009 14:09

Re: get_stats
 
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....

Exolent[jNr] 10-13-2009 14:15

Re: get_stats
 
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 ]++;     } }


All times are GMT -4. The time now is 22:40.

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