example: Frags: 2 Hs: 1
Код за потвърждение: Избери целия код
/*
Blizzards Plugins Comply With GNU General Public License
Frag Counter is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Under no circumstances are you allowed to redistribute and/or modify
it claming that you are the original author of such plugin/modification.
Frag Counter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include < amxmodx >
#include < amxmisc >
#include < hamsandwich >
#pragma semicolon 1
#define PLUGIN "Frag Counter"
#define VERSION "1.0"
#define AUTHOR "Blizzard"
new g_iFrags[ 33 ]; // This Holds Players Kill Count
public plugin_init( ) {
register_plugin( PLUGIN, VERSION, AUTHOR );
RegisterHam( Ham_Spawn, "player", "CBase_PlayerPre_Spawn", 0 );
register_event( "DeathMsg", "Event_DeathMsg", "a" );
}
public client_putinserver( id ) {
set_task( 0.9, "Frag_Hud", id, _, _, "b" ); // Sets The Loop Task For Hud
}
public CBase_PlayerPre_Spawn( id ) {
arrayset( g_iFrags, 0, sizeof( g_iFrags ) ); // This Resets Players Frag Count To 0 Only For HUD Does Not Affect ScoreBoard
}
public Event_DeathMsg( ) {
new iKiller = read_data( 1 );
new iVictim = read_data( 2 );
if( iVictim != iKiller ) {
g_iFrags[ iKiller ]++; // This Adds +1 To A Persons Frag Count For HUD
}
}
public Frag_Hud( id ) {
set_hudmessage(255, 255, 255, 0.01, 0.18, 0, 0.0, 1.0, 0.0, 0.0, -1 );
show_hudmessage(id, "Round Stats:^nFrags %i", g_iFrags[ id ] );
}