Go Spectator & Back with reason [1.1 + 2.0 versions]

Pluginuri pentru modul AmxModX.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1777
Joined: 16 Jul 2011, 21:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Has thanked: 146 times
Been thanked: 396 times

30 Sep 2013, 02:06

Descriere: Te poti muta spectator cu motiv + timp sau reintoarce la joc.

Descarcare: Link!

Nume: Spec & Back + Reason
Versiune: 1.1
Link oficial: Aici

Instalare:
1. Fisierul spec_back_reason.sma il puneti in addons/amxmodx/scripting
2. Fisierul spec_back_reason.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Code: Select all

spec_back_reason.amxx
Cvar-uri:
Nu sunt.

Comenzi administrative :
Nu sunt.

Comenzi publice (se tasteaza in joc prin apasarea tastei Y si consola.):
  • /spec motiv timp - Te muta spectator pentru X motiv si Y timp.(in minute)
    /back - Te muta inapoi la CT doar daca te-ai mutat cu comanda spec.
    amx_showspecs - aceasta comanda trebuie introdusa in consola si iti afiseaza cine este spec, motiv si timpul sau.
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- cstrike
- hamsandwich

Imagini:

Image

Image

Image

Image

EDIT:
Versiunea 2.0 a aparut!
| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

new bool:g_spec[33], g_spec_reason[33][32], g_seconds[33];

new const TAG[] = "TEST";

#define NORMAL
//#define DEATHRUN
//#define RESPAWN

#if !defined DEATHRUN
new g_teamstocat[33];
#endif

public plugin_init()
{
	register_plugin("Spec & Reason", "2.0", "cyby")
	
	register_clcmd("say", "spec_say")
	register_clcmd("amx_showspecs", "show_specs")
}

public spec_say(id)
{
	if(!g_spec[id])
	{
		#if defined DEATHRUN
		if(cs_get_user_team(id) == CS_TEAM_CT)
		{
		#endif
		static citim_mesaj[64]
		
		read_args(citim_mesaj, charsmax(citim_mesaj))
		remove_quotes(citim_mesaj)
		
		new comanda[16], motiv[22];
		
		strbreak(citim_mesaj, comanda, charsmax(comanda), motiv, charsmax(motiv))
		if(equal(comanda, "/spec", 5))
			spec_me(id, motiv)
		#if defined DEATHRUN
		}
		#endif
	}
	
	if(g_spec[id] && cs_get_user_team(id) == CS_TEAM_SPECTATOR)
	{
		static msj[192];
		read_args(msj, charsmax(msj) - 1);
		remove_quotes(msj);
		
		if(equal(msj, "/back"))
			back_to_game(id)
	}
}

public spec_me(id, arg[])
{
	static motiv[20], time[2];
	strbreak(arg, motiv, 19, time, 1)
	
	if (!motiv[0] || !time[0])
	{
		color(id, ".v[%s].g Comanda trebuie folosita astfel: /spec motiv timp.", TAG)
		return
	}
	
	static timpul;
	timpul = str_to_num(time)
	
	if(timpul > 9)
	{
		color(id, ".v[%s].g Timpul situat spec nu trebuie sa treaca de 9 minute.", TAG)
		return
	}
	
	if (timpul <= 0)
	{
		color(id, ".v[%s].g Valoarea introdusa de tine este invalida.", TAG)
		return
	}
	
	static nume[32];
	get_user_name(id, nume, charsmax(nume) - 1)
	g_seconds[id] = timpul * 60 - 1;
	set_task(1.0, "second_part", id)
	g_spec_reason[id] = motiv
	g_spec[id] = true
	if(is_user_alive(id))
		user_silentkill(id)
		
	#if !defined DEATHRUN
	g_teamstocat[id] = get_user_team(id)
	#endif
	cs_set_user_team(id, CS_TEAM_SPECTATOR)

	color(0, ".v[%s].e %s.g se muta la spectator pe motivul:.e %s.g. El revine la joc in:.e %d.g minut%s.", TAG, nume, motiv, timpul, timpul < 2 ? "" : "e")
}

public second_part(id)
{
	if(!is_user_connected(id) || is_user_alive(id) || !g_spec[id])
		return

	if(g_seconds[id] >= 1)
	{
		if(g_seconds[id] >= 60)
		{
			client_print(id, print_center, "Vei reveni la joc in %d minut%s si %d secund%s.", (g_seconds[id] / 60), (g_seconds[id] / 60) < 2 ? "" : "e", (g_seconds[id] % 60), (g_seconds[id] % 60) < 2 ? "a" : "e")
		}
		else
		{
			client_print(id, print_center, "Vei reveni la joc in %d secund%s.", g_seconds[id], g_seconds[id] < 2 ? "a" : "e")
		}
		g_seconds[id]--
		set_task(1.0, "second_part", id)
	}
	else
	{
		g_seconds[id] = 0
		client_print(id, print_center, "Revii indata la joc.")
		back_to_game(id)
		return;
	}
}

public back_to_game(id)
{
	if(!is_user_connected(id) || !g_spec[id])
		return
	
	static nume[32];
	get_user_name(id, nume, charsmax(nume) - 1)
	color(0, ".v[%s].e %s.g revine la joc!", TAG, nume)
	#if defined DEATHRUN
	cs_set_user_team(id, CS_TEAM_CT)
	#else
	switch(g_teamstocat[id])
	{
		case 1: cs_set_user_team(id, CS_TEAM_T)
		case 2: cs_set_user_team(id, CS_TEAM_CT)
	}
	g_teamstocat[id] = 0
	#endif
	g_spec[id] = false
	remove_task(id);
	#if defined RESPAWN
	set_task(0.5, "respawn_player", id)
	#endif
}

#if defined RESPAWN
public respawn_player(id)
{
	if(!is_user_connected(id) || is_user_alive(id))
		return
	
	ExecuteHamB(Ham_CS_RoundRespawn, id);
}
#endif

public client_putinserver(id)
{
	g_spec[id] = false
	#if !defined DEATHRUN
	g_teamstocat[id] = 0
	#endif
}

public client_disconnect(id)
{
	remove_task(id);
	g_spec[id] = false
	#if !defined DEATHRUN
	g_teamstocat[id] = 0
	#endif
}

public show_specs(id)
{
	static Total[32], iNum, iPlayer, Nume[32];
	get_players(Total, iNum, "ch");
	console_print(id, "Jucatorii setati pe spectator sunt:")
	for(new i = 0; i < iNum; i++)
	{
		iPlayer = Total;
		if(g_spec[iPlayer])
		{
			get_user_name(iPlayer, Nume, charsmax(Nume) - 1);
			
			#if !defined DEATHRUN
			new tine[20];
			switch(g_teamstocat[iPlayer])
			{
				case 1: formatex(tine, charsmax(tine) - 1, "TERRORIST")
				case 2: formatex(tine, charsmax(tine) - 1, "COUNTER-TERRORIST")
			}
			if(g_seconds[iPlayer] >= 60)
				console_print(id, "%s | Motiv: %s | Timp: %d minut%s, %d secund%s | ECHIPA: %s.", Nume, g_spec_reason[iPlayer], (g_seconds[iPlayer] / 60), (g_seconds[iPlayer] / 60) < 2 ? "" : "e", (g_seconds[iPlayer] % 60), (g_seconds[iPlayer] % 60) < 2 ? "a" : "e", tine)
			else
				console_print(id, "%s | Motiv: %s | Timp: %d secund%s. | ECHIPA: %s.", Nume, g_spec_reason[iPlayer], (g_seconds[iPlayer] % 60), (g_seconds[iPlayer] % 60) < 2 ? "a" : "e", tine)
				
			#else
			if(g_seconds[iPlayer] >= 60)
				console_print(id, "%s | Motiv: %s | Timp: %d minut%s, %d secund%s.", Nume, g_spec_reason[iPlayer], (g_seconds[iPlayer] / 60), (g_seconds[iPlayer] / 60) < 2 ? "" : "e", (g_seconds[iPlayer] % 60), (g_seconds[iPlayer] % 60) < 2 ? "a" : "e")
			else
				console_print(id, "%s | Motiv: %s | Timp: %d secund%s.", Nume, g_spec_reason[iPlayer], (g_seconds[iPlayer] % 60), (g_seconds[iPlayer] % 60) < 2 ? "a" : "e")
							
			#endif
		}
	}
	console_print(id, "Lista completa.")
	return PLUGIN_HANDLED;
}

stock color(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)

	replace_all(msg, 190, ".v", "^4")
	replace_all(msg, 190, ".g", "^1")
	replace_all(msg, 190, ".e", "^3")

	if(id) players[0] = id; else get_players(players, count, "ch")
	{
		for(new i = 0; i < count; i++)
		{
			if(is_user_connected(players))
			{
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}


Ea poate fi folosita pe mai multe versiuni.

Code: Select all

#define NORMAL
//#define DEATHRUN
//#define RESPAWN
Pentru normal scoti // din fata la normal, pentru respawn scoti // de la respawn si pentru deathrun scoti din fata // . Atentie! Iti recomand sa folosesti normal sau normal + respawn, niciodata toate 3 deodata.
Last edited by cyby on 09 Jan 2014, 18:00, edited 3 times in total.
93.114.82.17:27015 - Monster Invasion CO-OP Mod
RoyalServer
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times

30 Sep 2013, 11:39

Bestial :x .Felicitari :)>-
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
User avatar
CsN^ ;x
Membru eXtream
Membru eXtream
Posts: 3560
Joined: 02 Apr 2012, 16:58
Detinator Steam: Nu
CS Status: Retras din domeniul Counter-Strike
Reputatie: Fost moderator
Location: Bucuresti
Has thanked: 797 times
Been thanked: 607 times

30 Sep 2013, 11:49

Nu il poti face sa mearga si pentru tero?
Adica cand scriu /t sa ma mute tero si cand sctiu /ct sa ma mute counter,cand scriu /spec sa faca cum ai zis tu si la fel si back adica sa mai bagi acele 2 comenzi X_x sau il lasi doar pentru modul deathrun. (eu zic sa mai faci o versiune cum am zis eu,desigur daca doresti X_X )
EDIT: Sau macar sa lasi cum e dar sa poate folosi si tero comenziile :)
EDIT2: Ma rezolvat falcao si pentru alti mai jos :)
| Afiseaza codul
[code]#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

new bool:g_spec[33], g_spec_reason[33][32], g_seconds[33];

new const TAG[] = "LCS";

public plugin_init()
{
	register_plugin("Spec & Reason", "1.2", "cyby")
	
	register_clcmd("say", "spec_say")
	register_clcmd("amx_showspecs", "show_specs")
}

public spec_say(id)
{
	if(!g_spec[id] && cs_get_user_team(id) == CS_TEAM_T || cs_get_user_team( id ) == CS_TEAM_CT )
	{
		static citim_mesaj[64]
		
		read_args(citim_mesaj, charsmax(citim_mesaj))
		remove_quotes(citim_mesaj)
		
		new comanda[16], motiv[22];
		
		strbreak(citim_mesaj, comanda, charsmax(comanda), motiv, charsmax(motiv))
		if(equal(comanda, "/spec", 5))
			spec_me(id, motiv)
	}
	
	if(g_spec[id] && cs_get_user_team(id) == CS_TEAM_SPECTATOR)
	{
		static msj[192];
		read_args(msj, charsmax(msj) - 1);
		remove_quotes(msj);
		
		if(equal(msj, "/back"))
			back_to_game(id)
	}
}

public spec_me(id, arg[])
{
	static motiv[20], time[2];
	strbreak(arg, motiv, 19, time, 1)
	
	if (!motiv[0] || !time[0])
	{
		color(id, ".v[%s].g Comanda trebuie folosita astfel: /spec motiv timp.", TAG)
		return
	}
	
	static timpul;
	timpul = str_to_num(time)
	
	if(timpul > 9)
	{
		color(id, ".v[%s].g Timpul situat spec nu trebuie sa treaca de 9 minute.", TAG)
		return
	}
	
	if (timpul <= 0)
	{
		color(id, ".v[%s].g Valoarea introdusa de tine este invalida.", TAG)
		return
	}
	
	static nume[32];
	get_user_name(id, nume, charsmax(nume) - 1)
	g_seconds[id] = timpul * 60 - 1;
	set_task(1.0, "second_part", id)
	g_spec_reason[id] = motiv
	g_spec[id] = true
	user_silentkill(id)
	cs_set_user_team(id, CS_TEAM_SPECTATOR)
	
	color(0, ".v[%s].e %s.g se muta la spectator pe motivul:.e %s.g. El revine la joc in:.e %d.g minut%s.", TAG, nume, motiv, timpul, timpul < 2 ? "" : "e")
}

public second_part(id)
{
	if(!is_user_connected(id) || is_user_alive(id) || !g_spec[id])
		return

	if(g_seconds[id] >= 1)
	{
		if(g_seconds[id] >= 60)
		{
			client_print(id, print_center, "Vei reveni la joc in %d minut%s si %d secund%s.", (g_seconds[id] / 60), (g_seconds[id] / 60) < 2 ? "" : "e", (g_seconds[id] % 60), (g_seconds[id] % 60) < 2 ? "a" : "e")
		}
		else
		{
			client_print(id, print_center, "Vei reveni la joc in %d secund%s.", g_seconds[id], g_seconds[id] < 2 ? "a" : "e")
		}
		g_seconds[id]--
		set_task(1.0, "second_part", id)
	}
	else
	{
		g_seconds[id] = 0
		client_print(id, print_center, "Revii indata la joc.")
		back_to_game(id)
		return;
	}
}

public back_to_game(id)
{
	if(!is_user_connected(id) || !g_spec[id])
		return
	
	static nume[32];
	get_user_name(id, nume, charsmax(nume) - 1)
	color(0, ".v[%s].e %s.g revine la joc!", TAG, nume)
	cs_set_user_team(id, CS_TEAM_CT)
	g_spec[id] = false
	remove_task(id);
	set_task(0.5, "respawn_player", id)
}

public respawn_player(id)
{
	if(!is_user_connected(id) || is_user_alive(id))
		return
	
	ExecuteHamB(Ham_CS_RoundRespawn, id);
}

public client_putinserver(id)
{
	g_spec[id] = false
}

public client_disconnect(id)
{
	remove_task(id);
	g_spec[id] = false
}

public show_specs(id)
{
	static Total[32], iNum, iPlayer, Nume[32];
	get_players(Total, iNum, "ch");
	console_print(id, "Jucatorii setati pe spectator sunt:")
	for(new i = 0; i < iNum; i++)
	{
		iPlayer = Total;
		if(g_spec[iPlayer])
		{
			get_user_name(iPlayer, Nume, charsmax(Nume) - 1);
			if(g_seconds[iPlayer] >= 60)
				console_print(id, "%s | Motiv: %s | Timp: %d minut%s, %d secund%s.", Nume, g_spec_reason[iPlayer], (g_seconds[iPlayer] / 60), (g_seconds[iPlayer] / 60) < 2 ? "" : "e", (g_seconds[iPlayer] % 60), (g_seconds[iPlayer] % 60) < 2 ? "a" : "e")
			else
				console_print(id, "%s | Motiv: %s | Timp: %d secund%s.", Nume, g_spec_reason[iPlayer], (g_seconds[iPlayer] % 60), (g_seconds[iPlayer] % 60) < 2 ? "a" : "e")
		}
	}
	console_print(id, "Lista completa.")
	return PLUGIN_HANDLED;
}

stock color(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)

	replace_all(msg, 190, ".v", "^4")
	replace_all(msg, 190, ".g", "^1")
	replace_all(msg, 190, ".e", "^3")

	if(id) players[0] = id; else get_players(players, count, "ch")
	{
		for(new i = 0; i < count; i++)
		{
			if(is_user_connected(players))
			{
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}[/code]
Addons HNS level,gravity,xp DOWNLOAD ( e țeapă)
https://5filme.com/ - un simplu site de filme pentru timpul liber
User avatar
roberteeel
Membru eXtream
Membru eXtream
Posts: 4438
Joined: 05 Sep 2012, 11:39
Detinator Steam: Nu
Reputatie: Nick anterior: QAZW, Robert.ultrasFarul, CT 18 ROS
Restrictie schimbare nume
Fost moderator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 313 times
Been thanked: 357 times

01 Oct 2013, 09:48

Foarte misto plugin-ul. Merci fain!
HaLo14
Membru, skill 0
Membru, skill 0
Posts: 92
Joined: 08 Jul 2013, 23:08
Detinator Steam: Nu
CS Status: Fotbalist
Detinator server CS: Da
SteamID: Nu
Location: Targu-Mures
Has thanked: 25 times

09 Oct 2013, 12:25

Felicitari ! :)
User avatar
ARTUR.HAZ
Administrator
Administrator
Posts: 7652
Joined: 04 Oct 2013, 14:32
Detinator Steam: Da
Reputatie: Administrator
Has thanked: 146 times
Been thanked: 123 times
Contact:

18 Oct 2013, 19:47

Foarte misto plugin-ul !
O sa-l descarc + thx.
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1777
Joined: 16 Jul 2011, 21:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Has thanked: 146 times
Been thanked: 396 times

25 Dec 2013, 03:02

Versiunea 2.0 aparuta.
93.114.82.17:27015 - Monster Invasion CO-OP Mod
teNNeke.
Membru, skill +1
Membru, skill +1
Posts: 318
Joined: 01 Sep 2013, 17:59
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 36 times
Been thanked: 9 times
Contact:

25 Dec 2013, 15:10

Pe clasic nu se poate folosi? :-?
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1777
Joined: 16 Jul 2011, 21:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Has thanked: 146 times
Been thanked: 396 times

25 Dec 2013, 22:31

Versiunea 2.0 se poate folosi.
93.114.82.17:27015 - Monster Invasion CO-OP Mod
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1777
Joined: 16 Jul 2011, 21:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Has thanked: 146 times
Been thanked: 396 times

25 Dec 2013, 22:31

Scuzati pentru dp.
93.114.82.17:27015 - Monster Invasion CO-OP Mod
Post Reply

Return to “AmxModX”

  • Information
  • Who is online

    Users browsing this forum: Yandex [Bot] and 18 guests