Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie
Modyfikacja

Przeróbka pluginu

Modyfikacja

  • Zamknięty Temat jest zamknięty
Brak odpowiedzi do tego tematu

#1 Karpielek

    Wszechpomocny

  • Użytkownik

Reputacja: 41
Pomocny

  • Postów:361
  • Lokalizacja:Zakopane
Offline

Napisano 10.02.2011 14:55

Witam,
Mam prośbę, aby ktoś przerobił mi poniższy plugin:

/* Plugin generated by AMXX-Studio */
/*			           */
/*	     WebSiteBot	           */
/*	      By Parker;           */
/*				   */
/*	CvarS;			   */
/* bw_botname "www.YourWebSite.com */
/* bw_kickbot "4"		   */			
/* bw_enable   "1"                  */
/*---------------------------------*/
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <xs>

#define PLUGIN "WebSiteBot"
#define VERSION "1.0"
#define AUTHOR "Parker;"

#define OFFSET_LINUX 5


new bw_botname
new bw_botnumber
new cvar_enable
new g_oldbotname[32]
new g_oldbotid
new g_teaminfo

enum (+= 1000)
{
	TASK_ID_BOTS
};

enum CS_Internal_Models 
{
	CS_DONTCHANGE = 0
}

enum CsTeams 
{
	CS_TEAM_UNASSIGNED = 0,
	CS_TEAM_T = 1,
	CS_TEAM_CT = 2,
	CS_TEAM_SPECTATOR = 3
};

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	bw_botname = register_cvar("bw_botname", "www.YourWebSite.com.ar")
	bw_botnumber = register_cvar("bw_kickbot", "4")
	cvar_enable = register_cvar("bw_enable", "1")
	set_task(5.0, "Createbot", TASK_ID_BOTS, _, _, "b")
	g_teaminfo = get_user_msgid("TeamInfo")
	
}
public Createbot()
{
	if( get_pcvar_num(cvar_enable) != 1 )
		return;
		
	new botname[32]
	get_pcvar_string(bw_botname, botname, 31)
	
	new id = find_player("ia", botname)
	
	new playersn = get_playersnum()

	if( !equali(botname, g_oldbotname) )
	{
		if( is_user_connected(g_oldbotid) && is_user_bot(g_oldbotid) )
		{
			set_user_info(g_oldbotid, "name", botname)
			return;
		}
	}
	
	
	if( playersn < get_pcvar_num(bw_botnumber) && !id )
	{
		g_oldbotid = id = engfunc(EngFunc_CreateFakeClient, botname)
		
		g_oldbotname = botname
		
		if( pev_valid( id ) )
		{
			engfunc( EngFunc_FreeEntPrivateData, id)
			dllfunc( MetaFunc_CallGameEntity, "player", id)
			set_user_info( id, "rate", "3500" )
			set_user_info( id, "cl_updaterate", "25" )
			set_user_info( id, "cl_lw", "1" )
			set_user_info( id, "cl_lc", "1" )
			set_user_info( id, "cl_dlmax", "128" )
			set_user_info( id, "cl_righthand", "1" )
			set_user_info( id, "_vgui_menus", "0" )
			set_user_info( id, "_ah", "0" )
			set_user_info( id, "dm", "0" )
			set_user_info( id, "tracker", "0" )
			set_user_info( id, "friends", "0" )
			set_user_info( id, "*bot", "0" )
			set_pev( id, pev_flags, pev( id, pev_flags ) | FL_FAKECLIENT )
			set_pev( id, pev_colormap, id )
			
			new msg[128]
			dllfunc( DLLFunc_ClientConnect, id, botname, "127.0.0.1", msg )
			dllfunc( DLLFunc_ClientPutInServer, id )
			engfunc( EngFunc_RunPlayerMove, id, Float:{0.0,0.0,0.0}, 0.0, 0.0, 0.0, 0, 0, 76 )
			
			fm_set_user_team(id, CS_TEAM_SPECTATOR);
			dllfunc(DLLFunc_Spawn, id)
		}
	}
	
	else if( playersn > get_pcvar_num(bw_botnumber) && id )
	{
		set_pev(id, pev_effects, pev(id, pev_effects) & ~EF_NODRAW)
		server_cmd( "kick #%d", get_user_userid(id) )
	}
	
	else if( id )
	{
		if( !is_user_alive(id) )
			dllfunc(DLLFunc_Spawn, id)
		
		set_pev(id, pev_effects, pev(id, pev_effects) & EF_NODRAW)
		set_pev(id, pev_solid, SOLID_NOT)
		set_pev(id, pev_takedamage, DAMAGE_NO)
		
		fix_score_team(id,"SPECTATOR")
		
	}
}

stock bool:bw_botis_valid(id)
{	
	return ( is_user_connected(g_oldbotid) && is_user_bot(g_oldbotid) && id == g_oldbotid )
}
stock fm_set_user_team(id, {CsTeams,_}:team, {CS_Internal_Models,_}:model = CS_DONTCHANGE)
{
	if( !is_user_connected(id) )
		return 0;
	
	set_pdata_int(id, 114, _:team, OFFSET_LINUX);

	if(model)
	{
		set_pdata_int( id, 126, _:model, OFFSET_LINUX);
	}

	dllfunc( DLLFunc_ClientUserInfoChanged, id, engfunc( EngFunc_GetInfoKeyBuffer, id ) );

	static const teams[] = { "UNASSIGNED", "TERRORIST", "CT", "SPECTATOR" };

	emessage_begin(MSG_BROADCAST, g_teaminfo);
	ewrite_byte(id);
	ewrite_string(teams[_:team]);
	emessage_end();
    
	return 1;

}

stock fix_score_team(id, const TEAM[])
{
	emessage_begin(MSG_BROADCAST, g_teaminfo);
	ewrite_byte(id);
	ewrite_string(TEAM);
	emessage_end();
}
stock bw_make_cvarexec(const config[])
{
	new f = fopen(config, "wt");
	new stringscvars[192]
	
	fprintf(f, "// Bot WebSite^n")
	fprintf(f, "// <img src='http://img.amxx.pl/public/style_emoticons/<#EMO_DIR#>/sleep.gif' class='bbc_emoticon' alt='-_-' />_<img src='http://img.amxx.pl/public/style_emoticons/<#EMO_DIR#>/sleep.gif' class='bbc_emoticon' alt='-_-' />_<img src='http://img.amxx.pl/public/style_emoticons/<#EMO_DIR#>/sleep.gif' class='bbc_emoticon' alt='-_-' />_-^n")
	get_pcvar_string(bw_botname, stringscvars, 191)
	fprintf(f, "bw_botname ^"%s^" // Bot name, Default( ^"www.YourWebSite.com.ar^" )^n", stringscvars)
	fprintf(f, "bw_kickbot %i // Number of Player to Kick the Bot^n", get_pcvar_num(bw_botnumber))
	fprintf(f, "^n")
	
	fclose(f);
	
	server_cmd("exec %s", config)
	server_exec()
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang11274\\ f0\\ fs16 \n\\ par }
*/



Plugin pokazuje bota w grze, w teamie TT, jednak kolor nicka ma szary jak spect, a nick ustalony cvarem.

Chciałbym tego "gracza" usunąć, aby w ogóle nie pokazywało go w grze. (ale żeby był na specu)

Pozdrawiam.

Dodano 10 luty 2011 - 18:01:
Przerobi ktoś? +
  • +
  • -
  • 0





Również z jednym lub większą ilością słów kluczowych: Modyfikacja

Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych