Modificare plugin Mix

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
eGRoBi
Membru, skill 0
Membru, skill 0
Posts: 28
Joined: 19 Feb 2017, 13:43
Detinator Steam: Da
CS Status: You have to learn the rules of the game.
SteamID: STEAM_0:0:63287599
Fond eXtream: 0
Contact:

14 Jun 2020, 15:57

Salut am pluginul asta de mix si as vrea sa ii adaug respawn cand este warm, ma puteti ajuta?
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <regex>
#include <cstrike>
#include <colorchat>
#include <hamsandwich>

#define SEMI_ACE 4
#define MAX_PLAYERS 32
#define MAXINPUT 7
#define SANITARY "abcdefg"
#define LAST_MAPS_SAVE 3
#define MAX_NAME_LENGTH 32
#define MAX_TEXT_LENGTH 192
new bool:g_restart_attempt[MAX_PLAYERS + 1]
new amx_show_activity
new hitbox_bit
new g_max_players, g_sync_creat_statustext, g_sync_creat_list
new bool:g_teammate[33]
new cvar_plugin_on
new cvar_status_on
new szName[ 32 ];


static const

TAG[ ] =		"[STARCS]"


new teamA = 0
new teamA1 = 0
new teamB = 0
new teamB1 = 0
new StarCson = 0
new schimbate = 0
new roundnumber = 0
new Atsround
new adminId
new bool:g_bUsersCanChat = true;
new maxscreens
new screeninterval
new design;
new player
new ip[32]
new finish
new g_iFrags[33]
new iForward
new gSaveFile[64];
new gLastMapName[LAST_MAPS_SAVE][32];
new gLastMapTime[LAST_MAPS_SAVE];
new gNumLastMaps;
new authid[32]
new name[32]




public plugin_init()
{
	
	/// Demo
	register_concmd("amx_demo","demo",ADMIN_BAN,"<name> - takes a demo of a client")
	register_concmd("amx_stopdemo","stopdemo",ADMIN_BAN,"<name> - stops the demo taken")
	
	// Warm
	register_clcmd("say /warm", "warm", ADMIN_KICK)
	register_clcmd("say_team /warm", "warm", ADMIN_KICK)

	
	
	/// PRELUNGIRI
	register_clcmd("say /prelungiri", "prelungiri", ADMIN_KICK)
    register_clcmd("say_team /prelungiri", "prelungiri", ADMIN_KICK)

	
	
	
	/// RESTART
	register_clcmd("say /restart", "restart", ADMIN_KICK)
	register_clcmd("say_team /restart", "knife", ADMIN_KICK)
	
	/// KNIFE
	register_clcmd("say /knife", "knife", ADMIN_KICK)
	register_clcmd("say_team /knife", "knife", ADMIN_KICK)

	
	
	/// blocare
	register_clcmd( "say /off", "ClCmdSayBlocare" );
	register_clcmd( "say /on", "ClCmdSayDeBlocare" );
	register_clcmd( "say_team /on", "ClCmdSayDeBlocare" );
	register_clcmd( "say_team /off", "ClCmdSayBlocare" );
	register_clcmd( "say", "ClCmdSay" );
	
	///Ss
	register_concmd("amx_ss", "concmd_screen", ADMIN_LEVEL_A, "<authid, nick or #userid> <screens>")
	register_clcmd("say /ip", "show_ip")
	maxscreens = register_cvar("amx_ss_max", "5")
	screeninterval = register_cvar("amx_ss_interval", "1.0")
	design = register_cvar("amx_ss_design", "3")
	
	
	/// Hitbox
	register_event("ResetHUD", "event_hud_reset", "be")
	register_event("TextMsg", "event_restart_attempt", "a", "2=#Game_will_restart_in")
	register_clcmd("fullupdate", "clcmd_fullupdate") 
	register_concmd("amx_hsonly", "admin_set_hitbox", ADMIN_KICK, "<0|a|b|c|d|e|f|g> - Set hitboxes. Letters equal the body part, can combine letters.")
	hitbox_bit = register_cvar("hitbox_bit", "255")
	amx_show_activity = get_cvar_pointer("amx_show_activity")
	
	
	// Start StarCs
	register_clcmd("say /start", "startStarCs", ADMIN_KICK)
	register_clcmd("say_team /start", "startStarCs", ADMIN_KICK)

	
	/// STOP StarCs
	register_clcmd("say /stop", "stopStarCs", ADMIN_KICK)
	register_clcmd("say_team /stop", "stopStarCs", ADMIN_KICK)
	
	
	
	//Autoswitch teams
	register_logevent( "roundend", 2, "1=Round_End" );
	register_event( "TextMsg","restart","a","2&#Game_C", "2&#Game_W" ); // Event for "Game Commencing" TextMsg and "Game Will Restart in X Seconds" TextMsg
	
	Atsround = register_cvar( "amx_atsrounds", "15" );
	
	
	
	
	// Score

	register_clcmd("say .score", "scor", ADMIN_KICK)
	register_clcmd("say_team .score", "scor", ADMIN_KICK)
	
	/// Interp
	
	register_clcmd("say /interp", "interp", ADMIN_KICK)
	register_clcmd("say_team /interp", "interp", ADMIN_KICK)

	
	
	register_event("HLTV", "new_round", "a", "1=0", "2=0")  
	register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
	register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")  
	
	
	/// comenzi
	register_clcmd("say /comenzi", "comenzi", ADMIN_KICK)
	register_clcmd("say_team /comenzi", "comenzi", ADMIN_KICK)

	
	
	
	//// ACE
	
	register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );
	register_event( "DeathMsg", "EventDeathMsg", "a" );
	
	register_logevent( "LogEventRoundEnd", 2, "1=Round_End" );
	
	iForward  = CreateMultiForward( "FwdPlayerDidAceOrSemi", ET_STOP, FP_CELL, FP_CELL );
	
	//// TEAM MONEY
	
	
	RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
	
	register_clcmd("say /money", "clcmd_money")
	

	
	register_event("StatusValue", "show_teammate_money", "be", "1=2", "2!0")
	register_event("StatusValue", "set_team", "be", "1=1")
	
	cvar_plugin_on = register_cvar("stm_on", "1")
	cvar_status_on = register_cvar("stm_st_on", "1")
	
	g_max_players = get_maxplayers()
	g_sync_creat_statustext = CreateHudSyncObj()
	g_sync_creat_list = CreateHudSyncObj()
	
	////////////Specall
	register_concmd("amx_ct", "cmdct", ADMIN_SLAY, "NUME : Transfera jucatorul la echipa Counter/Terror");
	register_concmd("amx_t", "cmdt", ADMIN_SLAY, "NUME : Transfera jucatorul la echipa Terror");
	register_concmd("amx_spec", "cmdspec", ADMIN_SLAY, "NUME : Transfera jucatorul la Spectator");
	register_clcmd("say /specall", "cmd_spec", ADMIN_KICK, "All players spec");

	
	
	
	////// amx chat
	register_clcmd("say","admin_slash",0,"say /command < params >")
	register_clcmd("say_team","admin_slash",0,"say /command < params >")
	
	/////PASS SI NOPASS
	register_concmd("amx_pass", "pass", ADMIN_BAN, "- Sets a server password")
	register_concmd("amx_password", "pass", ADMIN_BAN, "- Sets a server password")
	register_concmd("amx_parola", "pass", ADMIN_BAN, "- Sets a server password")
	register_concmd("amx_nopass", "nopass", ADMIN_BAN, "- Removes the server password")
	register_concmd("amx_removepassword", "nopass", ADMIN_BAN, "- Removes the server password")
	
	
	
	/////HARTI
	register_clcmd("say /last", "CmdLastMaps");
	register_clcmd("say /harti", "CmdLastMaps");

	
	get_datadir(gSaveFile, charsmax(gSaveFile));
	add(gSaveFile, charsmax(gSaveFile), "lastmaps.txt");
	
	new f = fopen(gSaveFile, "rt");
	
	if(f) {
		new line[64], minutes[12];
		
		while(!feof(f) && gNumLastMaps < LAST_MAPS_SAVE) {
			fgets(f, line, charsmax(line));
			trim(line);
			
			if(line[0]) {
				parse(line, gLastMapName[gNumLastMaps], charsmax(gLastMapName[]), minutes, charsmax(minutes));
				gLastMapTime[gNumLastMaps++] = str_to_num(minutes);
			}
		}
		
		fclose(f);
	}
	
	
}


public t_win() {
	if ( schimbate == 0 ) {
		teamA = teamA+1
	}
	else {
		teamB = teamB +1	
	}
}

public ct_win() {
	if ( schimbate == 0 ) {
		teamB  = teamB +1
	}
	else {
		teamA = teamA +1
	}
	
}

public new_round(){
	if ( StarCson == 1)
	{
		if (schimbate == 0) {
			
			if ( teamA > teamB ) {
				
				ColorChat(0, RED, "[STARCS] ^x01 Scorul este ^x04 %d - %d pentru echipa T", teamA,teamB );
			}
			if ( teamB > teamA ) {
				ColorChat(0, RED, "[STARCS] ^x01 Scorul este ^x04 %d - %d pentru CT", teamB ,teamA);
			}
			if ( teamB == teamA ) {
				ColorChat(0, RED, "[STARCS] ^x01 Scorul este ^x04 %d - %d (egalitate)", teamB ,teamA);
			}	
		}
		
		if ( schimbate == 1 )
		{			
			if ( teamA == 16 || teamB == 16) {
				if ( teamA > teamB ) {
					
					ColorChat(0, RED, "[STARCS] ^x01 Mix-ul a fost castigat de echipa ^x04 CT");
					ColorChat(0, RED, "[STARCS] ^x01 Scorul fiind: ^x04 %d - %d ",teamA, teamB);
					ColorChat(0, RED, "[STARCS] ^x01 Tasteaza !harti in chat pentru a vedea ultimele 3 harti jucate.",teamA, teamB);
					
					
					
					StarCson = 0
					schimbate = 0
					set_cvar_string ( "sv_restart", "1" );
				}
				
				if ( teamB > teamA ) {
					ColorChat(0, RED, "[STARCS] ^x01 Mix-ul a fost castigat de echipa ^x04 T");
					ColorChat(0, RED, "[STARCS] ^x01 Scorul fiind: ^x04 %d - %d ",teamB,teamA);
					ColorChat(0, RED, "[STARCS] ^x01 Tasteaza !harti in chat pentru a vedea ultimele 3 harti jucate.",teamA, teamB);
					
					
					
					StarCson = 0
					schimbate = 0
					set_cvar_string ( "sv_restart", "1" );
					set_cvar_string ( "mp_freezetime", "0" );
					set_cvar_string ( "mp_startmoney", "16000" );
					set_cvar_string ( "mp_roundtime", "9999" );
				}
				} else {
				if ( teamA > teamB ) {
					ColorChat(0, RED, "[STARCS] ^x01 Scorul este ^x04 %d - %d pentru CT",teamA,teamB );
				}
				if ( teamB > teamA ) {
					ColorChat(0, RED, "[STARCS] ^x01 Scorul este ^x04 %d - %d pentru T",teamB ,teamA);
				}
				if ( teamB == teamA ) {
					ColorChat(0, RED, "[STARCS] ^x01 Scorul este ^x04 %d - %d (egalitate)",teamB ,teamA);
				}
			}
			
		}
	}
}


public client_disconnect(id){
	if (get_playersnum() == 0)
		set_cvar_string("sv_password", "");
}

public warm(id){
	
	
	if(!is_user_admin(id) && ADMIN_KICK)
	{
		client_print(id, print_chat, "Ai nevoie de admin pentru aceasta comanda.")
		
		return PLUGIN_HANDLED
	}
	else {
		
		
		
		set_cvar_string ( "sv_restart", "2" );
		set_cvar_string ( "mp_freezetime", "0" );
		set_cvar_string ( "mp_startmoney", "16000" );
		set_cvar_string ( "mp_friendlyfire", "0" );
		set_cvar_string ( "amx_atsrounds", "100" );
	
		
		
		
		StarCson = 0;
		schimbate = 0;
		teamA = 0
		teamB = 0
		teamA1 = 0
		teamB1= 0
		roundnumber = 0
		
		
		get_user_name( id, szName, sizeof ( szName ) -1 );
		ColorChat(0, RED, "[STARCS] ^x01Rundele de incalzire au fost pornite. -^x04%s^x01 ", szName );
		
		
		
		
		
		
	}
	return PLUGIN_HANDLED
}

public stopStarCs(id){
	
	
	if(!is_user_admin(id) && ADMIN_KICK)
	{
		client_print(id, print_chat, "Ai nevoie de admin pentru aceasta comanda.")
		
		return PLUGIN_HANDLED
	}
	else {
		
		
		
		set_cvar_string ( "sv_restart", "1" );
		set_cvar_string ( "mp_freezetime", "0" );
		set_cvar_string ( "mp_startmoney", "16000" );
		set_cvar_string ( "mp_friendlyfire", "0" );
		set_cvar_string ( "amx_atsrounds", "100" );
		set_cvar_string ( "mp_roundtime", "9999" );
		
		
		
		StarCson = 0;
		schimbate = 0;
		teamA = 0
		teamB = 0
		teamA1 = 0
		teamB1= 0
		roundnumber = 0
		
		get_user_name( id, szName, sizeof ( szName ) -1 );		
		ColorChat(0, RED, "[STARCS] ^x01 Mix-ul a fost oprit. -^x04%s^x01", szName );
		
		
		
		
		
		
	}
	return PLUGIN_HANDLED
}

public prelungiri(id){
	
	if(!is_user_admin(id) && ADMIN_KICK)
	{
		client_print(id, print_chat, "Ai nevoie de admin pentru aceasta comanda.")
		
		return PLUGIN_HANDLED
	}
	else {
		
		
		
		set_cvar_string ( "sv_restart", "5" );
		set_cvar_string ( "mp_freezetime", "6" );
		set_cvar_string ( "mp_startmoney", "10000" );
		set_cvar_string ( "mp_friendlyfire", "1" );
		set_cvar_string ( "amx_atsrounds", "3" );
		set_cvar_string ( "mp_buytime", "0.25" );

		
		
		StarCson = 1;
		if (schimbate == 0) 
		{
			teamA = teamA1
			teamB = teamB1
			roundnumber = 0
			} else {
			schimbate = 0;
			teamA = 0
			teamB = 0
			teamA1 = 0
			teamB1= 0
			roundnumber = 0
		}
		
		
		get_user_name( id, szName, sizeof ( szName ) -1 );		
		ColorChat(0, RED, "[STARCS] ^x01 Prelungirile vor porni in 5 secunde. -^x04%s^x01 ", szName );
	}
	return PLUGIN_HANDLED
}




public restart( id ){
	
	if(!is_user_admin(id) && ADMIN_KICK)
	{
		client_print(id, print_chat, "Tasteaza !comenzi in chat pentru mai multe informatii!")
		
		roundnumber = 0;
		return PLUGIN_HANDLED
	}
	else {
		set_cvar_string ( "sv_restart", "1" );
		StarCson = 1;
		if (schimbate == 1) 
		{
			teamA = teamA1
			teamB = teamB1
			roundnumber = 0
			} else {
			schimbate = 0;
			teamA = 0
			teamB = 0
			teamA1 = 0
			teamB1= 0
			roundnumber = 0
		}
		
	}
	return PLUGIN_HANDLED
}

public knife(id){
	
	
	if(!is_user_admin(id) && ADMIN_KICK)
	{
		client_print(id, print_chat, "Ai nevoie de admin pentru aceasta comanda.")	
		
		return PLUGIN_HANDLED
	}
	else {
		
		
		
		set_cvar_string ( "sv_restart", "2" );
		set_cvar_string ( "mp_freezetime", "0" );
		set_cvar_string ( "mp_startmoney", "16000" );
		set_cvar_string ( "mp_friendlyfire", "0" );
		set_cvar_string ( "amx_atsrounds", "100" );
	
		
		
		StarCson = 0;
		schimbate = 0;
		teamA = 0
		teamB = 0
		teamA1 = 0
		teamB1= 0
		roundnumber = 0
		
		get_user_name( id, szName, sizeof ( szName ) -1 );		
		ColorChat(0, RED, "[STARCS] ^x01 Rundele de cutite au fost pornite. -^x04%s^x01 ", szName );
		
		
		
		
		
		
	}
	return PLUGIN_HANDLED
}

public startStarCs(id){
	
	if(!is_user_admin(id) && ADMIN_KICK)
	{
		client_print(id, print_chat, "Ai nevoie de admin pentru aceasta comanda.")
		
		
		return PLUGIN_HANDLED
	}
	else {
		
		
		set_cvar_string ( "sv_restart", "5" );
		set_cvar_string ( "mp_freezetime", "9" );
		set_cvar_string ( "mp_startmoney", "800" );
		set_cvar_string ( "mp_friendlyfire", "1" );
		set_cvar_string ( "mp_roundtime", "1.75" );
		set_cvar_string ( "mp_timelimit", "0" );
		set_cvar_string ( "mp_forchasecam", "2" );
		set_cvar_string ( "mp_buytime", "0.25" );
		set_cvar_string ( "mp_c4timer", "35" );
		set_cvar_string ( "amx_atsrounds", "15" );
	
		
		
		
		
		
		StarCson = 1;
		if (schimbate == 1) 
		{
			teamA = teamA1
			teamB = teamB1
			roundnumber = 0
			} else {
			schimbate = 0;
			teamA = 0
			teamB = 0
			teamA1 = 0
			teamB1= 0
			roundnumber = 0
		}
		
		
		get_user_name( id, szName, sizeof ( szName ) -1 );		
		ColorChat(0, RED, "[STARCS] ^x01 Mix-ul va porni in 5 secunde. -^x04%s^x01 ", szName );
		
		
		
		
	}
	return PLUGIN_HANDLED
}

public interp(id){
	
	if(!is_user_admin(id) && ADMIN_BAN)
	{
		client_print(id, print_chat, "Ai nevoie de admin pentru a avea acces la aceasta comanda.")
		
		
		return PLUGIN_HANDLED
		} else {
		client_cmd(0, "ex_interp 0.01");
		client_cmd(0, "rate 25000");
		client_cmd(0, "cl_updaterate 101");
		client_cmd(0, "cl_cmdrate 101");
		client_cmd(0, "fps_max 101");
		
		ColorChat(0,RED, "[STARCS] ^x01S-a setat interp-ul. Jucatorii pot verifica tastand !setari in chat (consola)")
		
	}
	return PLUGIN_HANDLED
}

public roundend()
{
	roundnumber++;
	
	if (schimbate == 1 && roundnumber == 31)
	{
		ColorChat(0, RED, "[STARCS] ^x01Echipele au reusit sa aduca scorul la egal ^x04 15 - 15 ");
		
		
		StarCson = 0
		schimbate = 0
		set_cvar_string ( "sv_restart", "1" );
	}
	else if( roundnumber >= get_pcvar_num( Atsround ) )
	{
		new players[32], num;
		get_players( players, num );
		
		for( new i; i < num; i++ )
			add_delay( players ); // Prevent Server Crash with a lot of people.
		
	}
}

add_delay( id )
{
switch( id )
{
	case 1..7: set_task( 0.1, "changeTeam", id );
		case 8..15: set_task( 0.2, "changeTeam", id );
			case 16..23: set_task( 0.3, "changeTeam", id );
			case 24..32: set_task( 0.4, "changeTeam", id );
		}
}

public changeTeam( id )
{
	switch( cs_get_user_team( id ) )
	{
		case CS_TEAM_CT: cs_set_user_team( id, CS_TEAM_T );
			
		case CS_TEAM_T: cs_set_user_team( id, CS_TEAM_CT );
		}
	
	roundnumber = 0;
	schimbate = 1
	teamA1 = teamA
	teamB1 = teamB
	
	ColorChat(0, RED, "[STARCS] ^x01 Echipele s-au schimbat intre ele ");
	set_cvar_string ( "sv_restart", "1" );
	
}




public scor(id){
	
	if ( StarCson == 1 )
	{
		if (schimbate == 0) {
			
			if ( teamA > teamB ) {
				ColorChat(id, RED, "^x03 Scorul este %d - %d pentru ^x04 T",teamA,teamB );
			}
			if ( teamB > teamA ) {
				ColorChat(id, RED, "^x03 Scorul este %d - %d pentru ^x04 CT",teamB ,teamA);
			}
			if ( teamB == teamA ) {
				ColorChat(id, RED, "^x03 Scorul este %d - %d ^x04 (EGAL)",teamB ,teamA);
			}	
			} else {
			if ( teamA > teamB ) {
				ColorChat(id, RED, "^x03 Scorul este %d - %d pentru ^x04CT",teamA,teamB );
			}
			if ( teamB > teamA ) {
				ColorChat(id, RED, "^x03 Scorul este %d - %d pentru ^x04T",teamB ,teamA);
			}
			if ( teamB == teamA ) {
				ColorChat(id, RED, "^x03 Scorul este %d - %d ^x04 (EGAL)",teamB ,teamA);
			}
		}
	}
	else
	{
		ColorChat(id,RED, "[STARCS] ^x01 Momentan nu ruleaza niciun Mix. Un admin va scrie !start pentru pornire.")
	}
	
	return PLUGIN_HANDLED
}

public clcmd_fullupdate() {
	return PLUGIN_HANDLED
}
public event_restart_attempt(){
	new players[32], num
	get_players(players, num, "a")
	for ( new i; i < num; ++i )
		g_restart_attempt[players] = true
}
public event_hud_reset(id){
	if (g_restart_attempt[id]) {
		g_restart_attempt[id] = false
		return
	}
	set_properties(id)
}
public set_properties(id){ 
	set_user_hitzones(0, 0, get_pcvar_num(hitbox_bit))
}
public admin_set_hitbox(id, level, cid){
	new flags[MAXINPUT+1], name[32], error[128], result_code, bit = 1
	if ( !cmd_access(id, level, cid, 2) )
		return PLUGIN_HANDLED 
	read_argv(1, flags, MAXINPUT)
	strtolower(flags)
	new Regex:re = regex_match(flags, "0", result_code, error, 127)
	if (re >= REGEX_OK) { //This if/else will detect strange syntax, even if it doesn't need to
		regex_free(re)
		if (flags[0] == '0') {
			if (flags[1] == '^0'){
				bit = 0;
				} else {
				bit = 0; //they have a 0 followed by unnecessary characters
			}
			} else{
			bit =  1 // there is a 0 StarCsed in with other characters
		}
		} else {
		new buf[2] = {0,0}
		for (new i = 0; i<MAXINPUT; i++){ 
			buf[0] = flags;
			re = regex_match(SANITARY, buf[0], result_code, error, 127)
			if (re >= REGEX_OK){
				regex_free(re)
				} else {
				flags = 0 //They have weird characters in here
			}
		}
	}
	if (bit) {
		new buf2[2] = {97,0} //97 = a.
		for (new j = 2; j <= 128; j*=2, buf2[0]++){
			re = regex_match(flags, buf2, result_code, error, 127)
			if (re >= REGEX_OK){
				regex_free(re)
				bit += j
			}
		}
	}
	if (bit == 1){
		//They didn't type any valid flags at all
	}
	set_pcvar_num(hitbox_bit, bit)
	get_user_name(id, name, 31)
	switch ( get_pcvar_num(amx_show_activity) ){
		case 2:	ColorChat(0, RED, "[STARCS] ^x01 Admin-ul ^x04 %s ^x01 a pornit/oprit modul HS ONLY ", name)
			
	}
	set_properties(0)
	log_amx("[AMXX] ADMIN %s: set hitboxes to %d", name, bit)
	return PLUGIN_HANDLED
}

public concmd_screen(id, level, cid)
{
	if(!is_user_admin(id) && ADMIN_KICK)
	{
		return PLUGIN_HANDLED
	}
	
	new arg1[24], arg2[4]
	read_argv(1, arg1, 23)
	read_argv(2, arg2, 3)
	
	new screens = str_to_num(arg2)
	new maxss = get_pcvar_num(maxscreens)
	
	if(screens > maxss)   //too many ss?
	{
		console_print(id, "Ai depasit limita pozelor.")
		
		return PLUGIN_HANDLED
	}
	
	player = cmd_target(id, arg1, 1) 
	if (!player)   //the player has exited the sv or he didnt existed
	{
		return PLUGIN_HANDLED
	}
	finish = screens
	
	new Float:interval = get_pcvar_float(screeninterval)	//a set_task for each "amx_ss nickname nr_of_ss"
	new array[2]
	array[0] = id //save usefull data in a vector so it can be reused
	array[1] = player
	set_task(interval, "ss_propriuzis", 0, array,2, "a", screens)
	
	return PLUGIN_HANDLED
}

public ss_propriuzis(array[2])
{
	//take data and set them accordingly
	new player = array[1]
	new id = array[0]
	
	//save time,adminname,playername so that the player cant give us other ss's and because it LOOKS COOOL!
	new timestamp[32], name[32], adminname[32]
	get_time("%m/%d/%Y - %H:%M:%S", timestamp, 31)
	get_user_name(player, name, 31)
	get_user_name(id, adminname, 31)
	get_user_ip(player, ip, 31)
	
	//Clasic Design
	if(get_pcvar_num(design) == 0)
	{
		
		client_print(id,print_console, "Comanda amx_ss a fost executata asupra jucatorului ales");
		client_print(id,print_console, "Comanda amx_ss a fost executata asupra jucatorului ales");
		client_print(id,print_console, "Comanda amx_ss a fost executata asupra jucatorului ales");
		client_print(id,print_console, "Comanda amx_ss a fost executata asupra jucatorului ales");
		ColorChat(id, RED, "[SS] ^x01 Ai executat cu succes comanda amx_ss pe jucatorul ^x03 %s", name);
		client_cmd(player, "snapshot") //ss
	}
	//Doar Playerului
	else if(get_pcvar_num(design) == 1)
	{
		
	}
	//HUD Message doar Playerului
	else if(get_pcvar_num(design) == 2)
	{
		
		
	}
	//Full
	else if(get_pcvar_num(design) == 3)
	{
		ColorChat(id, RED, " ^x01 Poza executata asupra lui ^x03 %s  ^x01 de admin-ul ^x04 %s ^x01 (%s) ", name, adminname, timestamp)
		ColorChat(player, RED, " ^x01 Poza executata asupra lui ^x03 %s  ^x01 de admin-ul ^x04 %s ^x01 (%s) ", name, adminname, timestamp)
		client_cmd(player, "snapshot") //ss
		
		
	}
	console_print(id, "%s 's ip-ul este %s!",name,ip)
	console_print(id, "%s 's ip-ul este %s!",name,ip)
	console_print(id, "%s 's ip-ul este %s!",name,ip)
	finish = finish - 1;
	
	if(finish == 0)
	{
		
		
	}
	
	return PLUGIN_CONTINUE;
}

public show_ip(id)
{
	console_print(id, "Ultimul IP este: %s!",ip)
}


public demo(id,level,cid){
	if(!cmd_access(id,level,cid,1))
		return 0;
	
	new cmd[32], mapname[32], name[32], time[32], name2[32]
	read_argv(1, cmd, 31);
	new player = cmd_target(id, cmd, 5);
	
	if (!player)
		return 0;
	get_time("%m/%d/%Y - %H:%M:%S",time,31)
	get_user_name(player,name,31)
	get_user_name(id,name2,31)
	get_mapname(mapname,31)
	client_cmd(player,"record %s_%s.dem",name,mapname)
	client_print(id,print_console,"Ai pornit demo-ul jucatorului: %s, Data: %s",name,time)
	client_print(id,print_console,"Ai pornit demo-ul jucatorului: %s, Data: %s",name,time)
	client_print(id,print_console,"Ai pornit demo-ul jucatorului: %s, Data: %s",name,time)
	client_print(id,print_console,"Ai pornit demo-ul jucatorului: %s, Data: %s",name,time)
	client_print(id,print_console,"Ai pornit demo-ul jucatorului: %s, Data: %s",name,time)
	client_print(id,print_console,"Ai pornit demo-ul jucatorului: %s, Data: %s",name,time)
	ColorChat(id, RED, "^x01 Ai pornit demo-ul jucatorului ^x03 %s. ^x01 Doar tu vezi acest mesaj.", name)
	log_amx("%s Started The Demo On %s, Time %s",name, name2,time)
	return 0;
}

public stopdemo(id,level,cid){
	if(!cmd_access(id,level,cid,1))
		return 0;
	
	new cmd[32], name[32], time[32], name2[32]
	read_argv(1, cmd, 31);
	new player = cmd_target(id, cmd, 5);
	
	if (!player)
		return 0;
	get_time("%m/%d/%Y - %H:%M:%S",time,31)
	get_user_name(player,name,31)
	get_user_name(id,name2,31)
	client_cmd(player,"stop")
	client_print(id,print_console,"Ai oprit demo-ul jucatorului: %s, Data: %s",name,time)
	client_print(id,print_console,"Ai oprit demo-ul jucatorului: %s, Data: %s",name,time)
	client_print(id,print_console,"Ai oprit demo-ul jucatorului: %s, Data: %s",name,time)
	client_print(id,print_console,"Ai oprit demo-ul jucatorului: %s, Data: %s",name,time)
	client_print(id,print_console,"Ai oprit demo-ul jucatorului: %s, Data: %s",name,time)
	client_print(id,print_console,"Ai oprit demo-ul jucatorului: %s, Data: %s",name,time)
	ColorChat(id, RED, "^x01 Ai oprit demo-ul jucatorului ^x03 %s. ^x01 Doar tu vezi acest mesaj.", name)
	log_amx("%s Started The Demo On %s, Time %s",name, name2,time)
	return 0;
}

public ClCmdSay( id )
{
	
	static szArgs[ 192 ];
	read_args( szArgs, sizeof ( szArgs ) -1 );
	
	if( !szArgs[ 0 ] )	return PLUGIN_CONTINUE;
	
	if( !g_bUsersCanChat )
	{
		
	}
	
	return g_bUsersCanChat ? PLUGIN_CONTINUE : PLUGIN_HANDLED;
}

public ClCmdSayBlocare( id )
{
	if(!is_user_admin(id) && ADMIN_KICK)
	{
		client_print(id, print_chat, "Ai nevoie de admin pentru aceasta comanda.")
		return PLUGIN_HANDLED;
	}
	
	if( !g_bUsersCanChat )
	{
		client_print(id, print_chat, "Chat-ul a fost deja blocat.")
		return PLUGIN_HANDLED;
	}
	
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	ColorChat(0, RED, "[STARCS] ^x01 Chat-ul a fost blocat. -^x04%s^x01", szName );
	
	g_bUsersCanChat = false;
	
	return PLUGIN_CONTINUE;
}

public ClCmdSayDeBlocare( id )
{
	if(!is_user_admin(id) && ADMIN_KICK)
	{
		client_print(id, print_chat, "Ai nevoie de admin pentru aceasta comanda.")
		return PLUGIN_HANDLED;
	}
	
	if( g_bUsersCanChat )
	{
		client_print(0, print_chat, "Chat-ul este deja deblocat.")
		return PLUGIN_HANDLED;
	}
	
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	ColorChat(0, RED, "[STARCS] ^x01 Chat-ul a fost deblocat. -^x04%s^x01", szName );
	g_bUsersCanChat = true;
	return PLUGIN_CONTINUE;
}



public cvar_result_func(playerId, const cvar[], const value[]) {
	
	new name[32];
	new ipeki[32];
	new authid[32];
	get_user_name(playerId, name, 31)
	get_user_ip(playerId, ipeki, 31, 1)
	get_user_authid(playerId, authid, 31) 
	
	console_print(adminId, "%s  -  %s   -   %s   -   %s", name, ipeki, authid, value);
	return PLUGIN_CONTINUE
}

public comenzi(id)
{
	ColorChat(id, RED, "[STARCS] ^x01 Deschide consola pentru a vedea comenzile pentru administrare.");
	console_print(id, "Comenzile de consola ale server-ului:");
	console_print(id, "-----------------------------------------------");
	console_print(id, "amx_hsonly a (pentru a seta server-ul pe HEADSHOT ONLY)")
	console_print(id, "amx_hsonly abcdefgh (pentru a seta server-ul pe clasic)")
	console_print(id, "amx_ss OLD 1 (face poze jucatorului OLD , de la 1 la 5)")
	console_print(id, "amx_demo OLD! (porneste demo jucatorului, fara ca el sa stie)")
	console_print(id, "amx_stopdemo OLD! (opreste demo-ul jucatorului")
	console_print(id, "demo (jucatorul primeste demo, chiar daca in consola scrie ca nu exista comanda)")
	console_print(id, "amx_stopdemo OLD! (opreste demo-ul jucatorului)")
	console_print(id, "amx_spec OLD (transfera jucatorul la spectaotri)")
	console_print(id, "amx_t OLD (transfera jucatorul la teroristi)")
	console_print(id, "amx_ct OLD (transfera jucatorul la contrateroristi)")
	console_print(id, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
	console_print(id, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
	console_print(id, "Mai sus vei gasi comenzile cu prefixul amx_")
	console_print(id, "Comenzile publice ale server-ului:");
	console_print(id, "URMATOARELE COMENZI MERG SCRISE CU /");
	console_print(id, "EX: /start");
	console_print(id, "---------------------------------------------");
	console_print(id, "/specall - transfera jucatorii la spectatori ");
	console_print(id, "/start - pentru pornirea Mix-ului ");
	console_print(id, "/stop - pentru oprirea Mix-ului ");
	console_print(id, "/warm - pentru pornirea rundelor de incalzire");
	console_print(id, "/knife - pentru pornirea rundelor de cutite");
	console_print(id, "/money - pentru situatia financiara");
	console_print(id, "/setari- pentru afisarea interp-ului,steamid-ului si ip-ului");
	console_print(id, "/interp - pentru setarea interp-ului");
	console_print(id, ".score - pentru afisarea scorului" );
	console_print(id, "/blocare sau /off - pentru blocarea chat-ului" );
	console_print(id, "/deblocare sau /on - pentru deblocarea chat-ului")
	console_print(id, "/prleungiri pentru rundele de prelungire (scor 15-15)")
	console_print(id, "/map - pentru schimbarea hartii (/map de_dust2)" );
	console_print(id, "TOATE COMENZILE AMX SE POT FOLOSI DIRECT DE PE CHAT! EX: /ban old 0 wall")
	
	
	
	
	
	
}


public plugin_end( )
{
	DestroyForward( iForward );
}

public client_connect( id )
{
	g_iFrags[ id ] = 0;
}

public EventNewRound( )
{
	arrayset( g_iFrags, 0, sizeof g_iFrags );
}

public EventDeathMsg( )
{
	new iKiller = read_data( 1 );
	new iVictim = read_data( 2 );
	
	CheckAce( iVictim );
	
	if( !iKiller || iKiller == iVictim || cs_get_user_team( iKiller ) == cs_get_user_team( iVictim ) )
	{
		return PLUGIN_CONTINUE;
	}
	
	g_iFrags[ iKiller ]++;
	
	return PLUGIN_CONTINUE;
}

public LogEventRoundEnd( )
{
	new iPlayers[ 32 ], iNum, player;
	
	get_players( iPlayers, iNum, "ch" );
	
	for( new i = 0; i < iNum; i++ )
	{
		player = iPlayers[ i ];
		
		if( g_iFrags[ player ] >= SEMI_ACE )
		{
			DidAceOrSemi( player );
			
			if( g_iFrags[ player ] == SEMI_ACE + 1 )
			{
				return PLUGIN_CONTINUE;
			}
		}
	}
	
	return PLUGIN_CONTINUE;
}

public CheckAce( id )
{
	if( g_iFrags[ id ] >= SEMI_ACE )
	{
		DidAceOrSemi( id );
	}
	
	g_iFrags[ id ] = 0;
}

public DidAceOrSemi( id )
{
	new iReturn = PLUGIN_CONTINUE;
	
	ExecuteForward( iForward, iReturn, id, g_iFrags[ id ] );
	
	if( iReturn == PLUGIN_HANDLED || iReturn == PLUGIN_HANDLED_MAIN )
	{
		return PLUGIN_HANDLED;
	}
	
	new szName[ 32 ];
	
	get_user_name( id, szName, sizeof szName - 1 );
	
	ColorChat( 0, GREEN, "%s^x03 %s^x01 a realizat un a%s ^x03%sACE! ^x01 Felicitari!",
	TAG, szName, g_iFrags [ id ] == SEMI_ACE ? "" : "n", g_iFrags [ id ] == SEMI_ACE ? "SEMI-" : "" );
	
	client_cmd( 0, "spk vox/buzwarn" );
	
	return PLUGIN_HANDLED
}
public clcmd_money(client)
{
	if (!get_pcvar_num(cvar_plugin_on))
	{
		client_print(client, print_chat, "[AMXX]: Show Teammate's Money was off.")
		return PLUGIN_HANDLED
	}
	show_money(client)
	return PLUGIN_CONTINUE
}

public player_spawn(client)
{
	remove_task(client)
	if (is_user_alive(client) && get_pcvar_num(cvar_plugin_on))
	{
		set_task(1.0, "show_money", client)
	}
}

public show_money(client)
{
	static message[1024];
	static name[32];
	
	new money, id, len;
	
	len = format(message, charsmax(message), "Situatia financiara a coechipierilor:^n^n");
	for (id = 1; id <= g_max_players; id++)
	{
		if (id != client && is_user_connected(id) && cs_get_user_team(id) == cs_get_user_team(client))
		{
			money = cs_get_user_money(id);
			get_user_name(id, name, 31);
			len += format(message[len], charsmax(message) - len, "%-22.22s: %d^n", name, money);
		}
	}
	set_hudmessage(18, 113, 255, 0.05, 0.35, 0, 0.02, 5.0, 0.1, 0.2, 2);
	ShowSyncHudMsg(client, g_sync_creat_list, message);
}

public set_team(id)
	g_teammate[id] = bool:(read_data(2) == 1);

public show_teammate_money(id)
{
	if (!get_pcvar_num(cvar_plugin_on))
		return PLUGIN_HANDLED
	if(!is_user_bot(id) && is_user_connected(id) && get_pcvar_num(cvar_status_on))
	{
		static name[32]
		
		new pid = read_data(2)
		new red = 0, blue = 0
		
		if (cs_get_user_team(pid) == CS_TEAM_T)
			red = 255
		else if(cs_get_user_team(pid) == CS_TEAM_CT)
			blue = 255
		
		get_user_name(pid, name, charsmax(name))
		new money = cs_get_user_money(pid)
		if (g_teammate[id])
		{
			set_hudmessage(red, 50, blue, -1.0, 0.60, 1, 0.01, 0.6, 0.01, 0.01, 8)
			ShowSyncHudMsg(id, g_sync_creat_statustext, "Friend:%s -- Money:%d", name, money)
		}
		else {
			set_hudmessage(red, 50, blue, -1.0, 0.60, 1, 0.01, 0.6, 0.01, 0.01, 8)
			ShowSyncHudMsg(id, g_sync_creat_statustext, "Enemy:%s", name)
		}
	}
	return PLUGIN_CONTINUE
}

public client_disconnect2(client){
	
	remove_task(client)
}


public cmdct(id, level, cid)
{ 
	if (!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}
	
	new arg[32], cmd[32];
	read_argv(0,cmd,31);
	read_argv(1,arg,31);
	new player = cmd_target(id,arg,CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF);
	
	if (!player)
	{
		return PLUGIN_HANDLED;
	}
	
	if (cs_get_user_team(player) == CS_TEAM_CT)
	{
		console_print(id, "Jucatorul este deja in echipa CT");
		return PLUGIN_HANDLED;
	}
	
	new name[32], name2[32];
	get_user_name(id,name,31);
	get_user_name(player,name2, 31);
	
	if (is_user_alive (player) )
	{
		user_silentkill(player);
	}
	
	cs_set_user_team(player,CS_TEAM_CT);
	log_amx("Admin %s: Task amx_ct/t %s",name, name2);
	ColorChat(0, RED, "[STARCS] ^x01Jucatorul ^x03 %s ^x01 a fost mutat la CONTRA-TERORISTI -^x04%s", name2, name);
	
	return PLUGIN_HANDLED;
}

public cmdt(id, level, cid)
{ 
	if (!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}
	
	new arg[32], cmd[32];
	read_argv(0,cmd,31);
	read_argv(1,arg,31);
	new player = cmd_target(id,arg,CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF);
	
	if (!player)
	{
		return PLUGIN_HANDLED;
	}
	
	if (cs_get_user_team(player) == CS_TEAM_T)
	{
		console_print(id, "Jucatorul este deja in echipa T");
		return PLUGIN_HANDLED;
	}
	
	new name[32], name2[32];
	get_user_name(id,name,31);
	get_user_name(player,name2, 31);
	
	if (is_user_alive (player) )
	{
		user_silentkill(player);
	}
	
	cs_set_user_team(player,CS_TEAM_T);
	log_amx("Admin %s: Task amx_t %s",name, name2);
	ColorChat(0, RED, "[STARCS] ^x01Jucatorul ^x03 %s ^x01 a fost mutat la TERORISTI -^x04%s", name2, name);
	
	return PLUGIN_HANDLED;
}

public cmdspec(id, level, cid)
{ 
	if (!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}
	
	new arg[32], cmd[32];
	read_argv(0,cmd,31);
	read_argv(1,arg,31);
	new player = cmd_target(id,arg,CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF);
	
	if (!player)
	{
		return PLUGIN_HANDLED;
	}
	
	if (cs_get_user_team(player) == CS_TEAM_SPECTATOR)
	{
		console_print(id, "Jucatorul este deja in spectatori");
		return PLUGIN_HANDLED;
	}
	
	new name[32], name2[32];
	get_user_name(id,name,31);
	get_user_name(player,name2, 31);
	
	if (is_user_alive (player) )
	{
		user_silentkill(player);
	}
	
	cs_set_user_team(player,CS_TEAM_SPECTATOR);
	log_amx("Admin %s: Task amx_spec %s",name, name2);
	ColorChat(0, RED, "[STARCS] ^x01Jucatorul ^x03 %s ^x01 a fost mutat la SPECTATORI -^x04%s", name2, name);
	
	return PLUGIN_HANDLED;
}

public cmd_spec (id, level, cid) {               /////////ASTA ESTE PROBLEMA PLUGIN-ULUI
	//Verificam daca are acces la comanda
	if(!cmd_access(id, level, cid, 2)) {
		//Mesajul care ii apare
		client_print(id,print_console,"Nu ai acces la aceasta comanda");
		return PLUGIN_HANDLED;
	}
	
	new arg[32], cmd[32];
	read_argv(0,cmd,31);
	read_argv(1,arg,31);
	new iPlayers[ 32 ], iNum, iPlayer
	get_players( iPlayers, iNum )
	
	for ( new a = 0; a < iNum; a++ )
	{
		iPlayer = iPlayers[ a ];
		
		switch ( cs_get_user_team( iPlayer ) )
			
	{
		case CS_TEAM_T, CS_TEAM_CT:
		{
			if(is_user_alive( iPlayer ))
			user_silentkill( iPlayer );
			cs_set_user_team( iPlayer, CS_TEAM_SPECTATOR );
			set_cvar_string ( "sv_restart", "5" );
			}
		}
	}
	
	ColorChat(0,RED,"[STARCS] ^x01Jucatorii au fost transferati la spectatori pentru runda alegerilor. -^x04%s^x01 ", szName );
	return 1;
}

public admin_slash(id)
{
	new sArg[MAX_NAME_LENGTH+1]
	
	read_argv(1,sArg,MAX_NAME_LENGTH)
	
	if ( sArg[0] == '/' ) {
		
		new sCommand[MAX_TEXT_LENGTH+1]
		new sMessage[MAX_TEXT_LENGTH+1]
		
		read_args(sMessage,MAX_TEXT_LENGTH)
		remove_quotes(sMessage)
		replace(sMessage,MAX_TEXT_LENGTH,"/","")
		
		
		
		format(sCommand,MAX_TEXT_LENGTH,"amx_%s",sMessage)
		client_cmd(id,sCommand)
		
	}
	return PLUGIN_CONTINUE
}

public plugin_end2() {
	new minutes = floatround(get_gametime() / 60.0, floatround_ceil);
	
	new map[32];
	get_mapname(map, charsmax(map));
	
	new f = fopen(gSaveFile, "wt");
	
	fprintf(f, "^"%s^" %d", map, minutes);
	
	if(gNumLastMaps == LAST_MAPS_SAVE) {
		gNumLastMaps--;
	}
	
	for(new i = 0; i < gNumLastMaps; i++) {
		fprintf(f, "^n^"%s^" %d", gLastMapName, gLastMapTime);
	}
	
	fclose(f);
}

public CmdLastMaps(id) {
	if(gNumLastMaps) {
		new maps[192], len;
		for(new i = 0; i < gNumLastMaps; i++) {
			len += formatex(maps[len], charsmax(maps) - len, "%s%s (%dmin)", len ? ", " : "", gLastMapName, gLastMapTime);
		}
		
		ColorChat(id, RED, "[STARCS] ^x01 Ultimele 3 harti jucate: ^x04 %s", maps);
		} else {
		client_print(id, print_chat, "Nu este nicio harta anterioara.");
	}
}

public pass(id, level, cid)
{
	if(!cmd_access(id, level, cid, 1))
		return PLUGIN_HANDLED
	
	new cmd[32], password[128]
	
	read_argv(0, cmd, 31)
	read_args(password, 127)
	replace(password, 127, cmd, "")
	format(password, 127, "%s", password)
	
	get_user_name(id, name, 31)
	get_user_authid(id, authid, 31)
	switch (get_cvar_num("amx_show_activity")) {
		case 2: ColorChat(0,RED,"[STARCS] ^x01 Parola a fost setata pe server. Tasteaza /nopass pentru a o scoate. - ^x04 %s",name)
			case 1: ColorChat(0,RED,"Este deja o parola pe server.")
		}
	log_amx("Cmd: ^"%s<%d><%s>^" set the server password to %s",name,get_user_userid(id),authid,password)
	set_cvar_string("sv_password", password)
	
	return PLUGIN_HANDLED
}

public nopass(id, level, cid)
{
	if(!cmd_access(id, level, cid, 1))
		return PLUGIN_HANDLED
	
	get_user_name(id, name, 31)
	get_user_authid(id, authid, 31)
	switch (get_cvar_num("amx_show_activity")) {
		case 2: ColorChat(0,RED,"[STARCS] ^x01 Parola a fost scoasa de pe server. - ^x04 %s",name)
			case 1: client_print(0,print_chat,"A fost scoasa deja parola de pe server.")
		}
	log_amx("Cmd: ^"%s<%d><%s>^" removed server password", name,get_user_userid(id),authid)
	set_cvar_string("sv_password", "")
	
	return PLUGIN_HANDLED
}
Image
zLow123
Membru, skill 0
Membru, skill 0
Posts: 20
Joined: 24 Dec 2017, 19:45
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

24 Jun 2020, 23:01

Îți vând eu unul bun , PM .
User avatar
eGRoBi
Membru, skill 0
Membru, skill 0
Posts: 28
Joined: 19 Feb 2017, 13:43
Detinator Steam: Da
CS Status: You have to learn the rules of the game.
SteamID: STEAM_0:0:63287599
Fond eXtream: 0
Contact:

26 Jun 2020, 01:04

Ce te face sa crezi ca as cumpara asa ceva?:))am cerut modificare si atat, mersi.
Image
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests