Cerere Plugin WarmUp Round

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
EmiNem | XTR
Membru, skill +1
Membru, skill +1
Posts: 121
Joined: 02 Aug 2014, 20:59
Detinator Steam: Da
CS Status: Counter-Strike: Global Offensive
SteamID: ** ! Private ! **
Fond eXtream: 0
Location: Bucureşti
Has thanked: 11 times

04 Aug 2014, 18:52

1.

Descriere plugin cerut: Am nevoie de un plugin WarmUp foarte avansat.
Alte Înformaţii: Deci, am nevoie de un plugin de încâlzire. Acesta să fie un fel de WarmUp. Cum vreau să funcţioneze? Deci, cum se schimbă mapa şi intrii pe server, prima runda să fie de încâlzire. Să fie durata de 120 secunde şi să fie un mesaj care anunţă WarmUp Ends In : câte secunde setate de sv. Acesta să fie cu respawn, adică când mori să-ţi dea respawn automat şi să aibe fiecare player bani înfiniţi. Adică, dacă şi-a cumpărat arme şi a murit, când îi dă respawn iar primeşte iar banii pe infiniţi. Sper că aţi înţeles la ce mă refer. Şi la ultimele 3 secunde de WarmUp, să le dea freeze tuturor jucătorilor şi să înceapă runda. Să le dă mesaje aceste mesaje pe chat: Poză: Image poza această o am de la un plugin Round Restart v2.2 cred că-l ştiţi dar nu e ceea ce doresc eu!

Mulţumesc şi sper să-mi puteţi da ceea ce doresc.

O seară bună.
RoyalServer
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

07 Aug 2014, 04:02

verifica | Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

new g_warmup = 121, g_saytext, bool:g_firstspawn[33];

new const TAG[] = "[AMXX]";

public plugin_init()
{
	register_plugin("Super Warmup", "1.0", "cyby")
	
	RegisterHam(Ham_Spawn, "player", "spawn_post", 1)
	RegisterHam(Ham_Killed, "player", "player_killed")
	register_forward(FM_PlayerPreThink, "prethink_player")
	register_event("HLTV", "start_round", "a", "1=0", "2=0")
	
	set_task(1.0, "count_down_warmup", 0xFFFFFA8008BB7B30, _, _, "b")
	g_saytext = get_user_msgid("SayText");
}

public cound_down_warmup()
{
	if(g_warmup > 0)
	{
		set_hudmessage(0, 212, 255, 0.0, 0.18, 1, 1.1, 1.0, 0.0, 0.0)
		show_hudmessage(0, "WarmUp Ends In: %d second%s", g_warmup, g_warmup > 1 ? "s" : "")
	}
	else
	{
		set_cvar_num("sv_restart", 1)
		remove_task(0xFFFFFA8008BB7B30)
		g_warmup = 0 // in caz de face faze gay
		set_cvar_float("mp_buytime", 0.35)
		return 1;
	}
	g_warmup--
	return 0;
}

public start_round()
{
	if(g_warmup > 0)
	{
		static map[32];
		get_mapname(map, charsmax(map) - 1)
		color(0, "%s Welcome to.e SERVER.g !", TAG)
		color(0, "%s Loading environment for map.e %s.g", TAG)
		color(0, "%s Prepairing teams for play", TAG)
		color(0, "%s   ...::.v  GL & HF !.g  ::...", TAG)
	}
}

public spawn_post(id)
{
	if(!is_user_alive(id) || !g_warmup)
		return;
		
	set_cvar_float("mp_buytime", 0.0)
	cs_set_user_money(id, 16000)
	if(g_firstspawn[id])
		g_firstspawn[id] = false
}

public player_killed(victim)
	set_task(0.7, "plrespawn", victim)

public plrespawn(id)
{
	if(!is_user_connected(id) || is_user_alive(id) || !g_warmup)
		return;
		
	ExecuteHamB(Ham_CS_RoundRespawn, id)
	if(g_firstspawn[id])
		g_firstspawn[id] = false
}

public prethink_player(id)
{
	if(!is_user_alive(id) || !g_warmup)
		return;
		
	if(g_warmup < 4 && g_warmup > 0)
		set_pev(id, pev_maxspeed, 0.0)
}

public client_putinserver(id)
{
	set_task(1.0, "check_team", id+82382394, _, _, "b")
	g_firstspawn[id] = true
}

public check_team(id)
{
	if(!g_warmup || is_user_alive(id) || !is_user_connected(id) || !g_firstspawn[id])
	{
		remove_task(id+82382394)
		return 1;
	}
	
	if(g_firstspawn[id] && (get_user_team(id) == 1 || get_user_team(id) == 2) && !is_user_alive(id))
	{
		set_task(0.2, "plrespawn", id)
		remove_task(id+82382394)
	}
	return 1;
}

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, g_saytext, _, players)
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}
93.114.82.17:27015 - Monster Invasion CO-OP Mod
EmiNem | XTR
Membru, skill +1
Membru, skill +1
Posts: 121
Joined: 02 Aug 2014, 20:59
Detinator Steam: Da
CS Status: Counter-Strike: Global Offensive
SteamID: ** ! Private ! **
Fond eXtream: 0
Location: Bucureşti
Has thanked: 11 times

08 Aug 2014, 17:50

warmup.sma(46) : error 017: undefined symbol "color"
warmup.sma(53) : warning 217: loose indentation
warmup.sma(53) : error 029: invalid expression, assumed zero
warmup.sma(53) : error 017: undefined symbol "spawn_post"
warmup.sma(55) : error 017: undefined symbol "id"
warmup.sma(56) : warning 209: function "start_round" should return a value
warmup.sma(59) : error 017: undefined symbol "id"
warmup.sma(59) : warning 215: expression has no effect
warmup.sma(59) : error 001: expected token: ";", but found ")"
warmup.sma(59) : error 029: invalid expression, assumed zero
warmup.sma(59) : fatal error 107: too many error messages on one line

când încerc să-l compilez..
#Vali
Fost moderator
Fost moderator
Posts: 2611
Joined: 24 Jan 2012, 11:00
Detinator Steam: Da
SteamID: id/spryt3
Reputatie: Fost Moderator
Fost Scripter eXtreamCS.com
1.2 / 3
Location: root
Has thanked: 81 times
Been thanked: 144 times
Contact:

08 Aug 2014, 18:24

EmiNem | XTR
Membru, skill +1
Membru, skill +1
Posts: 121
Joined: 02 Aug 2014, 20:59
Detinator Steam: Da
CS Status: Counter-Strike: Global Offensive
SteamID: ** ! Private ! **
Fond eXtream: 0
Location: Bucureşti
Has thanked: 11 times

08 Aug 2014, 18:38

nu merge sa descarc. nu merge link

compilazea-l si tu te rog pe alt site.

uite, compileaza asta:
| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

new g_warmup = 121, g_saytext, bool:g_firstspawn[33];

public plugin_init()
{
	register_plugin("Advanced WarmUp System", "1.0", "cyby")
	
	RegisterHam(Ham_Spawn, "player", "spawn_post", 1)
	RegisterHam(Ham_Killed, "player", "player_killed")
	register_forward(FM_PlayerPreThink, "prethink_player")
	register_event("HLTV", "start_round", "a", "1=0", "2=0")
	
	set_task(1.0, "count_down_warmup", 0xFFFFFA8008BB7B30, _, _, "b")
	g_saytext = get_user_msgid("SayText");
}

public cound_down_warmup()
{
	if(g_warmup > 0)
	{
		set_hudmessage(0, 212, 255, 0.0, 0.18, 1, 1.1, 1.0, 0.0, 0.0)
		show_hudmessage(0, "WarmUp Round Ends In: %d second%s", g_warmup, g_warmup > 1 ? "s" : "")
	}
	else
	{
		set_cvar_num("sv_restart", 1)
		remove_task(0xFFFFFA8008BB7B30)
		g_warmup = 0 // in caz de face faze gay
		set_cvar_float("mp_buytime", 0.3)
		return 1;
	}
	g_warmup--
	return 0;
}

public start_round()
{
	if(g_warmup > 0)
	{
		static map[32];
		get_mapname(map, charsmax(map) - 1)
		color(0, ".e Welcome to.v XTREME.INDUNGI.RO # HIGH FPS SERVER",
		color(0, ".e Loading environment for map.e %s",
		color(0, ".e Prepairing teams for play !",
		color(0, ".e Game Started..v Go Go Go !!!",
	}
}

public spawn_post(id)
{
	if(!is_user_alive(id) || !g_warmup)
		return;
		
	set_cvar_float("mp_buytime", 0.0)
	cs_set_user_money(id, 16000)
	if(g_firstspawn[id])
		g_firstspawn[id] = false
}

public player_killed(victim)
	set_task(0.7, "plrespawn", victim)

public plrespawn(id)
{
	if(!is_user_connected(id) || is_user_alive(id) || !g_warmup)
		return;
		
	ExecuteHamB(Ham_CS_RoundRespawn, id)
	if(g_firstspawn[id])
		g_firstspawn[id] = false
}

public prethink_player(id)
{
	if(!is_user_alive(id) || !g_warmup)
		return;
		
	if(g_warmup < 4 && g_warmup > 0)
		set_pev(id, pev_maxspeed, 0.0)
}

public client_putinserver(id)
{
	set_task(1.0, "check_team", id+82382394, _, _, "b")
	g_firstspawn[id] = true
}

public check_team(id)
{
	if(!g_warmup || is_user_alive(id) || !is_user_connected(id) || !g_firstspawn[id])
	{
		remove_task(id+82382394)
		return 1;
	}
	
	if(g_firstspawn[id] && (get_user_team(id) == 1 || get_user_team(id) == 2) && !is_user_alive(id))
	{
		set_task(0.2, "plrespawn", id)
		remove_task(id+82382394)
	}
	return 1;
}

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, g_saytext, _, players)
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}
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

08 Aug 2014, 18:46

Compileaza tu asta | Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

new g_warmup = 121, g_saytext, bool:g_firstspawn[33];

public plugin_init()
{
	register_plugin("Advanced WarmUp System", "1.0", "cyby")
	
	RegisterHam(Ham_Spawn, "player", "spawn_post", 1)
	RegisterHam(Ham_Killed, "player", "player_killed")
	register_forward(FM_PlayerPreThink, "prethink_player")
	register_event("HLTV", "start_round", "a", "1=0", "2=0")
	
	set_task(1.0, "count_down_warmup", 0xFFFFFA8008BB7B30, _, _, "b")
	g_saytext = get_user_msgid("SayText");
}

public cound_down_warmup()
{
	if(g_warmup > 0)
	{
		set_hudmessage(0, 212, 255, 0.0, 0.18, 1, 1.1, 1.0, 0.0, 0.0)
		show_hudmessage(0, "WarmUp Round Ends In: %d second%s", g_warmup, g_warmup > 1 ? "s" : "")
	}
	else
	{
		set_cvar_num("sv_restart", 1)
		remove_task(0xFFFFFA8008BB7B30)
		g_warmup = 0 // in caz de face faze gay
		set_cvar_float("mp_buytime", 0.3)
		return 1;
	}
	g_warmup--
	return 0;
}

public start_round()
{
	if(g_warmup > 0)
	{
		static map[32];
		get_mapname(map, charsmax(map) - 1)
		color(0, ".e Welcome to.v XTREME.INDUNGI.RO # HIGH FPS SERVER")
		color(0, ".e Loading environment for map.e %s", map)
		color(0, ".e Prepairing teams for play !")
		color(0, ".e Game Started..v Go Go Go !!!")
	}
}

public spawn_post(id)
{
	if(!is_user_alive(id) || !g_warmup)
		return;
		
	set_cvar_float("mp_buytime", 0.0)
	cs_set_user_money(id, 16000)
	if(g_firstspawn[id])
		g_firstspawn[id] = false
}

public player_killed(victim)
	set_task(0.7, "plrespawn", victim)

public plrespawn(id)
{
	if(!is_user_connected(id) || is_user_alive(id) || !g_warmup)
		return;
		
	ExecuteHamB(Ham_CS_RoundRespawn, id)
	if(g_firstspawn[id])
		g_firstspawn[id] = false
}

public prethink_player(id)
{
	if(!is_user_alive(id) || !g_warmup)
		return;
		
	if(g_warmup < 4 && g_warmup > 0)
		set_pev(id, pev_maxspeed, 0.0)
}

public client_putinserver(id)
{
	set_task(1.0, "check_team", id+82382394, _, _, "b")
	g_firstspawn[id] = true
}

public check_team(id)
{
	if(!g_warmup || is_user_alive(id) || !is_user_connected(id) || !g_firstspawn[id])
	{
		remove_task(id+82382394)
		return 1;
	}
	
	if(g_firstspawn[id] && (get_user_team(id) == 1 || get_user_team(id) == 2) && !is_user_alive(id))
	{
		set_task(0.2, "plrespawn", id)
		remove_task(id+82382394)
	}
	return 1;
}

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, g_saytext, _, players)
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}
93.114.82.17:27015 - Monster Invasion CO-OP Mod
EmiNem | XTR
Membru, skill +1
Membru, skill +1
Posts: 121
Joined: 02 Aug 2014, 20:59
Detinator Steam: Da
CS Status: Counter-Strike: Global Offensive
SteamID: ** ! Private ! **
Fond eXtream: 0
Location: Bucureşti
Has thanked: 11 times

08 Aug 2014, 21:35

Mare bug, deci. Nu apare când expiră WarmUp Round, şi apare erori în consolă cu mp_buytime 0 şi mp_buytime 0.2555 face spam aşa în toată consola. Zici că s-a făcut un server de respawn, adică nici nu se mai opreşte, nimic. Lol.

Remediează problema, te rog.

#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

new g_warmup = 121, g_saytext, bool:g_firstspawn[33];

public plugin_init()
{
register_plugin("Advanced WarmUp System", "1.0", "cyby")

RegisterHam(Ham_Spawn, "player", "spawn_post", 1)
RegisterHam(Ham_Killed, "player", "player_killed")
register_forward(FM_PlayerPreThink, "prethink_player")
register_event("HLTV", "start_round", "a", "1=0", "2=0")

set_task(1.0, "count_down_warmup", 0xFFFFFA8008BB7B30, _, _, "b")
g_saytext = get_user_msgid("SayText");
}

public cound_down_warmup()
{
if(g_warmup > 0)
{
set_hudmessage(0, 212, 255, 0.0, 0.18, 1, 1.1, 1.0, 0.0, 0.0)
show_hudmessage(0, "WarmUp Round Ends In: %d second%s", g_warmup, g_warmup > 1 ? "s" : "")
}
else
{
set_cvar_num("sv_restart", 1)
remove_task(0xFFFFFA8008BB7B30)
g_warmup = 0 // in caz de face faze gay
set_cvar_float("mp_buytime", 0.3)
return 1;
}
g_warmup--
return 0;
}

public start_round()
{
if(g_warmup > 0)
{
static map[32];
get_mapname(map, charsmax(map) - 1)
color(0, ".e Welcome to.v XTREME.INDUNGI.RO # HIGH FPS SERVER")
color(0, ".e Loading environment for map.e %s", map)
color(0, ".e Prepairing teams for play !")
color(0, ".e Game Started..v Go Go Go !!!")
}
}

public spawn_post(id)
{
if(!is_user_alive(id) || !g_warmup)
return;

set_cvar_float("mp_buytime", 0.0)
cs_set_user_money(id, 16000)
if(g_firstspawn[id])
g_firstspawn[id] = false
}

public player_killed(victim)
set_task(0.7, "plrespawn", victim)

public plrespawn(id)
{
if(!is_user_connected(id) || is_user_alive(id) || !g_warmup)
return;

ExecuteHamB(Ham_CS_RoundRespawn, id)
if(g_firstspawn[id])
g_firstspawn[id] = false
}

public prethink_player(id)
{
if(!is_user_alive(id) || !g_warmup)
return;

if(g_warmup < 4 && g_warmup > 0)
set_pev(id, pev_maxspeed, 0.0)
}

public client_putinserver(id)
{
set_task(1.0, "check_team", id+82382394, _, _, "b")
g_firstspawn[id] = true
}

public check_team(id)
{
if(!g_warmup || is_user_alive(id) || !is_user_connected(id) || !g_firstspawn[id])
{
remove_task(id+82382394)
return 1;
}

if(g_firstspawn[id] && (get_user_team(id) == 1 || get_user_team(id) == 2) && !is_user_alive(id))
{
set_task(0.2, "plrespawn", id)
remove_task(id+82382394)
}
return 1;
}

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, g_saytext, _, players)
write_byte(players);
write_string(msg);
message_end();
}
}
}
}
kaRbooN
Membru, skill 0
Membru, skill 0
Posts: 68
Joined: 27 May 2012, 13:59
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 17 times
Been thanked: 3 times
Contact:

08 Aug 2014, 23:45

EmiNem | XTR
Membru, skill +1
Membru, skill +1
Posts: 121
Joined: 02 Aug 2014, 20:59
Detinator Steam: Da
CS Status: Counter-Strike: Global Offensive
SteamID: ** ! Private ! **
Fond eXtream: 0
Location: Bucureşti
Has thanked: 11 times

09 Aug 2014, 07:46

kaRbooN wrote:Poftim pluginul cerut: https://forums.alliedmods.net/showthread.php?p=798354
Eu nu am cerut acest plugin, eu am cerut altul. Te rog can alta data sa numai postezi aiurea.

ON: UP, astept ajutor.
EmiNem | XTR
Membru, skill +1
Membru, skill +1
Posts: 121
Joined: 02 Aug 2014, 20:59
Detinator Steam: Da
CS Status: Counter-Strike: Global Offensive
SteamID: ** ! Private ! **
Fond eXtream: 0
Location: Bucureşti
Has thanked: 11 times

10 Aug 2014, 15:42

UP. ma ajuta cineva?
User avatar
alkaline
Fost moderator
Fost moderator
Posts: 734
Joined: 18 Jul 2012, 09:42
Detinator Steam: Da
Reputatie: Fost Moderator ajutator
Nume anterior: lucylucy
Fond eXtream: 0
Location: Caras-Severin
Has thanked: 5 times
Been thanked: 296 times

11 Aug 2014, 01:21

WarmUP mai afansat

(daca nu merg cele mai de sus.)

(!) Info : daca il vreti sa dea random spawn
descarcati folderul ' csdm ' de aici csdm
- dupa ce l-ati descarcat il adaugati in configs/
si trebuie sa-i activati cvar-ul

Code: Select all

warm_random_respawn "0" // este dezactivat 
dupa ce l-ati activat
warm_random_respawn "1" // activat
trebuie sa dati restart la server si trebuie neaparat folderul 'csdm' sa-l adaugati in configs/ altfel spawn-ul random nu va merge
Daca nu vreti sa dea respawn-ul random ( la intamplare ) atunci luati doar sursa
L-am facut acum e proaspat luatil | Afiseaza codul
/* Credits ZP random spawn csdm
*/
#include <amxmisc>
#include fun
#include <cstrike>
#include fakemeta
#include <hamsandwich>

#pragma semicolon 1;

new warmup_during = 60; // secundele de durata la WarmUp

new const szTag[] = "Xtreme.Indungi.Ro";

new w_up, g_spawnCount, g_spawnCount2, cvar_random_spawn;
const MAX_CSDM_SPAWNS = 128;
new Float:g_spawns[MAX_CSDM_SPAWNS][3], Float:g_spawns2[MAX_CSDM_SPAWNS][3]; // spawn points data

public plugin_init( ) {

	register_plugin( "Advanced Warm UP", "V1.0", "alkaline aka lucy" );

	RegisterHam( Ham_Spawn, "player", "Spawn", 1 );
	RegisterHam( Ham_Killed, "player", "Killed" );

	register_forward( FM_PlayerPreThink, "Freeze" );

	register_event( "HLTV", "WarmUP_Start", "a", "1=0", "2=0" );

	w_up = 1;
	set_task( 120.0, "Warm_Over", 2014 );
	set_task( 1.0, "CountDown",2014,_,_,"b",_);

	cvar_random_spawn = register_cvar( "warm_random_respawn", "0" );

	if( get_pcvar_num( cvar_random_spawn ) == 1 )
		load_spawns();
}

public WarmUP_Start( ) {

	if( w_up ) {
		new map[33], hostname[33];
		get_mapname( map, sizeof map - 1);
		get_user_name( 0, hostname, sizeof hostname -1 );

		Color( 0, "!4[%s] !1Welcome to !3%s !1!", szTag, hostname );
		Color( 0, "!4[%s] !1Loading environment for map !3%s !1!", szTag, map );
		Color( 0, "!4[%s] !1Prepairing Teams for Play!", szTag );
		Color( 0, "!4[%s] !1...:: !4GL & HF ! !1::...", szTag );
	}
}

public Spawn( id ) {

	if( w_up ) {

		if( get_pcvar_num( cvar_random_spawn ) == 1 )
			random_spawn(id);
		//else
		//random_spawn(id, 1);
	
		set_task( 5.0, "CheckUMoney", id, _, _, "b" );
	}

}


public CountDown()
{
	set_hudmessage( 255, 255, 255, 0.03, 0.17, 0, 6.0, 1.0, 0.1, 0.1, 2);
	show_hudmessage( 0, "Runda de Incalzire: %d secund%s ramas%s.", warmup_during , warmup_during > 1 ? "e" : "a", warmup_during > 1 ? "e" : "a");

	warmup_during--;
	if( warmup_during <= 0) {

		if( task_exists(2014) )
			remove_task(2014);
		w_up = 0;
		set_hudmessage( 255, 255, 255, 0.03, 0.17, 0, 6.0, 1.0, 0.1, 0.1, 2);
		show_hudmessage( 0, "Runda de Incalzire s-a terminat.");
		Color( 0, "!4[%s] !1WarmUP a luat sfarsit", szTag );
		Color( 0, "!4[%s] !1...:: !4GL & HF ! !1::...", szTag );
		server_cmd("sv_restart 1");
		return;
	}
}
public Warm_Over()
	w_up = 0;

public Killed( id, attacker, shouldgib ) {

	if( !is_user_connected( id ) )
		return;

	if( w_up )
		set_task( 3.0, "Respawn", id);

}	
public Respawn( id ) {
	
	if( w_up ) {
		ExecuteHamB( Ham_CS_RoundRespawn, id );	
		Color(id, "!4[%s] !1Ai fost respawnat.",szTag);
	}
}

public CheckUMoney( id ) {

	if( !is_user_alive( id ) ) return;

	if( 1<=id<=32 && w_up  ) {

		new moneyu = 16000;

		//new setmoney = cs_get_user_money(id) - 500;
		//cs_set_user_money(id, clamp(16000, 800, 16000));

		if( cs_get_user_money(id) < moneyu ) {
			cs_set_user_money(id,  min( moneyu, moneyu ) );
		}else
		if( cs_get_user_money(id) >= moneyu ) {
			if( task_exists(id) )
				remove_task( id );
			cs_set_user_money(id,  min( moneyu, moneyu ) );	
			set_task( 5.0, "CheckUMoney", id, _, _, "b" );
			return;				
		}
		
	}
}

public Freeze(id) {

	if(!is_user_alive(id) || !w_up)
		return;
		
	if( warmup_during < 4 && warmup_during > 0) {

		if( 1<=id<=32 ) {
			set_user_maxspeed( id, 1.0 );
			set_user_godmode( id, 1);
		}
	}
}


random_spawn(id, regularspawns = 0) {
	static hull, sp_index, i;
	
	hull = ( pev( id, pev_flags ) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN ;
	if ( !regularspawns )
	{
		if (!g_spawnCount)
			return;
		
		sp_index = random_num(0, g_spawnCount - 1);
		
		for (i = sp_index + 1;; i++)
		{
			if (i >= g_spawnCount) i = 0;
			
			if (is_hull_vacant(g_spawns, hull))
			{
				engfunc(EngFunc_SetOrigin, id, g_spawns);
				break;
			}
			if (i == sp_index) break;
		}
	}
	else {
		if (!g_spawnCount2)
			return;
		
		sp_index = random_num(0, g_spawnCount2 - 1);
		
		for (i = sp_index + 1; ; i++)
		{
			if (i >= g_spawnCount2) i = 0;
			
			if (is_hull_vacant(g_spawns2, hull))
			{
				engfunc(EngFunc_SetOrigin, id, g_spawns2);
				break;
			}
			if (i == sp_index) break;
		}
	}
}
stock load_spawns()
{
	// Check for CSDM spawns of the current map
	new cfgdir[32], mapname[32], filepath[100], linedata[64];
	get_configsdir(cfgdir, charsmax(cfgdir));
	get_mapname(mapname, charsmax(mapname));
	formatex(filepath, charsmax(filepath), "%s/csdm/%s.spawns.cfg", cfgdir, mapname);
	
	// Load CSDM spawns if present
	if (file_exists(filepath))
	{
		new csdmdata[10][6], file = fopen(filepath,"rt");
		
		while (file && !feof(file))
		{
			fgets(file, linedata, charsmax(linedata));
			
			// invalid spawn
			if (!linedata[0] || str_count(linedata,' ') < 2) continue;
			
			// get spawn point data
			parse(linedata,csdmdata[0],5,csdmdata[1],5,csdmdata[2],5,csdmdata[3],5,csdmdata[4],5,csdmdata[5],5,csdmdata[6],5,csdmdata[7],5,csdmdata[8],5,csdmdata[9],5);
			
			// origin
			g_spawns[g_spawnCount][0] = floatstr(csdmdata[0]);
			g_spawns[g_spawnCount][1] = floatstr(csdmdata[1]);
			g_spawns[g_spawnCount][2] = floatstr(csdmdata[2]);
			
			// increase spawn count
			g_spawnCount++;
			if (g_spawnCount >= sizeof g_spawns) break;
		}
		if (file) fclose(file);
	}
	else
	{
		// Collect regular spawns
		collect_spawns_ent("info_player_start");
		collect_spawns_ent("info_player_deathmatch");
	}
	
	// Collect regular spawns for non-random spawning unstuck
	collect_spawns_ent2("info_player_start");
	collect_spawns_ent2("info_player_deathmatch");
}

// Collect spawn points from entity origins
stock collect_spawns_ent(const classname[])
{
	new ent = -1;
	while ((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", classname)) != 0)
	{
		// get origin
		new Float:originF[3];
		pev(ent, pev_origin, originF);
		g_spawns[g_spawnCount][0] = originF[0];
		g_spawns[g_spawnCount][1] = originF[1];
		g_spawns[g_spawnCount][2] = originF[2];
		
		// increase spawn count
		g_spawnCount++;
		if (g_spawnCount >= sizeof g_spawns) break;
	}
}

// Collect spawn points from entity origins
stock collect_spawns_ent2(const classname[])
{
	new ent = -1;
	while ((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", classname)) != 0)
	{
		// get origin
		new Float:originF[3];
		pev(ent, pev_origin, originF);
		g_spawns2[g_spawnCount2][0] = originF[0];
		g_spawns2[g_spawnCount2][1] = originF[1];
		g_spawns2[g_spawnCount2][2] = originF[2];
		
		// increase spawn count
		g_spawnCount2++;
		if (g_spawnCount2 >= sizeof g_spawns2) break;
	}
}
stock str_count(const str[], searchchar)
{
	new count, i, len = strlen(str);
	
	for (i = 0; i <= len; i++)
	{
		if (str == searchchar)
			count++;
	}
	
	return count;
}
stock is_hull_vacant(Float:origin[3], hull)
{
	engfunc(EngFunc_TraceHull, origin, origin, 0, hull, 0, 0);
	
	if (!get_tr2(0, TR_StartSolid) && !get_tr2(0, TR_AllSolid) && get_tr2(0, TR_InOpen))
		return true;
	
	return false;
}
stock Color(const id, const input[], any:...) {
	new count = 1, players[32];
	static msg[191];
	vformat(msg, 190, input, 3);
	replace_all(msg, 190, "!4", "^4");
	replace_all(msg, 190, "!1", "^1");
	replace_all(msg, 190, "!3", "^3");
	/* This plugin created by alkaline aka lucy */
	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();
			}
		}
	}
}
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

11 Aug 2014, 07:18

| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <fun>
#include <hamsandwich>

new g_warmup = 120, g_saytext, bool:g_firstspawn[33], g_maxplayers, g_msg_fadescreen, g_msg_shakescreen;

public plugin_init()
{
	register_plugin("Advanced WarmUp System", "1.0", "cyby")
	
	RegisterHam(Ham_Spawn, "player", "spawn_post", 1)
	RegisterHam(Ham_Killed, "player", "player_killed")
	register_forward(FM_PlayerPreThink, "prethink_player")
	register_event("HLTV", "start_round", "a", "1=0", "2=0")
	
	set_task(1.0, "count_down_warmup", 0xFFFFFA8008BB7B30, _, _, "b")
	g_saytext = get_user_msgid("SayText");
	g_msg_fadescreen = get_user_msgid("ScreenFade");
	g_msg_shakescreen = get_user_msgid("ScreenShake");
	g_maxplayers = get_maxplayers();
}

public count_down_warmup()
{
	switch(g_warmup)
	{
		case 1 .. 1000:
		{
			set_dhudmessage(0, 212, 255, 0.0, 0.18, 1, 1.1, 1.0, 0.0, 0.0)
			show_dhudmessage(0, "WarmUp Round Ends In: %d second%s", g_warmup, g_warmup > 1 ? "s" : "")
			if(g_warmup <= 3 && g_warmup > 0)
			{
				for(new id = 1; id < g_maxplayers; id++)
				{
					if(!is_user_connected(id))
						continue;
						
					effect_ss(id)
					effect_sf(id, 0.5, random_num(100, 250), random_num(100, 250), random_num(100, 250), 250)
					client_cmd(id, "spk vox/%s", numar_scris(g_warmup))
				}
			}
		}
		case 0:
		{
			set_dhudmessage(0, 212, 255, 0.0, 0.18, 1, 1.1, 1.0, 0.0, 0.0)
			show_dhudmessage(0, "WarmUp End.^nServer is restarted.")
			for(new id = 1; id < g_maxplayers; id++)
			{
				if(!is_user_connected(id))
					continue;
					
				effect_ss(id)
				effect_sf(id, 2.5, random_num(100, 250), random_num(100, 250), random_num(100, 250), 250)
			}
		}
		case -1:
		{
			set_cvar_num("sv_restart", 1)
			remove_task(0xFFFFFA8008BB7B30)
			g_warmup = 0 // in caz de face faze gay
			set_cvar_float("mp_buytime", 0.3)
			return 1;
		}
	}
	g_warmup--
	return 0;
}

public start_round()
{
	if(g_warmup > 0)
	{
		static map[32];
		get_mapname(map, charsmax(map) - 1)
		color(0, ".e Welcome to.v XTREME.INDUNGI.RO # HIGH FPS SERVER")
		color(0, ".e Loading environment for map.e %s", map)
		color(0, ".e Prepairing teams for play !")
		color(0, ".e Game Started..v Go Go Go !!!")
	}
}

public spawn_post(id)
{
	if(!is_user_alive(id) || !g_warmup)
		return;
		
	set_cvar_float("mp_buytime", 0.0)
	cs_set_user_money(id, 16000)
	if(g_firstspawn[id])
		g_firstspawn[id] = false
}

public player_killed(victim)
	set_task(0.7, "plrespawn", victim)

public plrespawn(id)
{
	if(!is_user_connected(id) || is_user_alive(id) || !g_warmup)
		return;
		
	ExecuteHamB(Ham_CS_RoundRespawn, id)
	set_user_godmode(id, 1)
	static red, blue;
	switch(get_user_team(id))
	{
		case 1: red = 200, blue = 0;
		case 2: red = 0, blue = 200;
	}
	set_user_rendering(id, kRenderFxGlowShell, red, 0, blue, kRenderNormal, 18)
	set_task(2.0, "remove_godmode", id)
	if(g_firstspawn[id])
		g_firstspawn[id] = false
}

public remove_godmode(id)
{
	if(!is_user_alive(id) || !g_warmup)
		return;
		
	set_user_godmode(id, 0)
	set_user_rendering(id)
}

public prethink_player(id)
{
	if(!is_user_alive(id) || !g_warmup)
		return;
		
	if(g_warmup < 3 && g_warmup > -1)
		set_pev(id, pev_maxspeed, 1.0)
}

public client_putinserver(id)
{
	set_task(1.0, "check_team", id, _, _, "b")
	g_firstspawn[id] = true
}

public check_team(id)
{
	if(!g_warmup || is_user_alive(id) || !is_user_connected(id) || !g_firstspawn[id])
	{
		remove_task(id)
		return 1;
	}
	
	if(g_firstspawn[id] && (get_user_team(id) == 1 || get_user_team(id) == 2) && !is_user_alive(id))
	{
		set_task(0.2, "plrespawn", id)
		remove_task(id)
	}
	return 1;
}

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, g_saytext, _, players)
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}

public effect_ss(id)
{
	if(!is_user_connected(id))
		return;
	
	message_begin(MSG_ONE_UNRELIABLE, g_msg_shakescreen, _, id)
	write_short(1<<14)
	write_short((1<<12)*6)
	write_short(1<<14)
	message_end()
}

public effect_sf(id, const Float:seconds, const red, const green, const blue, const alpha)
{
	if(!is_user_connected(id))
		return;
	
	message_begin(MSG_ONE_UNRELIABLE, g_msg_fadescreen, _, id)
	write_short(floatround(4096.0 * seconds, floatround_round))
	write_short(floatround(4096.0 * seconds, floatround_round))
	write_short(0x0000)
	write_byte(red)
	write_byte(green)
	write_byte(blue)
	write_byte(alpha)
	message_end()
}

stock __dhud_color;
stock __dhud_x;
stock __dhud_y;
stock __dhud_effect;
stock __dhud_fxtime;
stock __dhud_holdtime;
stock __dhud_fadeintime;
stock __dhud_fadeouttime;
stock __dhud_reliable;

stock set_dhudmessage( red = 0, green = 160, blue = 0, Float:x = -1.0, Float:y = 0.65, effects = 2, Float:fxtime = 6.0, Float:holdtime = 3.0, Float:fadeintime = 0.1, Float:fadeouttime = 1.5, bool:reliable = false )
{
    #define clamp_byte(%1)       ( clamp( %1, 0, 255 ) )
    #define pack_color(%1,%2,%3) ( %3 + ( %2 << 8 ) + ( %1 << 16 ) )

    __dhud_color       = pack_color( clamp_byte( red ), clamp_byte( green ), clamp_byte( blue ) );
    __dhud_x           = _:x;
    __dhud_y           = _:y;
    __dhud_effect      = effects;
    __dhud_fxtime      = _:fxtime;
    __dhud_holdtime    = _:holdtime;
    __dhud_fadeintime  = _:fadeintime;
    __dhud_fadeouttime = _:fadeouttime;
    __dhud_reliable    = _:reliable;

    return 1;
}

stock show_dhudmessage( index, const message[], any:... )
{
    new buffer[ 128 ];
    new numArguments = numargs();

    if( numArguments == 2 )
    {
        send_dhudMessage( index, message );
    }
    else if( index || numArguments == 3 )
    {
        vformat( buffer, charsmax( buffer ), message, 3 );
        send_dhudMessage( index, buffer );
    }
    else
    {
        new playersList[ 32 ], numPlayers;
        get_players( playersList, numPlayers, "ch" );

        if( !numPlayers )
        {
            return 0;
        }

        new Array:handleArrayML = ArrayCreate();

        for( new i = 2, j; i < numArguments; i++ )
        {
            if( getarg( i ) == LANG_PLAYER )
            {
                while( ( buffer[ j ] = getarg( i + 1, j++ ) ) ) {}
                j = 0;

                if( GetLangTransKey( buffer ) != TransKey_Bad )
                {
                    ArrayPushCell( handleArrayML, i++ );
                }
            }
        }

        new size = ArraySize( handleArrayML );

        if( !size )
        {
            vformat( buffer, charsmax( buffer ), message, 3 );
            send_dhudMessage( index, buffer );
        }
        else
        {
            for( new i = 0, j; i < numPlayers; i++ )
            {
                index = playersList[ i ];

                for( j = 0; j < size; j++ )
                {
                    setarg( ArrayGetCell( handleArrayML, j ), 0, index );
                }

                vformat( buffer, charsmax( buffer ), message, 3 );
                send_dhudMessage( index, buffer );
            }
        }

        ArrayDestroy( handleArrayML );
    }

    return 1;
}

stock send_dhudMessage( const index, const message[] )
{
    message_begin( __dhud_reliable ? ( index ? MSG_ONE : MSG_ALL ) : ( index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST ), SVC_DIRECTOR, _, index );
    {
        write_byte( strlen( message ) + 31 );
        write_byte( DRC_CMD_MESSAGE );
        write_byte( __dhud_effect );
        write_long( __dhud_color );
        write_long( __dhud_x );
        write_long( __dhud_y );
        write_long( __dhud_fadeintime );
        write_long( __dhud_fadeouttime );
        write_long( __dhud_holdtime );
        write_long( __dhud_fxtime );
        write_string( message );
    }
    message_end();
}

stock numar_scris(input)
{
	static numar[10];
	switch(input)
	{
		case 1: formatex(numar, charsmax(numar) - 1, "one")
		case 2: formatex(numar, charsmax(numar) - 1, "two")
		case 3: formatex(numar, charsmax(numar) - 1, "three")
	}
	return numar;
}


L-am fixat.
93.114.82.17:27015 - Monster Invasion CO-OP Mod
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests