frag counter add hs

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
john007
Извън линия
Потребител
Потребител
Мнения: 2
Регистриран на: 03 Юли 2022, 16:14
Се отблагодари: 1 път

frag counter add hs

Мнение от john007 » 03 Юли 2022, 16:24

Hello, i want to add hs counter. Please
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 ] );
}

Аватар
TryAgain
Извън линия
Потребител
Потребител
Мнения: 182
Регистриран на: 25 Яну 2017, 16:59
Се отблагодари: 1 път
Получена благодарност: 26 пъти

frag counter add hs

Мнение от TryAgain » 03 Юли 2022, 19:20

Код за потвърждение: Избери целия код

/*
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 ][2]; // 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 ) {
	g_iFrags[ id ][0] = 0;g_iFrags[ id ][1] = 0; // This Resets Players Frag Count To 0 Only For HUD Does Not Affect ScoreBoard
}

public Event_DeathMsg( ) {
	new iKiller,iVictim,iHeadshot;
	iKiller = read_data( 1 );
	iVictim= read_data( 2 );
	iHeadshot = read_data( 3 );
	
	if( iVictim != iKiller && is_user_connected(iVictim) )
	{
		if(iHeadshot)
			g_iFrags[ iKiller ][1]++;
		else
			g_iFrags[ iKiller ][0]++; // 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 Hs %i", g_iFrags[ id ][0], g_iFrags[ id ][1] );
}

Аватар
john007
Извън линия
Потребител
Потребител
Мнения: 2
Регистриран на: 03 Юли 2022, 16:14
Се отблагодари: 1 път

frag counter add hs

Мнение от john007 » 03 Юли 2022, 21:01

TryAgain написа: 03 Юли 2022, 19:20

Код за потвърждение: Избери целия код

/*
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 ][2]; // 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 ) {
	g_iFrags[ id ][0] = 0;g_iFrags[ id ][1] = 0; // This Resets Players Frag Count To 0 Only For HUD Does Not Affect ScoreBoard
}

public Event_DeathMsg( ) {
	new iKiller,iVictim,iHeadshot;
	iKiller = read_data( 1 );
	iVictim= read_data( 2 );
	iHeadshot = read_data( 3 );
	
	if( iVictim != iKiller && is_user_connected(iVictim) )
	{
		if(iHeadshot)
			g_iFrags[ iKiller ][1]++;
		else
			g_iFrags[ iKiller ][0]++; // 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 Hs %i", g_iFrags[ id ][0], g_iFrags[ id ][1] );
}
Thank you.

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: Bing [Bot] и 8 госта