Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

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
Zombie Mod

/kapitan

zombie mod

  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Burek

    Początkujący

  • Użytkownik

Reputacja: 3
Nowy

  • Postów:10
  • Imię:Denis
  • Lokalizacja:Łowkowice
Offline

Napisano 06.11.2011 11:49

Siema !
Mam Zombie Hell moda i szukam pluginu /kapitan żeby była jedna osoba z ct kapitanem czyli dopóki ona by żyła inni ct się odradzają.
Bardzo proszę o pomoc

Dobra znalazłem ;)

Jakby ktoś potrzebował ;)

SMA:

/*
	# Plugin:
		# Guardian based on Gears of War 2, a game type which
		add a team leader to your team who is the guardian. As
		long the team leader is alive other player will be
		respawned. The Guardian spawn with 200hp, 200ap and
		glowing the same colour as the team. A status icon will
		also indicate when you are the guardian. The team mates
		have to protect him or her while some has to attack the
		other guardian to win.
	-------------------------------------------------------------------
	# Development Team:
		# XzaR - Lead scripter
	-------------------------------------------------------------------
	# Special Thanks:
		# Crazyeffect - Added multilingual support
	-------------------------------------------------------------------
	# Changelog:
		# Version 1.0
		  - First release
		# Version 1.1
		  - Removed Log Events
		  - Changed some Events to Ham Events
		  - Fixed Team Change bug
		  - Added Guardian Kill Notice as HUD
		# Version 1.2
		  - Multilingual support
		  - CS VIP support
		# Version 1.21
		  - Fixed Multilingual
		# Version 1.22
		  - Small optimization
		# Version 1.23
		  - Small Fix
		# Version 1.3
		  - Fixed Status Icon may not be shown after next round
		  - Fixed Gurdian will spawn in opposite team when the player
		  change team while he or she is a guardian
		  - Small optimization
		# Version 1.4
		  - Added Color Messages
		  - Added two commands to see who are the guardians
		# Version 1.42
		  - Fixed Guardian would still be alive after disconnect
		  - Fixed Guardian would still be alive after changing to spectator
*/

#pragma semicolon 1

#include <amxmodx>

/*
	# Plugin:
		# Guardian based on Gears of War 2, a game type which
		add a team leader to your team who is the guardian. As
		long the team leader is alive other player will be
		respawned. The Guardian spawn with 150hp, 200ap and
		glowing the same colour as the team. A status icon will
		also indicate when you are the guardian. The team mates
		have to protect him or her while some has to attack the
		other guardian to win.
	-------------------------------------------------------------------
	# Development Team:
		# XzaR - Lead scripter
	-------------------------------------------------------------------
	# Special Thanks:
		# Crazyeffect - Added multilingual support
	-------------------------------------------------------------------
	# Changelog:
		# Version 1.0
		  - First release
		# Version 1.1
		  - Removed Log Events
		  - Changed some Events to Ham Events
		  - Fixed Team Change bug
		  - Added Guardian Kill Notice as HUD
		# Version 1.2
		  - Multilingual support
		  - CS VIP support
		# Version 1.21
		  - Fixed Multilingual
		# Version 1.22
		  - Small optimization
		# Version 1.23
		  - Small Fix
		# Version 1.3
		  - Fixed Status Icon may not be shown after next round
		  - Fixed Gurdian will spawn in opposite team when the player
		  change team while he or she is a guardian
		  - Small optimization
		# Version 1.4
		  - Added Color Messages
		  - Added two commands to see who are the guardians
		# Version 1.42
		  - Fixed Guardian would still be alive after disconnect
		  - Fixed Guardian would still be alive after changing to spectator
*/

#pragma semicolon 1

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define PLUGIN_NAME		"Guardian"
#define PLUGIN_VERSION		"1.42"
#define PLUGIN_AUTHOR		"XzaR/JimJoy's edit"
#define PLUGIN_PREFIX		"[Quick-Head]:"

#define MAXPLAYERS		32
#define ADMIN_FLAG		 ADMIN_CVAR

#define SPAWN_TIME		"5.0"

#define TASK_RESPAWNING		333
#define TASK_LEADER		666

new g_msg_status_icon;
new g_msg_say_text;

new cvar_guardian;
new cvar_spawntime;

new g_ct_leader;

new bool:g_ct_leader_alive;

//---------------------------------------------------------------------

stock create_status_icon(id,status,sprite[],red,green,blue)
{
	message_begin(MSG_ONE,g_msg_status_icon,{0,0,0},id);
	write_byte(status);
	write_string(sprite);
	write_byte(red);
	write_byte(green);
	write_byte(blue);
	message_end();
}

stock client_cprint(id,type,text[],...)
{
	new text_buffer[255];
	vformat(text_buffer,254,text,4);
	
	replace_all(text_buffer,254,"\y","^1");
	replace_all(text_buffer,254,"\t","^3");
	replace_all(text_buffer,254,"\g","^4");
	
	message_begin(type,g_msg_say_text,{0,0,0},id);
	write_byte(id);
	write_string(text_buffer);
	message_end();
}

//---------------------------------------------------------------------

public plugin_init()
{
	//Plugin
	register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR);
	
	//Dictionaries
	register_dictionary("guardian.txt");
	
	//Cvars
	cvar_guardian = register_cvar("sv_guardian","1");
	cvar_spawntime = register_cvar("sv_ga_spawntime",SPAWN_TIME);
	
	//Console Commands
	register_concmd("amx_guardian","handler_cmd",ADMIN_FLAG);
	register_concmd("amx_ga_spawntime","handler_cmd",ADMIN_FLAG);
	
	//Server Commands
	register_srvcmd("sv_guardian","handler_cmd",-1);
	register_srvcmd("sv_ga_spawntime","handler_cmd",-1);
	
	//Client Commands
	register_clcmd("say","handler_say",-1);
	register_clcmd("say_team","handler_say",-1);
	
	//Events
	register_event("HLTV","event_new_round","a", "1=0", "2=0");
	
	//Ham Events
	RegisterHam(Ham_Spawn,"player","event_player_spawn",1);
	RegisterHam(Ham_Killed,"player","event_player_killed",1);
	
	//User Messages
	g_msg_status_icon = get_user_msgid("StatusIcon");
	g_msg_say_text = get_user_msgid("SayText");
}

//---------------------------------------------------------------------

public random_leader_ct()
{
	new players[MAXPLAYERS],id;
	static num;
	new name_leader[32];
	new bool:found;
	
	get_players(players,num,"eh","CT");
	for(new i; i < num; i++)
	{
		if(!is_user_connected(players[i])) continue;
		
		id = players[i];
		if((random_num(1,num) == num) && (id != g_ct_leader))
		{
			g_ct_leader = id;
			found = true;
			break;
		}
	}
	
	if(!found)
	{
		g_ct_leader = id;
	}
	
	g_ct_leader_alive = true;
	get_user_name(g_ct_leader,name_leader,31);
	//client_print(0,print_chat,"%s %L",PLUGIN_PREFIX,LANG_PLAYER,"HAS_BEEN_CHOSEN_CT",name_leader);
	client_cprint(g_ct_leader,MSG_ALL,"\y%s %L",PLUGIN_PREFIX,LANG_PLAYER,"HAS_BEEN_CHOSEN_CT",name_leader);
}

public delay_leader_ct(parm[1])
{
	create_status_icon(parm[0],1,"suit_full",0,0,255);
	set_user_rendering(parm[0],kRenderFxGlowShell,0,0,255,kRenderNormal,120);
	leader_bonus(parm[0]);
}

public leader_bonus(id)
{
	set_user_health(id,200);
	cs_set_user_armor (id,200,CsArmorType:2);
}

public respawn_player(parm[1])
{
	new bool:respawn = false;
	
	if((g_ct_leader_alive) && (get_user_team(parm[0]) == 2))
	{
		respawn = true;
	}
	
	if(respawn == true)
	{
		ExecuteHamB(Ham_CS_RoundRespawn,parm[0]);
	}
	return PLUGIN_CONTINUE;
}

//---------------------------------------------------------------------

public client_disconnect(id)
{
	if(id == g_ct_leader) g_ct_leader_alive = false;
}

public client_changeteam(id,newteam,oldteam)
{
	if((!is_user_alive(id)) || (oldteam != newteam))
	{
		if(id == g_ct_leader) g_ct_leader_alive = false;
	}
}

//---------------------------------------------------------------------

public event_new_round()
{
	if((get_pcvar_num(cvar_guardian) != 1) || (get_playersnum() < 2)) return PLUGIN_CONTINUE;
	
	random_leader_ct();
	
	return PLUGIN_CONTINUE;
}

public event_player_spawn(id)
{
	if((get_pcvar_num(cvar_guardian) != 1) || (!is_user_alive(id))) return HAM_IGNORED;
	
	new bool:leader = false;
	if(g_ct_leader == id)
	{
		leader = true;
		static parm[1];
		parm[0] = id;
		
		set_task(0.5,"delay_leader_ct",TASK_LEADER + id,parm,1);
	}
	
	if(!leader)
	{
		new CsArmorType:armortype;
		new armor = cs_get_user_armor(id,armortype);
		if(armor > 100)
		{
			if(cs_get_user_vip(id))
			{
				cs_set_user_armor(id,150,armortype);
			}
			else cs_set_user_armor(id,100,armortype);
		}
		
		set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,10);
	}
	
	if(task_exists(TASK_RESPAWNING + id,0))
	{
		remove_task(TASK_RESPAWNING + id,0);
	}
	
	return HAM_HANDLED;
}

//---------------------------------------------------------------------

public event_player_killed(id,killer,shouldgib)
{
	if((get_pcvar_num(cvar_guardian) != 1)) return HAM_IGNORED;
	
	new name[32];
	get_user_name(id,name,31);
	if(g_ct_leader == id)
	{
		g_ct_leader_alive = false;
		create_status_icon(id,0,"suit_full",0,0,255);
		
		set_hudmessage(0,0,255,-1.0,0.45,0,1.0,4.0,0.1,0.2,3);
		show_hudmessage (0,"%L", LANG_PLAYER, "CT_DEAD",name);
		
		//client_print(0,print_chat,"%s %L",PLUGIN_PREFIX,LANG_PLAYER,"CT_DEAD",name);
		client_cprint(g_ct_leader,MSG_ALL,"\y%s %L",PLUGIN_PREFIX,LANG_PLAYER,"COLOR_CT_DEAD",name);
		
		return HAM_HANDLED;
	}
	
	static Float:spawntime,parm[1];
	spawntime = get_pcvar_float(cvar_spawntime);
	parm[0] = id;
		
	set_task(spawntime,"respawn_player",TASK_RESPAWNING + id,parm,1);
		
	new bool:respawn = false;
	if((g_ct_leader_alive) && (get_user_team(id) == 2))
	{
		respawn = true;
	}
		
	if(respawn)
	{
		set_hudmessage(255,255,255,-1.0,-1.0,2,1.0,(spawntime - 0.8),0.1,0.2,-1);
		show_hudmessage(id,"%L",id,"REVIVE");
	}

	return HAM_HANDLED;
}

//---------------------------------------------------------------------

public handler_cmd(id,level,cid)
{
	if (!cmd_access(id,level,cid,1))
	{
		return PLUGIN_HANDLED;
	}
	
	static cmd[32],arg1[32];
	read_argv(0,cmd,31);
	read_argv(1,arg1,31);
	
	if(equal(cmd,"sv_guardian") || equal(cmd,"amx_guardian"))
	{
		if(equal(arg1,"1"))
		{
			set_pcvar_num(cvar_guardian,1);
			set_cvar_num("sv_restartround",1);
		}
		else if(equal(arg1,"0"))
		{
			set_pcvar_num(cvar_guardian,0);
			set_cvar_num("sv_restartround",1);
		}
	}
	else if(equal(cmd,"sv_ga_spawntime") || equal(cmd,"amx_ga_spawntime"))
	{
		set_pcvar_float(cvar_spawntime,str_to_float(arg1));
	}
		
	return PLUGIN_HANDLED;
}

public handler_say(id)
{
	if(get_pcvar_num(cvar_guardian) != 1) return PLUGIN_CONTINUE;
	
	static said[32];
	read_args(said,31);
	remove_quotes(said);

	if(equal(said,"/kapitan") || equal(said,"kapitan"))
	{
		static name_ct[32];
		get_user_name(g_ct_leader,name_ct,31);
		
		client_cprint(id,MSG_ONE,"\y%s %L",PLUGIN_PREFIX,id,"IS_GUARDIAN_CT",name_ct);
	}
	
	return PLUGIN_CONTINUE;
}

//---------------------------------------------------------------------

Użytkownik Burek edytował ten post 06.11.2011 11:55

  • +
  • -
  • 0





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

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

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