Cerere imbinare /dezbinare

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

User avatar
liviutz
Membru, skill +1
Membru, skill +1
Posts: 118
Joined: 26 Apr 2008, 15:22
Detinator Steam: Nu
Location: Bucuresti
Has thanked: 18 times
Been thanked: 4 times

17 Oct 2009, 11:29

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define HartiMaxime	5
#define ACCESS ADMIN_SLAY

new pcvar_Display;
new NumeHarti[HartiMaxime][34];

public plugin_init() 
{
	register_plugin("Multi-Plugin", "-", "-");
	register_clcmd("say /harti", "HartiJucateCuSay");
	register_clcmd("say_team /harti", "HartiJucateCuSay");
	register_clcmd("say /resetscore", "reset_score");
	register_clcmd("say_team /resetscore", "reset_score");
	register_clcmd("say /restart","say_restart",ACCESS)
	register_clcmd("say /spec","spec");
	register_clcmd("say_team /spec","spec");

	pcvar_Display = register_cvar("sv_rsdisplay", "0")
}

public plugin_cfg() 
{
	new FisierHartiJucate[64]
	
	get_localinfo("amxx_configsdir", FisierHartiJucate, 63)
	format(FisierHartiJucate, 63, "%s/hartianterioare.txt", FisierHartiJucate)

	new Fisier = fopen(FisierHartiJucate, "rt")
	new i
	new Temporar[34]
	if(Fisier)
	{
		for(i=0; i<HartiMaxime; i++)
		{
			if(!feof(Fisier))
			{
				fgets(Fisier, Temporar, 33)
				replace(Temporar, 33, "^n", "")
				formatex(NumeHarti, 33, Temporar)
			}
		}
		fclose(Fisier)
	}

	delete_file(FisierHartiJucate)

	new CurrentMap[34]
	get_mapname(CurrentMap, 33)

	Fisier = fopen(FisierHartiJucate, "wt")
	if(Fisier)
	{
		formatex(Temporar, 33, "%s^n", CurrentMap)
		fputs(Fisier, Temporar)
		for(i=0; i<HartiMaxime-1; i++)
		{
			CurrentMap = NumeHarti
			if(!CurrentMap[0])
				break
			formatex(Temporar, 33, "%s^n", CurrentMap)
			fputs(Fisier, Temporar)
		}
		fclose(Fisier)
	}
}

public HartiJucateCuSay(id) 
{
	new HartiAnterioare[192], n
	n += formatex(HartiAnterioare[n], 191-n, "Hartile jucate anterior sunt:")
	for(new i; i<HartiMaxime; i++)
	{
		if(!NumeHarti[0])
		{
			n += formatex(HartiAnterioare[n-1], 191-n+1, ".")
			break
		}
		n += formatex(HartiAnterioare[n], 191-n, " %s%s", NumeHarti, i+1 == HartiMaxime ? "." : ",")
	}
	client_print(id, print_chat, HartiAnterioare)
	return PLUGIN_CONTINUE
}

public reset_score(id)
{
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	
	if(get_pcvar_num(pcvar_Display) == 1)
	{
		new name[33]
		get_user_name(id, name, 32)
		client_print(0, print_chat, "%s si-a resetat scorul", name)
	}
	else
	{
		client_print(id, print_chat, "Ti-ai resetat scorul.")
	}
}

public say_restart(id) 
{
	if(!(get_user_flags(id) & ACCESS))
		return;
 
	server_cmd("sv_restart 1")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")

    
	set_hudmessage(255,150, 0, 0.04, 0.47, 0, 6.0, 7.0) 
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
}

public spec(id)
{
	user_silentkill(id)
	cs_set_user_team(id,CS_TEAM_SPECTATOR);
	return 1;
}


*As vrea sa scoateti de acolo pluginul acela cu /spec si sa adaugati pluginul : Show Admins (facut de anakin)
Va multumesc.

**Dau Multumesc celui care ma ajuta!
Last edited by TZACANEL on 17 Oct 2009, 11:29, edited 1 time in total.
Reason: [Sursa][/Sursa]
RoyalServer 2
User avatar
Ciprian
Fost administrator
Fost administrator
Posts: 5172
Joined: 10 May 2008, 21:29
Detinator Steam: Da
CS Status: ^^
SteamID: crazycipry
Reputatie: Fost administrator
Fost Scripter eXtreamCS
Fost Supervizor CS.eXtreamCS.com
Fost Unbanner ZM.eXtreamCS.com
Fost Contribuitor
Nume anterior: crazy.cipry
Location: Baia Mare
Has thanked: 177 times
Been thanked: 405 times

17 Oct 2009, 20:23

Mutat in Programare CS - Pluginuri!
User avatar
VaLDeS
Fost moderator
Fost moderator
Posts: 2776
Joined: 11 Feb 2008, 18:41
Detinator Steam: Da
CS Status: pe mari si oceane
SteamID: valdes93
Reputatie: Fost moderator
Fost Membru Club eXtreamCS (doua luni)
Location: România
Has thanked: 64 times
Been thanked: 103 times

17 Oct 2009, 20:26

Ca sa scoti pluginul /spec scoate
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define HartiMaxime	5
#define ACCESS ADMIN_SLAY

new pcvar_Display;
new NumeHarti[HartiMaxime][34];

public plugin_init() 
{
	register_plugin("Multi-Plugin", "-", "-");
	register_clcmd("say /harti", "HartiJucateCuSay");
	register_clcmd("say_team /harti", "HartiJucateCuSay");
	register_clcmd("say /resetscore", "reset_score");
	register_clcmd("say_team /resetscore", "reset_score");
	register_clcmd("say /restart","say_restart",ACCESS)
	register_clcmd("say /spec","spec");
	register_clcmd("say_team /spec","spec");

	pcvar_Display = register_cvar("sv_rsdisplay", "0")
}

public plugin_cfg() 
{
	new FisierHartiJucate[64]
	
	get_localinfo("amxx_configsdir", FisierHartiJucate, 63)
	format(FisierHartiJucate, 63, "%s/hartianterioare.txt", FisierHartiJucate)

	new Fisier = fopen(FisierHartiJucate, "rt")
	new i
	new Temporar[34]
	if(Fisier)
	{
		for(i=0; i<HartiMaxime; i++)
		{
			if(!feof(Fisier))
			{
				fgets(Fisier, Temporar, 33)
				replace(Temporar, 33, "^n", "")
				formatex(NumeHarti, 33, Temporar)
			}
		}
		fclose(Fisier)
	}

	delete_file(FisierHartiJucate)

	new CurrentMap[34]
	get_mapname(CurrentMap, 33)

	Fisier = fopen(FisierHartiJucate, "wt")
	if(Fisier)
	{
		formatex(Temporar, 33, "%s^n", CurrentMap)
		fputs(Fisier, Temporar)
		for(i=0; i<HartiMaxime-1; i++)
		{
			CurrentMap = NumeHarti
			if(!CurrentMap[0])
				break
			formatex(Temporar, 33, "%s^n", CurrentMap)
			fputs(Fisier, Temporar)
		}
		fclose(Fisier)
	}
}

public HartiJucateCuSay(id) 
{
	new HartiAnterioare[192], n
	n += formatex(HartiAnterioare[n], 191-n, "Hartile jucate anterior sunt:")
	for(new i; i<HartiMaxime; i++)
	{
		if(!NumeHarti[0])
		{
			n += formatex(HartiAnterioare[n-1], 191-n+1, ".")
			break
		}
		n += formatex(HartiAnterioare[n], 191-n, " %s%s", NumeHarti, i+1 == HartiMaxime ? "." : ",")
	}
	client_print(id, print_chat, HartiAnterioare)
	return PLUGIN_CONTINUE
}

public reset_score(id)
{
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	
	if(get_pcvar_num(pcvar_Display) == 1)
	{
		new name[33]
		get_user_name(id, name, 32)
		client_print(0, print_chat, "%s si-a resetat scorul", name)
	}
	else
	{
		client_print(id, print_chat, "Ti-ai resetat scorul.")
	}
}

public say_restart(id) 
{
	if(!(get_user_flags(id) & ACCESS))
		return;
 
	server_cmd("sv_restart 1")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")

    
	set_hudmessage(255,150, 0, 0.04, 0.47, 0, 6.0, 7.0) 
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
}

public spec(id)
{
	user_silentkill(id)
	cs_set_user_team(id,CS_TEAM_SPECTATOR);
	return 1;
}
Image

STEAM ID : valdes93 :flag_ro:
User avatar
liviutz
Membru, skill +1
Membru, skill +1
Posts: 118
Joined: 26 Apr 2008, 15:22
Detinator Steam: Nu
Location: Bucuresti
Has thanked: 18 times
Been thanked: 4 times

17 Oct 2009, 21:12

mersi , dar sa adaug?
User avatar
VaLDeS
Fost moderator
Fost moderator
Posts: 2776
Joined: 11 Feb 2008, 18:41
Detinator Steam: Da
CS Status: pe mari si oceane
SteamID: valdes93
Reputatie: Fost moderator
Fost Membru Club eXtreamCS (doua luni)
Location: România
Has thanked: 64 times
Been thanked: 103 times

17 Oct 2009, 21:15

posteaza .sma de la aNNakiN si ti-l fac eu :P !
Image

STEAM ID : valdes93 :flag_ro:
User avatar
liviutz
Membru, skill +1
Membru, skill +1
Posts: 118
Joined: 26 Apr 2008, 15:22
Detinator Steam: Nu
Location: Bucuresti
Has thanked: 18 times
Been thanked: 4 times

17 Oct 2009, 21:18

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Show Admins"
#define VERSION "1.0"
#define AUTHOR "anakin_cstrike"

new g_msgsaytext, g_maxplayers;

public plugin_init() 
{
	register_plugin( PLUGIN, VERSION, AUTHOR )
	
	register_clcmd( "say /admins", "admins_cmd" );
	register_clcmd( "say_team /admins", "admins_cmd" );
	
	g_msgsaytext = get_user_msgid("SayText");
	g_maxplayers = get_maxplayers();
}

public admins_cmd( id )
{
	new name[ 32 ], all_names[ sizeof( name ) * 32 ], i;
	
	for( i = 1; i <= g_maxplayers; i++ )
	{
		if( !is_user_connected( i ) )
			continue;
		if( ! ( get_user_flags( i ) & ADMIN_KICK ) )
			continue;
			
		get_user_name( i ,name, sizeof name  - 1 );
		
		if( all_names[ 0 ] )
			format( all_names, sizeof all_names  - 1, "%s, %s", all_names, name );
		else
			copy( all_names, sizeof all_names  - 1, name);
	}
	
	print( id, "Admins online: %s", all_names );
	
	return 0;
}

print( index, const message[ ], { Float, Sql, Result, _ }:... )
{
	new Buffer[ 128 ],Buffer2[ 128 ];
	formatex( Buffer2, sizeof Buffer2 - 1, "%s",message );
	vformat( Buffer, sizeof Buffer - 1, Buffer2, 3 );
	
	if( !is_user_connected( index ) ) 
		return 0;
	
	message_begin( MSG_ONE, g_msgsaytext, _, index );
	write_byte( index );
	write_string( Buffer );
	message_end( );
	
	return 1;
}
User avatar
VaLDeS
Fost moderator
Fost moderator
Posts: 2776
Joined: 11 Feb 2008, 18:41
Detinator Steam: Da
CS Status: pe mari si oceane
SteamID: valdes93
Reputatie: Fost moderator
Fost Membru Club eXtreamCS (doua luni)
Location: România
Has thanked: 64 times
Been thanked: 103 times

17 Oct 2009, 21:25

Poftim : http://www.amxmodx.org/webcompiler.cgi?go=dl&id=662244

sau

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define HartiMaxime	5
#define ACCESS ADMIN_SLAY

new pcvar_Display;
new NumeHarti[HartiMaxime][34];
new g_msgsaytext, g_maxplayers;

public plugin_init() 
{
	register_plugin("Multi-Plugin", "-", "-");
	register_clcmd("say /harti", "HartiJucateCuSay");
	register_clcmd("say_team /harti", "HartiJucateCuSay");
	register_clcmd("say /resetscore", "reset_score");
	register_clcmd("say_team /resetscore", "reset_score");
	register_clcmd("say /restart","say_restart",ACCESS)
	register_clcmd( "say /admins", "admins_cmd" );
	register_clcmd( "say_team /admins", "admins_cmd" );


	g_msgsaytext = get_user_msgid("SayText");
	g_maxplayers = get_maxplayers();

	pcvar_Display = register_cvar("sv_rsdisplay", "0")
}

public plugin_cfg() 
{
	new FisierHartiJucate[64]
	
	get_localinfo("amxx_configsdir", FisierHartiJucate, 63)
	format(FisierHartiJucate, 63, "%s/hartianterioare.txt", FisierHartiJucate)

	new Fisier = fopen(FisierHartiJucate, "rt")
	new i
	new Temporar[34]
	if(Fisier)
	{
		for(i=0; i<HartiMaxime; i++)
		{
			if(!feof(Fisier))
			{
				fgets(Fisier, Temporar, 33)
				replace(Temporar, 33, "^n", "")
				formatex(NumeHarti, 33, Temporar)
			}
		}
		fclose(Fisier)
	}

	delete_file(FisierHartiJucate)

	new CurrentMap[34]
	get_mapname(CurrentMap, 33)

	Fisier = fopen(FisierHartiJucate, "wt")
	if(Fisier)
	{
		formatex(Temporar, 33, "%s^n", CurrentMap)
		fputs(Fisier, Temporar)
		for(i=0; i<HartiMaxime-1; i++)
		{
			CurrentMap = NumeHarti
			if(!CurrentMap[0])
				break
			formatex(Temporar, 33, "%s^n", CurrentMap)
			fputs(Fisier, Temporar)
		}
		fclose(Fisier)
	}
}

public HartiJucateCuSay(id) 
{
	new HartiAnterioare[192], n
	n += formatex(HartiAnterioare[n], 191-n, "Hartile jucate anterior sunt:")
	for(new i; i<HartiMaxime; i++)
	{
		if(!NumeHarti[0])
		{
			n += formatex(HartiAnterioare[n-1], 191-n+1, ".")
			break
		}
		n += formatex(HartiAnterioare[n], 191-n, " %s%s", NumeHarti, i+1 == HartiMaxime ? "." : ",")
	}
	client_print(id, print_chat, HartiAnterioare)
	return PLUGIN_CONTINUE
}

public reset_score(id)
{
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	
	if(get_pcvar_num(pcvar_Display) == 1)
	{
		new name[33]
		get_user_name(id, name, 32)
		client_print(0, print_chat, "%s si-a resetat scorul", name)
	}
	else
	{
		client_print(id, print_chat, "Ti-ai resetat scorul.")
	}
}

public say_restart(id) 
{
	if(!(get_user_flags(id) & ACCESS))
		return 0;
 
	server_cmd("sv_restart 1")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")

    
	set_hudmessage(255,150, 0, 0.04, 0.47, 0, 6.0, 7.0) 
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
}
public admins_cmd( id )
{
	new name[ 32 ], all_names[ sizeof( name ) * 32 ], i;
	
	for( i = 1; i <= g_maxplayers; i++ )
	{
		if( !is_user_connected( i ) )
			continue;
		if( ! ( get_user_flags( i ) & ADMIN_KICK ) )
			continue;
			
		get_user_name( i ,name, sizeof name  - 1 );
		
		if( all_names[ 0 ] )
			format( all_names, sizeof all_names  - 1, "%s, %s", all_names, name );
		else
			copy( all_names, sizeof all_names  - 1, name);
	}
	
	print( id, "Admins online: %s", all_names );
	
	return 1;
}

print( index, const message[ ], { Float, Sql, Result, _ }:... )
{
	new Buffer[ 128 ],Buffer2[ 128 ];
	formatex( Buffer2, sizeof Buffer2 - 1, "%s",message );
	vformat( Buffer, sizeof Buffer - 1, Buffer2, 3 );
	
	if( !is_user_connected( index ) ) 
		return 2;
	
	message_begin( MSG_ONE, g_msgsaytext, _, index );
	write_byte( index );
	write_string( Buffer );
	message_end( );
	
	return 3;
}
Image

STEAM ID : valdes93 :flag_ro:
User avatar
liviutz
Membru, skill +1
Membru, skill +1
Posts: 118
Joined: 26 Apr 2008, 15:22
Detinator Steam: Nu
Location: Bucuresti
Has thanked: 18 times
Been thanked: 4 times

17 Oct 2009, 21:25

da-mi si sma te rog ...
EDIT:scuze , n-am vazut
User avatar
VaLDeS
Fost moderator
Fost moderator
Posts: 2776
Joined: 11 Feb 2008, 18:41
Detinator Steam: Da
CS Status: pe mari si oceane
SteamID: valdes93
Reputatie: Fost moderator
Fost Membru Club eXtreamCS (doua luni)
Location: România
Has thanked: 64 times
Been thanked: 103 times

17 Oct 2009, 21:26

liviutz wrote:da-mi si sma te rog ...
am dat EDIT :D
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define HartiMaxime	5
#define ACCESS ADMIN_SLAY

new pcvar_Display;
new NumeHarti[HartiMaxime][34];
new g_msgsaytext, g_maxplayers;

public plugin_init() 
{
	register_plugin("Multi-Plugin", "-", "-");
	register_clcmd("say /harti", "HartiJucateCuSay");
	register_clcmd("say_team /harti", "HartiJucateCuSay");
	register_clcmd("say /resetscore", "reset_score");
	register_clcmd("say_team /resetscore", "reset_score");
	register_clcmd("say /restart","say_restart",ACCESS)
	register_clcmd( "say /admins", "admins_cmd" );
	register_clcmd( "say_team /admins", "admins_cmd" );


	g_msgsaytext = get_user_msgid("SayText");
	g_maxplayers = get_maxplayers();

	pcvar_Display = register_cvar("sv_rsdisplay", "0")
}

public plugin_cfg() 
{
	new FisierHartiJucate[64]
	
	get_localinfo("amxx_configsdir", FisierHartiJucate, 63)
	format(FisierHartiJucate, 63, "%s/hartianterioare.txt", FisierHartiJucate)

	new Fisier = fopen(FisierHartiJucate, "rt")
	new i
	new Temporar[34]
	if(Fisier)
	{
		for(i=0; i<HartiMaxime; i++)
		{
			if(!feof(Fisier))
			{
				fgets(Fisier, Temporar, 33)
				replace(Temporar, 33, "^n", "")
				formatex(NumeHarti, 33, Temporar)
			}
		}
		fclose(Fisier)
	}

	delete_file(FisierHartiJucate)

	new CurrentMap[34]
	get_mapname(CurrentMap, 33)

	Fisier = fopen(FisierHartiJucate, "wt")
	if(Fisier)
	{
		formatex(Temporar, 33, "%s^n", CurrentMap)
		fputs(Fisier, Temporar)
		for(i=0; i<HartiMaxime-1; i++)
		{
			CurrentMap = NumeHarti
			if(!CurrentMap[0])
				break
			formatex(Temporar, 33, "%s^n", CurrentMap)
			fputs(Fisier, Temporar)
		}
		fclose(Fisier)
	}
}

public HartiJucateCuSay(id) 
{
	new HartiAnterioare[192], n
	n += formatex(HartiAnterioare[n], 191-n, "Hartile jucate anterior sunt:")
	for(new i; i<HartiMaxime; i++)
	{
		if(!NumeHarti[0])
		{
			n += formatex(HartiAnterioare[n-1], 191-n+1, ".")
			break
		}
		n += formatex(HartiAnterioare[n], 191-n, " %s%s", NumeHarti, i+1 == HartiMaxime ? "." : ",")
	}
	client_print(id, print_chat, HartiAnterioare)
	return PLUGIN_CONTINUE
}

public reset_score(id)
{
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	
	if(get_pcvar_num(pcvar_Display) == 1)
	{
		new name[33]
		get_user_name(id, name, 32)
		client_print(0, print_chat, "%s si-a resetat scorul", name)
	}
	else
	{
		client_print(id, print_chat, "Ti-ai resetat scorul.")
	}
}

public say_restart(id) 
{
	if(!(get_user_flags(id) & ACCESS))
		return 0;
 
	server_cmd("sv_restart 1")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")
	client_print(0, print_chat, "Restart !! Live !! GL&HF !!")

    
	set_hudmessage(255,150, 0, 0.04, 0.47, 0, 6.0, 7.0) 
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
	show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
}
public admins_cmd( id )
{
	new name[ 32 ], all_names[ sizeof( name ) * 32 ], i;
	
	for( i = 1; i <= g_maxplayers; i++ )
	{
		if( !is_user_connected( i ) )
			continue;
		if( ! ( get_user_flags( i ) & ADMIN_KICK ) )
			continue;
			
		get_user_name( i ,name, sizeof name  - 1 );
		
		if( all_names[ 0 ] )
			format( all_names, sizeof all_names  - 1, "%s, %s", all_names, name );
		else
			copy( all_names, sizeof all_names  - 1, name);
	}
	
	print( id, "Admins online: %s", all_names );
	
	return 1;
}

print( index, const message[ ], { Float, Sql, Result, _ }:... )
{
	new Buffer[ 128 ],Buffer2[ 128 ];
	formatex( Buffer2, sizeof Buffer2 - 1, "%s",message );
	vformat( Buffer, sizeof Buffer - 1, Buffer2, 3 );
	
	if( !is_user_connected( index ) ) 
		return 2;
	
	message_begin( MSG_ONE, g_msgsaytext, _, index );
	write_byte( index );
	write_string( Buffer );
	message_end( );
	
	return 3;
}
Image

STEAM ID : valdes93 :flag_ro:
User avatar
liviutz
Membru, skill +1
Membru, skill +1
Posts: 118
Joined: 26 Apr 2008, 15:22
Detinator Steam: Nu
Location: Bucuresti
Has thanked: 18 times
Been thanked: 4 times

17 Oct 2009, 21:31

Add: liviu_x_10 ca mai as avea nevoie de ceva ...
User avatar
VaLDeS
Fost moderator
Fost moderator
Posts: 2776
Joined: 11 Feb 2008, 18:41
Detinator Steam: Da
CS Status: pe mari si oceane
SteamID: valdes93
Reputatie: Fost moderator
Fost Membru Club eXtreamCS (doua luni)
Location: România
Has thanked: 64 times
Been thanked: 103 times

17 Oct 2009, 21:32

zi aici de ce ai nevoie ! :D
sau imi iei id din semnatura !
Image

STEAM ID : valdes93 :flag_ro:
User avatar
liviutz
Membru, skill +1
Membru, skill +1
Posts: 118
Joined: 26 Apr 2008, 15:22
Detinator Steam: Nu
Location: Bucuresti
Has thanked: 18 times
Been thanked: 4 times

17 Oct 2009, 21:37

hai pe mess ca ti-am dat add

EDIT :
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
	register_plugin("new_adminfix", "1.0", "mut2nt")

	set_task(30.0, "auto_reload", _, _, _,"b")
	register_cvar("autorealoadadmins_by_mut2nt", "1.0", FCVAR_SERVER)
}

public auto_reload() 
{ 
	server_cmd("amx_reloadadmins")
	server_cmd("echo Autoreload is activated at every 30 sec")
	return 1
}
si
| Afiseaza codul
#include <amxmodx>
#include <engine>
#include <cstrike>

#if AMXX_VERSION_NUM < 180
	#assert AMX Mod X v.1.8.0 or newer is required to compile Anti Host Error (AHE) !
#endif

#define REQUIRED_PLAYERS	2
#define TIME_INTERVAL		0.2
#define PLAYERS_TO_KEEP		8

#define ENTITIES_TO_KILL	32

#define CONNECT_TIME		2.0
#define MAX_PLAYERS_JOIN	4
#define CUSTOM_HOSTNAME		0
#define USE_ALTERNATIVE_CONFIG	1
#define LAN_SERVER		0
#define IPX_SUPPORT		0
#define IP_v4_SUPPORT		0
#define BLOCK_CL_ALIAS		1

#define AHE_Start		plugin_init
#define AHE_Modules		plugin_modules
#define AHE_ClientConnected	client_putinserver
#define AHE_ClientAuthentified	client_authorized
#define AHE_ClientDropped	client_disconnect
#define AHE_End			plugin_end

new PLUGIN [/* PLUGIN NAME */] = "Anti Host Error";
new AUTHOR [/* PLUGIN AUTHOR */] = "eXtreamCS #Dan";
new VERSION [/* PLUGIN VERSION */] = "1.0";
new CVAR [/* VERSION CVAR STRING */] = "anti_hosterror";

#if CUSTOM_HOSTNAME==1
	new HOSTNAME [/* SERVER NAME */] = "";
#endif

#if IP_v4_SUPPORT==1
	new IP [/* IP v4 SUPPORT (XXX.XXX.XXX.XXX) */] = "";
	new IP_CLIENTPORT [/* IP v4 SUPPORT (:27005) */] = "";
	new IP_HOSTPORT [/* IP v4 SUPPORT (:27015) */] = "";
#endif

#if IPX_SUPPORT==1
	new IPX_CLIENTPORT [/* IPX SUPPORT */] = "";
	new IPX_HOSTPORT [/* IPX SUPPORT */] = "";
#endif

new /*CURRENT_PLAYERS,*/ CURRENT_TEAM, MAX_PLAYERS, PLAYERS_COUNT, PLAYERS_KEEP;
new MAX_ENTITIES, ENTITY_TO_DELETE, CSTRIKE_RUNNING;
new HLTV_START, ENTITY_DESTROYER, Float:HLTV_END;
new CONNECT_NUM, Float:CONNECT_T;
new CLIENT_PUT_IN_SERVER [/* Console */] = "* Anti Host Error will might change your configuration settings during game-play!";
new HLTV_START_MESSAGE [/* Chat */] = "* Anti Host Error is currently working on.";
new FAILED_LOAD_MODULES [/* Server */] = "* Anti Host Error is disabled. Check AMXX's modules file and folder!";
new SPEC [ 16 ]

/*

 Anti Game / Host Error: SVC_BAD
 http://developer.valvesoftware.com/wiki/NS_Variables
 Server failed to transmit some messages
 See more further information by running "cl_messages" command through console
 
*/

stock const AHE_Exec [][] = {
	"sys_ticrate ^"1000^"",
	"mp_decals ^"300^"",
	"mp_dlmax ^"800^"",
	"sv_resend ^"6^"",
	"mp_updaterate ^"80^"",
	"sv_cmdbackup ^"6^"",
	"sv_cmdrate ^"80^"",
	"sv_rate ^"20000^"",
	"rate ^"20000^"",
	"sv_maxunlag ^"1^"",
	"sv_unlag ^"1^"",
	"host_framerate ^"0^"",
	"edgefriction ^"2^"",
	"decalfrequency ^"60^"",
	"sv_maxupdaterate ^"101^"",
	"sv_maxspeed ^"320^"",
	"sv_maxrate ^"7000^"",
	"sv_allowupload ^"1^"",
	"sv_clienttrace ^"1.0^"",
	"sv_allowdownload ^1^"",
	"sv_airaccelerate ^"10^"",
	"sv_airmove ^"1^"",
	"sv_timeout ^"22^"",
	"mp_consistency ^"1^"",
	#if LAN_SERVER==1
		"sv_lan ^"1^"",
	#else
		"sv_lan ^"0^"",
	#endif
	#if BLOCK_CL_ALIAS==1
		"alias ^"alias^"",
	#endif
	"sv_region ^"3^""
};

/*

 Anti Reliable channel overflow
 You have been disconnected from server. Reason: Reliable channel overflow.
 http://supportwiki.steampowered.com/ro/ ... l_Overflow
 
*/

stock const Player_Exec [][] = {
	"cl_updaterate ^"20^"",
	"cl_cmdrate ^"30^"",
	"rate ^"7500^"",
	"cl_fixtimerate ^"7500^"",
	"cl_cmdbackup ^"2^"",
	"cl_rate ^"9999^"",
	"cl_resend ^"6.0^"",
	"fps_max ^"201^"",
	"sys_ticrate ^"100^"",
	"developer ^"0^"",
	"cl_timeout ^"35^"",
	"ex_interp ^"0.100^"",
	"ex_extrapmax ^"1.200^"",
	"ex_maxerrordistance ^"64^"",
	"cl_dlmax ^"128^"",
	"cl_smoothtime ^"0.1^"",
	#if USE_ALTERNATIVE_CONFIG==1
		"cl_cmdrate ^"65^"",
		"cl_updaterate ^"30^"",
		"ex_extrapmax ^"1.2^"",
		"cl_cmdbackup ^"2^"",
		"rate ^"15000^"",
		"ex_interp ^"0.05^"",
	#endif
	"cl_nosmooth ^"0^""
};

/*

 Registering the plugin
 Setting plugin's version
 Tweaking a little bit the configuration for IP / Port address
 Registering the important events
 
*/

#if defined AHE_Start
public AHE_Start ( )
#else
public plugin_init ( )
#endif
{
	register_plugin ( PLUGIN , VERSION , AUTHOR )
	register_cvar ( CVAR , VERSION , FCVAR_SERVER & FCVAR_UNLOGGED & FCVAR_SPONLY )
	set_cvar_string ( CVAR , VERSION )
	server_cmd ( "alias ^"%s^"" , CVAR )
	
	#if CUSTOM_HOSTNAME !=0
		// server_cmd("hostname ^"^"")
	#else
		#if CUSTOM_HOSTNAME==1
			set_cvar_string ( "hostname" , SERVER ) 
		#endif
	#endif

	#if IP_v4_SUPPORT !=0
		// server_cmd("ip ^"^"")
		// server_cmd("ip_hostport ^"^"")
		// server_cmd("ip_clientport ^"^"")
	#else
		#if IP_v4_SUPPORT==1
			set_cvar_string ( "ip" , IP )
			set_cvar_string ( "ip_hostport" , IP_HOSTPORT )
			set_cvar_string ( "ip_clientport" , IP_CLIENTPORT )
		#endif
	#endif
	
	#if IPX_SUPPORT !=0
		// set_cvar_num("ipx_hostport", 0)
		// set_cvar_num("ipx_clientport", 0)
	#else
		#if IPX_SUPPORT==1
			set_cvar_string ( "ipx_hostport" , IPX_HOSTPORT )
			set_cvar_string ( "ipx_clientport" , IPX_CLIENTPORT )
		#endif
	#endif
	
	register_event ( "HLTV" , "AHE_NewRound" , "a" , "1=0" , "2=0" )
	// register_event ( "GameStatus" , "AHE_EndRound" , "ab" , "1=2" )
	register_event ( "SendAudio" , "AHE_EndRound" , "a" , "2&%!MRAD_terwin" )
	register_event ( "SendAudio" , "AHE_EndRound" , "a" , "2&%!MRAD_ctwin" ) 
	register_event ( "CurWeapon" , "AHE_NewRound" , "be" , "1=1", "2!29" )
	register_event ( "TextMsg" , "AHE_NewRound" , "a" , "2&#Game_will_restart_in" )
	register_event ( "TextMsg" , "AHE_NewRound" , "a" , "2&#Game_Commencing" )
	register_message ( get_user_msgid("Health") , "AHE_NewRound" )
	
	/* If flag is specified as 1, players connecting are also returned. */
	
	// CURRENT_PLAYERS = get_playersnum()
	MAX_PLAYERS = get_maxplayers ( )
	MAX_ENTITIES = get_global_int ( GL_maxEntities )
	CSTRIKE_RUNNING = get_modname ( "cstrike" , 7 )
	CURRENT_TEAM = get_user_msgid ( "TeamInfo" )

	copy ( SPEC , 15 , "SPECTATOR" ) 
	set_msg_block ( 49 , BLOCK_SET )
	
	return PLUGIN_CONTINUE

}

/*

 Checking, veryfing the AMXX modules
 This modules should be loaded automatically without any execution, ...
 ... but to ensure that the AHE can run it will require again.
 
*/

#if defined AHE_Modules
public AHE_Modules ( ) 
#else
public plugin_modules ( )
#endif
{
	if ( !require_module ( "engine" ) && require_module ( "cstrike" ) ) {
		server_print ( "%s" , FAILED_LOAD_MODULES )
		return PLUGIN_HANDLED_MAIN
	}
	else if ( is_module_loaded ( "engine" ) != -1 && is_module_loaded ( "cstrike" ) != -1 ) return false

	return PLUGIN_CONTINUE
	
}

/*

 This is an event important.
 When a player is joining into server, some tasks will begin to him ...
 ...in "background" (silently).
 
*/

#if defined AHE_ClientConnected
public AHE_ClientConnected ( id )
#else
public client_putinserver ( id )
#endif
{
	for ( new i = 0 ; i <= MAX_PLAYERS ; i++ ) 
	{
		client_print ( i , print_console , "%s" , CLIENT_PUT_IN_SERVER )
		
		if ( is_user_connected ( id ) && cs_get_user_team ( id ) == CS_TEAM_SPECTATOR ) 
			return PLUGIN_HANDLED
		else if ( is_user_connected ( i ) ) {// && is_user_alive(id)
			if ( cs_get_user_team ( i ) == CS_TEAM_CT
			|| cs_get_user_team ( i ) == CS_TEAM_T 
			|| cs_get_user_team ( i ) == CS_TEAM_UNASSIGNED ) 
			{
				set_task ( 31.5 , "AHE_DisplayMessage" , i )
				return PLUGIN_CONTINUE
			}
		}
	}
		
	if ( !entity_get_int ( id , EV_INT_team ) )
		return PLUGIN_CONTINUE
	
	if ( get_gametime() - CONNECT_TIME > CONNECT_T )
		CONNECT_NUM = 0
	
	if ( CONNECT_NUM < MAX_PLAYERS_JOIN )
	{
		++CONNECT_NUM
		if ( CONNECT_NUM == 1 )
			CONNECT_T = get_gametime()
	}
	else
		return PLUGIN_HANDLED
	
	return PLUGIN_CONTINUE
}

#if defined AHE_ClientAuthentified
public AHE_ClientAuthentified ( id )
#else
public client_authorized ( id )
#endif
{
	if ( is_user_connecting ( id ) )
	{
		message_begin ( MSG_ALL , CURRENT_TEAM ) 
		write_byte ( id ) 
		write_string ( SPEC ) 
		message_end ( ) 

		// ++MAX_PLAYERS
	} 
	
	return PLUGIN_CONTINUE
	
}

#if defined AHE_ClientDropped
public AHE_ClientDropped ( id )
#else
public client_disconnect ( id )
#endif
{
	if ( !is_user_connected ( id ) && ~task_exists ( id ) ) {
		
		remove_task ( id )
		
		return PLUGIN_HANDLED
		
		// --MAX_PLAYERS
	}
	
	return PLUGIN_CONTINUE

}

public AHE_EndRound ( )
{
	if ( !HLTV_START )
		return
	
	new PLAYERS_NUM = get_playersnum ( )
	
	CONNECT_NUM = 0
	CONNECT_T = get_gametime ( ) - CONNECT_TIME
	HLTV_START = 0
	HLTV_END = get_gametime ( )
	
	for ( new server ; server < sizeof AHE_Exec ; server++ )
		server_cmd ( AHE_Exec [ server ] )
		
	for ( new ID = 0 ; /*ID < CURRENT_PLAYERS ;*/ ID < sizeof Player_Exec ; ID++ ) 
		client_cmd ( ID , Player_Exec [ ID ] )
	
	if ( !PLAYERS_KEEP && PLAYERS_NUM >= REQUIRED_PLAYERS )
		set_task ( 5.9 - ( ( floatround ( float ( PLAYERS_NUM ) / float ( PLAYERS_TO_KEEP ) , floatround_ceil) - 1 ) * TIME_INTERVAL ) , "AHE_KeepPlayers" , 100 )
	
	if ( !ENTITY_TO_DELETE )
	{
		ENTITY_TO_DELETE = MAX_PLAYERS + 1
		ENTITY_DESTROYER = AHE_Target ( )
		AHE_KillEntities ( )
	}
	
	set_task ( 6.0 , "AHE_BackupTime" , 300 )

}

public AHE_NewRound ( msgid , dest , id )
{
	HLTV_START = 1
	
	PLAYERS_KEEP = 0
	PLAYERS_COUNT = 0
	
	ENTITY_TO_DELETE = 0
	
	if ( !is_user_alive ( id ) )
		return PLUGIN_CONTINUE
	
	static health
	health = get_msg_arg_int ( 1 )
	
	if ( health > 255 && ( health % 256 ) == 0 )
		set_msg_arg_int ( 1 , ARG_BYTE , ++health )
	
	set_cvar_num ( "sv_restart" , 0 )
	set_cvar_num ( "sv_restartround" , 0 )
	
	return PLUGIN_CONTINUE
	
}

public AHE_KeepPlayers ( )
{
	for ( new id = PLAYERS_KEEP + 1; id <= MAX_PLAYERS; ++id )
	{
		if ( is_user_connected ( id ) )
		{
			PLAYERS_COUNT++
			client_cmd ( id , "impulse 201" )
		}
		
		if ( PLAYERS_COUNT % PLAYERS_TO_KEEP == 0 )
			break
		
		PLAYERS_KEEP++
	}
	
	if ( PLAYERS_KEEP == MAX_PLAYERS )
	{
		PLAYERS_KEEP = 0
		PLAYERS_COUNT = 0
	}
	
	else if ( get_gametime() - HLTV_END <= 7.0 )
		set_task ( TIME_INTERVAL , "AHE_KeepPlayers" , 100 )
		
	return PLUGIN_CONTINUE

}

public AHE_KillEntities ( )
{
	if ( !is_valid_ent ( ENTITY_DESTROYER ) )
		return
	
	for ( new ENTITY_COUNT; ENTITY_TO_DELETE <= MAX_ENTITIES; ++ENTITY_TO_DELETE )
	{
		if ( !is_valid_ent ( ENTITY_TO_DELETE ) )
			continue
		
		new IUSER3 = entity_get_int ( ENTITY_TO_DELETE , EV_INT_iuser3 )
		
		if ( ( IUSER3 == 15 && entity_get_edict ( ENTITY_TO_DELETE , EV_ENT_owner ) == 0 )
			|| 24 <= IUSER3 <= 34
			|| IUSER3 == 37
			|| 41 <= IUSER3 <= 45
			|| 47 <= IUSER3 <= 49
			|| IUSER3 == 57 )
		{
			if ( ( CSTRIKE_RUNNING &&
				( IUSER3 == 25 || IUSER3 == 26 ) ) )
					continue
			
			ENTITY_COUNT++
			fake_touch ( ENTITY_DESTROYER , ENTITY_TO_DELETE )
			remove_entity ( ENTITY_TO_DELETE )
		}
		
		else
			continue
		
		if ( ENTITY_COUNT == ENTITIES_TO_KILL  )
			break
	}
	
	if ( get_gametime() - HLTV_END <= 7.0
		|| ENTITY_TO_DELETE != MAX_ENTITIES )
		set_task( 0.3 , "AHE_KillEntities" , 200 )
	else
	{
		ENTITY_TO_DELETE = 0
		remove_entity ( ENTITY_DESTROYER )
	}

}

public AHE_BackupTime ( )
{
	remove_task ( 100 )
	remove_task ( 200 )
	
	return PLUGIN_HANDLED

}

public AHE_DisplayMessage ( id )
{
	if ( is_user_alive ( id ) ) 
	{
		client_print ( id , print_chat , HLTV_START_MESSAGE )
		
		return PLUGIN_HANDLED
		
	}
	
	return PLUGIN_CONTINUE

}

public AHE_Target ( )
{
	new TARGET = create_entity ( "trigger_hurt" )
	DispatchKeyValue ( TARGET , "classname" , "trigger_hurt" )
	DispatchKeyValue ( TARGET , "dmg" , "19999" )
	DispatchKeyValue ( TARGET , "damagetype" , "0" )
	DispatchKeyValue ( TARGET , "origin" , "8192 8192 8192" )
	DispatchSpawn ( TARGET )
	entity_set_string( TARGET , EV_SZ_classname , "trigger_hurt" )
	
	return TARGET
}

#if defined AHE_End
public AHE_End ( )
#else
public plugin_end ( )
#endif
{
	if ( is_plugin_loaded ( "antiflood" ) == 1 && is_plugin_loaded ( "imessage" ) == 1 ) 
	{
		set_cvar_float ( "amx_flood_time" , 1.00 )
		set_cvar_num ( "amx_freq_imessage" , 120 )
		
		return PLUGIN_HANDLED
	}
	
	return PLUGIN_CONTINUE

}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
si astea imbinale te rog ...
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests