Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #include <fakemeta>
- #include <fun>
- #include <hamsandwich>
- #include <colorchat>
- new name[32][32]
- new rate[32][32]
- new updaterate[32][32]
- new steamid[35][32]
- new cmdrate[32][32]
- new interp[32][32]
- new jucators[32]
- new num
- new g_max_jucators, g_sync_creat_statustext, g_sync_creat_list
- new bool:g_teammate[33]
- new cvar_plugin_on
- new cvar_status_on
- #define ADMIN_ACCES ADMIN_KICK
- #define VERSION "2.3"
- new team1_name[32]
- new team1_score = 0
- new team1_p2_score = 0
- new team2_name[32]
- new team2_score = 0
- new team2_p2_score = 0
- new roundcount = 0
- new readycount = 0
- new bool:war
- new bool:live
- new bool:segparte
- new bool:jgdrpronto[32]
- new bool:jgdrmsg[32]
- new numchecked
- new check_pcvar
- new enabled_pcvar
- new password_pcvar
- // Cvars
- new cvar_team1name
- new cvar_team2name
- new cvar_prefixo
- new cvar_autolive
- new cvar_autorec
- new cvar_autoss
- new cvar_switchround
- new cvar_roundsdraw
- new cvar_roundswin
- new const saycmds[2][] = {
- "score", "clcmd_score"
- }
- new g_maxjucators;
- new KNIFE = 0;
- //new szArg[32];
- new const g_szInterpCommands[ ][ ] =
- {
- "ex_interp 0.01",
- "cl_filterstuffcmd 0",
- "cl_updaterate 101"
- };
- new bool:g_bUsersCanChat = true;
- #define CMDTARGET_OBEY_IMMUNITY (1<<0)
- #define CMDTARGET_ALLOW_SELF (1<<1)
- #define CMDTARGET_ONLY_ALIVE (1<<2)
- #define CMDTARGET_NO_BOTS (1<<3)
- new const bars[] = "/";
- new command[][] =
- {
- "/t",
- "/ct",
- "/spec",
- "/map"
- };
- new Caccess[] =
- {
- ADMIN_KICK,
- ADMIN_KICK,
- ADMIN_KICK,
- ADMIN_MAP
- };
- new g_On[ 33 ] = 0;
- public plugin_init()
- {
- register_plugin("war5vs5", VERSION, "cs16cluj")
- register_clcmd("say /start", "clcmd_start", ADMIN_KICK)
- register_clcmd("say_team /start", "clcmd_start", ADMIN_KICK)
- register_clcmd("say /stop", "clcmd_stop", ADMIN_ACCES)
- register_clcmd("say_team /stop", "clcmd_stop", ADMIN_ACCES)
- register_clcmd("say /knife","say_knife", ADMIN_KICK,"-Runda de lame");
- register_clcmd("say_team /knife","say_knife", ADMIN_KICK,"-Runda de lame");
- register_event("CurWeapon","switchweapon","be","1=1","2!29")
- register_clcmd("say /warm", "warm", ADMIN_KICK, "- Incalzire ");
- register_clcmd("say_team /warm", "warm", ADMIN_KICK, "- Incalzire ");
- register_clcmd("say /rr","rr",ADMIN_KICK,"-Restart");
- register_clcmd("say_team /rr","rr",ADMIN_KICK,"-Restart");
- register_clcmd("say /pause", "pauza", ADMIN_KICK, "- Pause/Unpause")
- register_clcmd("say_team /pause", "pauza", ADMIN_KICK, "- Pause/Unpause")
- register_clcmd("say /setari", "rates_list", ADMIN_KICK, "- rates ");
- register_clcmd("say_team /setari", "rates_list", ADMIN_KICK, "- rates ");
- register_clcmd("say /extra", "extra", ADMIN_KICK, "- Runde de departajare ");
- register_clcmd("say_team /extra", "extra", ADMIN_KICK, "- Runde de departajare ");
- register_clcmd("say /swap", "swap", ADMIN_KICK, "- Schimba echipele intre ele");
- register_clcmd("say_team /swap", "swap", ADMIN_KICK, "- Schimba echipele intre ele");
- register_concmd("amx_t", "Transfer1", ADMIN_KICK, "<name> - send to T's team");
- register_concmd("amx_ct", "Transfer2", ADMIN_KICK, "<name> - send to CT's team");
- register_concmd("amx_spec", "Transfer3", ADMIN_KICK, "<name> - send to Spectators team");
- register_clcmd("say /off", "ClCmdSayBlocare" );
- register_clcmd("say_team /off", "ClCmdSayBlocare" );
- register_clcmd("say /on", "ClCmdSayDeBlocare" );
- register_clcmd("say_team /on", "ClCmdSayDeBlocare" );
- register_clcmd("say /interp", "ClCmdSayInterp" );
- register_clcmd("say_team /interp", "ClCmdSayInterp" );
- register_clcmd("say", "cmddemo" );
- register_clcmd("say_team", "cmddemo" );
- register_clcmd("say", "ClCmdSay" )
- register_clcmd("say /comenzi", "comenzi" );
- register_clcmd("say_team /comenzi", "comenzi" );
- register_clcmd ("say", "hook_say");
- register_clcmd ("say_team", "hook_say");
- set_msg_block(49, BLOCK_SET)
- set_task(1.0, "executarConfig")
- g_maxjucators = get_maxjucators();
- new delay_pcvar = register_cvar("apr_checkdelay","60.0")
- check_pcvar = register_cvar("apr_checktimes","2")
- enabled_pcvar = register_cvar("apr_enabled","1")
- password_pcvar = get_cvar_pointer("sv_password")
- numchecked = 0
- if(get_pcvar_float(delay_pcvar)<=1.0)
- set_pcvar_float(delay_pcvar,1.0)
- set_task(get_pcvar_float(delay_pcvar),"check_server",0,"",0,"b")
- RegisterHam(Ham_Spawn, "jucator", "jucator_spawn", 1)
- register_clcmd("say /money", "clcmd_money")
- register_clcmd("say_team /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_jucators = get_maxjucators()
- g_sync_creat_statustext = CreateHudSyncObj()
- g_sync_creat_list = CreateHudSyncObj()
- new i, x
- for(i = 0; i < 2; i++)
- {
- x = i + 1
- new comando[32]
- format(comando, sizeof(comando), "say /%s", saycmds[i])
- register_clcmd(comando, saycmds[x])
- format(comando, sizeof(comando), "say_team /%s", saycmds[i])
- register_clcmd(comando, saycmds[x])
- i++
- }
- cvar_team1name = register_cvar("amx_cspro_equipa1", "Team1")
- cvar_team2name = register_cvar("amx_cspro_equipa2", "Team2")
- cvar_prefixo = register_cvar("amx_cspro_prefixo", "[]")
- cvar_autolive = register_cvar("amx_cspro_autolive", "1")
- cvar_autorec = register_cvar("amx_cspro_autorec", "0")
- cvar_autoss = register_cvar("amx_cspro_autoss", "1")
- cvar_roundswin = register_cvar("amx_cspro_winrounds", "16")
- cvar_roundsdraw = register_cvar("amx_cspro_rounddraw", "15")
- cvar_switchround = register_cvar("amx_cspro_switchround", "15")
- register_event("SendAudio","event_EndRound","a","2=%!MRAD_terwin","2=%!MRAD_ctwin")
- register_event("ResetHUD", "event_ResetHud", "b");
- register_concmd("amx_map", "cmdMap", ADMIN_MAP, "<mapname>")
- register_clcmd("say /spec", "cmd_spec", ADMIN_ACCES)
- register_clcmd("say_team /spec", "cmd_spec", ADMIN_ACCES)
- register_clcmd("say", "password", ADMIN_ACCES)
- register_clcmd("say_team", "password", ADMIN_ACCES)
- register_clcmd("say /nopass", "nopassword", ADMIN_ACCES)
- register_clcmd("say_team /nopass", "nopassword", ADMIN_ACCES)
- }
- public password(id, level, cid)
- {
- static message[64]
- read_args (message, 63)
- remove_quotes (message)
- if( (message[0] == '/' || message[0] == '/' || message[0] == '.')
- && message[1] == 'p' && message[2] == 'a' && message[3] == 's' && message[4] == 's' )
- {
- static pass[31];
- strbreak(message, message, 6, pass, 30);
- remove_quotes(pass);
- {
- client_cmd(id, "amx_cvar sv_password %s", pass)
- }
- ColorChat( 0, DontChange, "^x04*^x01 Parola setata este ^x04* %s", pass)
- return PLUGIN_HANDLED
- }
- return PLUGIN_CONTINUE
- }
- public nopassword(id, level, cid)
- {
- if(!cmd_access(id, level, cid, 0))
- return PLUGIN_CONTINUE;
- client_cmd(id, "amx_cvar sv_password ^"^"")
- ColorChat( 0, DontChange, "^x04*^x01 Parola a fost scoasa de adminul ^x03%s^x01 ")
- return PLUGIN_CONTINUE
- }
- public check_server()
- {
- if(get_pcvar_num(enabled_pcvar))
- {
- new curpass[32]
- get_pcvar_string(password_pcvar,curpass,31)
- if(strlen(curpass)>0 && !equali(curpass,"none"))
- {
- new jucators[32], num
- get_jucators(jucators,num,"ch")
- if(num==0)
- {
- numchecked++
- if(numchecked>=get_pcvar_num(check_pcvar))
- {
- log_amx("%L",0,"MSG_REMOVE")
- set_cvar_string("sv_password","none")
- numchecked=0
- }
- }
- else
- numchecked = 0
- }
- else
- numchecked = 0
- }
- else
- numchecked = 0
- }
- public clcmd_start(id, level, cid)
- {
- if(!cmd_access(id, level, cid, 0))
- return PLUGIN_HANDLED
- if(live)
- {
- new szName[ 32 ];
- get_user_name( id, szName, sizeof ( szName ) -1 );
- ColorChat( id, RED, "^x04*^x01 admin ^x03%s^x01 ~ Meciul este in curs, intai tasteaza /stop.", szName );
- return PLUGIN_HANDLED
- }
- if(!segparte)
- {
- console_print(id, "Se porneste meciul.")
- reniciar_dados()
- war = true
- KNIFE = 0;
- server_cmd("mp_friendlyfire 1");
- server_cmd("mp_roundtime 1.75");
- server_cmd("mp_freezetime 10");
- server_cmd("mp_limitteams 1");
- server_cmd("mp_autoteambalance 0");
- server_cmd("mp_autokick 0");
- server_cmd("mp_forcechasecam 2");
- server_cmd("mp_forcecamera 2");
- server_cmd("mp_buytime 0.15");
- server_cmd("mp_startmoney 800");
- new szName[ 32 ];
- get_user_name( id, szName, sizeof ( szName ) -1 );
- ColorChat( id, RED, "^x04*^x01 admin ^x03%s^x01 ~ Meciul a inceput - GL~HF.", szName );
- if(get_pcvar_num(cvar_autorec))
- pov_record()
- if(get_pcvar_num(cvar_autolive))
- set_task(1.0, "executar_lo3")
- if(get_pcvar_num(cvar_autoss))
- set_task(540.0,"pov_ss",_,_,_,"b");
- }
- return PLUGIN_HANDLED
- }
- public clcmd_stop(id, level, cid)
- {
- if(!cmd_access(id, level, cid, 0))
- return PLUGIN_HANDLED
- if(!war)
- {
- new szName[ 32 ];
- get_user_name( id, szName, sizeof ( szName ) -1 );
- ColorChat( id, RED, "^x04*^x01 admin ^x03%s^x01 ~ Meciul s-a terminat - GL.", szName );
- KNIFE = 0;
- server_cmd("sv_restart 1");
- server_cmd("mp_friendlyfire 1");
- server_cmd("mp_freezetime 0");
- server_cmd("mp_forcechasecam 2");
- server_cmd("mp_forcecamera 2");
- server_cmd("mp_limitteams 0");
- server_cmd("mp_startmoney 16000");
- server_cmd("mp_roundtime 1.75");
- server_cmd("mp_buytime 3.0");
- server_cmd("sv_restart 1");
- return PLUGIN_HANDLED
- }
- new szName[ 32 ];
- get_user_name( id, szName, sizeof ( szName ) -1 );
- ColorChat( id, RED, "^x04*^x01 admin ^x03%s^x01 ~ Meciul s-a terminat - GL.", szName );
- KNIFE = 0;
- server_cmd("sv_restart 1");
- server_cmd("mp_friendlyfire 1");
- server_cmd("mp_freezetime 0");
- server_cmd("mp_forcechasecam 2");
- server_cmd("mp_forcecamera 2");
- server_cmd("mp_limitteams 0");
- server_cmd("mp_startmoney 16000");
- server_cmd("mp_roundtime 1.75");
- server_cmd("mp_buytime 3.0");
- server_cmd("sv_restart 1");
- war = false
- live = false
- if(get_pcvar_num(cvar_autoss))
- remove_task(1);
- return PLUGIN_HANDLED
- }
- public clcmd_live(id, level, cid)
- {
- if(!cmd_access(id, level, cid, 0))
- return PLUGIN_HANDLED
- executar_lo3()
- return PLUGIN_HANDLED
- }
- public clcmd_score(id)
- {
- if(!war)
- return PLUGIN_CONTINUE
- get_pcvar_string(cvar_team1name, team1_name, 31)
- get_pcvar_string(cvar_team2name, team2_name, 31)
- chatprint(id, "Score: ^x03%s^x01 %d - %d ^x03%s^x01", team1_name, team1_score, team2_score, team2_name)
- return PLUGIN_CONTINUE
- }
- public client_connect(id)
- {
- client_cmd(id, "echo =====================================================")
- client_cmd(id, "echo Serverul foloseste pluginul de War: War5vs5 V2.3")
- client_cmd(id, "echo =====================================================")
- }
- public client_disconnect(id)
- {
- if(jgdrpronto[id])
- {
- jgdrpronto[id] = false
- readycount--
- set_task(2.0, "remove")
- }
- }
- public event_ResetHud(id)
- {
- if(is_user_alive(id))
- {
- if(!jgdrmsg[id])
- {
- client_cmd(id, "echo Tasteaza /comenzi in chat pentru a vedea in consola toate comenzile de war/mix!")
- jgdrmsg[id] = true
- }
- }
- }
- public event_EndRound()
- {
- get_pcvar_string(cvar_team1name, team1_name, 31)
- get_pcvar_string(cvar_team2name, team2_name, 31)
- if(live)
- {
- new numroundswin = get_pcvar_num(cvar_roundswin)
- new numroundsdraw = get_pcvar_num(cvar_roundsdraw)
- new msg[32]
- read_data(2,msg,32)
- if(containi(msg,"ct") != -1)
- {
- if(segparte)
- team2_score++
- else
- team1_score++
- }
- else if(contain(msg,"ter") != -1)
- {
- if(segparte)
- team1_score++
- else
- team2_score++
- }
- if(team1_score == numroundswin)
- {
- chatprint(0, "Echipa ^x03%s^x01 a castigat !", team1_name)
- chatprint(0, "Results: ^x03%s^x01 %d - %d ^x03%s^x01", team1_name, team1_score, team2_score, team2_name)
- live = false
- war = false
- reniciar_dados()
- KNIFE = 0;
- server_cmd("sv_restart 1");
- server_cmd("mp_friendlyfire 1");
- server_cmd("mp_freezetime 0");
- server_cmd("mp_limitteams 0");
- server_cmd("mp_startmoney 16000");
- server_cmd("mp_forcechasecam 2");
- server_cmd("mp_forcecamera 2");
- server_cmd("mp_roundtime 1.75");
- server_cmd("mp_buytime 3.0");
- return PLUGIN_HANDLED
- }
- else if(team2_score == numroundswin)
- {
- chatprint(0, "Echipa ^x03%s^x01 a castigat!", team2_name)
- chatprint(0, "Results: ^x03%s^x01 %d - %d ^x03%s^x01", team1_name, team1_score, team2_score, team2_name)
- live = false
- war = false
- reniciar_dados()
- KNIFE = 0;
- server_cmd("sv_restart 1");
- server_cmd("mp_friendlyfire 1");
- server_cmd("mp_freezetime 0");
- server_cmd("mp_limitteams 0");
- server_cmd("mp_startmoney 16000");
- server_cmd("mp_forcechasecam 2");
- server_cmd("mp_forcecamera 2");
- server_cmd("mp_roundtime 1.75");
- server_cmd("mp_buytime 3.0");
- return PLUGIN_HANDLED
- }
- else if(team1_score == numroundsdraw && team2_score == numroundsdraw)
- {
- chatprint(0, "Sa terminat egal intre cele doua echipe.")
- chatprint(0, "Results: ^x03%s^x01 %d - %d ^x03%s^x01", team1_name, team1_score, team2_score, team2_name)
- live = false
- war = false
- reniciar_dados()
- KNIFE = 0;
- server_cmd("sv_restart 1");
- server_cmd("mp_friendlyfire 1");
- server_cmd("mp_freezetime 0");
- server_cmd("mp_limitteams 0");
- server_cmd("mp_startmoney 16000");
- server_cmd("mp_forcechasecam 2");
- server_cmd("mp_forcecamera 2");
- server_cmd("mp_roundtime 1.75");
- server_cmd("mp_buytime 3.0");
- return PLUGIN_HANDLED
- }
- else
- {
- roundcount++
- if(roundcount == get_pcvar_num(cvar_switchround))
- {
- live = false
- chatprint(0, "Sfarsitul primei parti!")
- chatprint(0, "Score: ^x03%s^x01 %d - %d ^x03%s^x01", team1_name, team1_score, team2_score, team2_name)
- chatprint(0, "Schimb echipele ...")
- segparte = true
- team1_p2_score = team1_score
- team2_p2_score = team2_score
- set_task(1.0, "trocar_equipas")
- if(get_pcvar_num(cvar_autolive))
- set_task(1.0, "executar_lo3")
- }
- }
- }
- return PLUGIN_CONTINUE
- }
- public executar_lo3()
- {
- if(!war)
- return PLUGIN_HANDLED
- if(segparte)
- {
- team1_score = team1_p2_score
- team2_score = team2_p2_score
- roundcount = 15
- }
- else
- {
- team1_score = 0
- team2_score = 0
- roundcount = 0
- }
- set_task(1.0, "lo3_rr1")
- return PLUGIN_CONTINUE
- }
- public lo3_rr1()
- {
- if(!war)
- return PLUGIN_HANDLED
- server_cmd("sv_restart 1")
- chatprint(0, "Live ! Live ! Live ! " )
- chatprint(0, "Live ! Live ! Live ! " )
- chatprint(0, "Live ! Live ! Live ! " )
- set_task(1.0, "lo3_saylive")
- return PLUGIN_CONTINUE
- }
- public lo3_saylive()
- {
- if(!war)
- return PLUGIN_HANDLED
- live = true
- return PLUGIN_CONTINUE
- }
- public reniciar_dados()
- {
- team1_score = 0
- team2_score = 0
- team1_p2_score = 0
- team2_p2_score = 0
- roundcount = 0
- segparte = false
- readycount = 0
- for(new i; i < 32; i++)
- jgdrpronto[i] = false
- }
- public trocar_equipas()
- {
- new jogador[32], numjogadores, i
- get_jucators(jogador, numjogadores, "h")
- for(i = 0; i < numjogadores; i++)
- {
- if(is_user_connected(jogador[i]))
- {
- if(cs_get_user_team(jogador[i]) != CS_TEAM_SPECTATOR)
- {
- if(cs_get_user_team(jogador[i]) == CS_TEAM_CT)
- cs_set_user_team(jogador[i], CS_TEAM_T)
- else
- cs_set_user_team(jogador[i], CS_TEAM_CT)
- }
- }
- }
- }
- public pov_record()
- {
- new jogador[32], numjogadores, i
- get_jucators(jogador, numjogadores, "h")
- new time_date[32]
- new map_name[32]
- get_mapname ( map_name, 31 )
- get_time("%d-%m-%Y_%H-%M",time_date,31)
- get_pcvar_string(cvar_team1name, team1_name, 31)
- get_pcvar_string(cvar_team2name, team2_name, 31)
- for(i = 0; i < numjogadores; i++)
- {
- if(is_user_connected(jogador[i]))
- {
- if(cs_get_user_team(jogador[i]) != CS_TEAM_SPECTATOR)
- {
- new demo[256]
- formatex(demo, sizeof(demo), "%s vs %s %s %s", team1_name, team2_name, time_date, map_name)
- client_cmd(jogador[i], "stop")
- while(replace(demo,255,"/","_")) {}
- while(replace(demo,255,"\","_")) {}
- while(replace(demo,255,":","_")) {}
- while(replace(demo,255,"*","_")) {}
- while(replace(demo,255,"?","_")) {}
- while(replace(demo,255,">","_")) {}
- while(replace(demo,255,"<","_")) {}
- while(replace(demo,255,"|","_")) {}
- client_cmd(jogador[i], "record ^"%s.dem.dem^"", demo)
- chatprint(jogador[i], "Inregistrare demo: ^x03%s", demo)
- }
- }
- }
- }
- public pov_ss(id)
- {
- static jucators[32], index, num, i;
- get_jucators(jucators, num, "ch");
- for(i = 0;i < num;i++)
- {
- index = jucators[i];
- if(!is_user_connected(index))
- continue;
- if(is_user_hltv(index))
- continue;
- client_cmd(id, "echo ScreenShot taken");
- client_cmd(index, "snapshot" );
- }
- }
- public executarConfig()
- {
- new Cfg[64]
- get_configsdir(Cfg, 63)
- add(Cfg, 63, "/h4u.cfg")
- if(file_exists(Cfg))
- server_cmd("exec %s", Cfg)
- else {
- new f = fopen(Cfg, "wt")
- fputs(f, "// This is the Config file of plugin cspro^n// This file is loaded when the server starts or when map was changed..^n^n");
- new valortxt[32]
- fprintf(f, "amx_cspro_autorec ^"%i^" // Auto Recording (POV)^n", get_pcvar_num(cvar_autorec))
- fprintf(f, "amx_cspro_autoss ^"%i^" // Auto ScreenShot (POV)^n", get_pcvar_num(cvar_autoss))
- fprintf(f, "amx_cspro_winrounds ^"%i^" // Number of rounds required to a team win the match^n", get_pcvar_num(cvar_roundswin))
- fprintf(f, "amx_cspro_rounddraw ^"%i^" // Number of rounds required to draw^n", get_pcvar_num(cvar_roundsdraw))
- fprintf(f, "amx_cspro_switchround ^"%i^" // Number of rounds required to switch teams^n", get_pcvar_num(cvar_switchround))
- get_pcvar_string(cvar_prefixo, valortxt, 31)
- fprintf(f, "amx_cspro_prefixo ^"%s^" // Prefix of messages^n", valortxt)
- fclose(f)
- }
- register_forward(FM_GetGameDescription, "fw_nomejogo", 0)
- }
- public fw_nomejogo()
- {
- new NomeJogo[32]
- format(NomeJogo, sizeof(NomeJogo), "War~5vs5v%s", VERSION)
- forward_return(FMV_STRING, NomeJogo)
- return FMRES_SUPERCEDE
- }
- stock chatprint(target, const message[], any:...)
- {
- static buffer[512], msg_SayText = 0
- if( !msg_SayText ) msg_SayText = get_user_msgid("SayText")
- new cvarprefixo[32]
- get_pcvar_string(cvar_prefixo, cvarprefixo, 31)
- if (!target)
- {
- static jucator, maxjucators
- maxjucators = get_maxjucators()
- for (jucator = 1; jucator <= maxjucators; jucator++)
- {
- if (!is_user_connected(jucator))
- continue;
- vformat(buffer, charsmax(buffer), message, 3)
- format(buffer, charsmax(buffer), "^x04%s^x01 %s", cvarprefixo, buffer)
- message_begin(MSG_ONE_UNRELIABLE, msg_SayText, _, jucator)
- write_byte(jucator)
- write_string(buffer)
- message_end()
- }
- }
- else
- {
- vformat(buffer, charsmax(buffer), message, 3)
- format(buffer, charsmax(buffer), "^x04%s^x01 %s", cvarprefixo, buffer)
- message_begin(MSG_ONE, msg_SayText, _, target)
- write_byte(target)
- write_string(buffer)
- message_end()
- }
- }
- public switchweapon(id)
- {
- if (KNIFE == 1)
- {
- engclient_cmd(id, "weapon_knife");
- }
- }
- public say_knife(id, level, cid)
- {
- if (!cmd_access(id,level,cid,2))
- {
- return PLUGIN_HANDLED;
- }
- server_cmd("sv_restart 1");
- server_cmd("mp_startmoney 800");
- KNIFE = 1;
- server_cmd("mp_freezetime 0");
- new szName[ 32 ];
- get_user_name( id, szName, sizeof ( szName ) -1 );
- ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a pornit runda de lame - GL & HF.", szName );
- strip_user_weapons(id);
- give_item(id, "weapon_knife");
- war = false
- live = false
- return PLUGIN_HANDLED;
- }
- public warm(id,level,cid){
- if(!cmd_access(id,level,cid,1))
- return PLUGIN_HANDLED;
- KNIFE = 0;
- server_cmd("sv_restart 1");
- server_cmd("mp_friendlyfire 0");
- server_cmd("mp_freezetime 0");
- server_cmd("mp_limitteams 0");
- server_cmd("mp_startmoney 16000");
- server_cmd("mp_forcechasecam 2");
- server_cmd("mp_forcecamera 2");
- server_cmd("mp_roundtime 1.75");
- server_cmd("mp_buytime 3.0");
- new szName[ 32 ];
- get_user_name( id, szName, sizeof ( szName ) -1 );
- ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a pornit rundele de incalzire - HF.", szName );
- war = false
- live = false
- KNIFE = 0;
- KNIFE = 0;
- return PLUGIN_HANDLED;
- }
- public rr(id,level,cid){
- if(!cmd_access(id,level,cid,1))
- return PLUGIN_HANDLED;
- KNIFE = 0;
- server_cmd("sv_restartround 1");
- server_cmd("mp_forcechasecam 2");
- server_cmd("mp_forcecamera 2");
- new szName[ 32 ];
- get_user_name( id, szName, sizeof ( szName ) -1 );
- ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a dat Restart - GL & HF.", szName );
- return PLUGIN_HANDLED;
- }
- public pauza(id,level,cid){
- if(!cmd_access(id,level,cid,1))
- return PLUGIN_HANDLED;
- KNIFE = 0;
- server_cmd("amx_pause");
- new szName[ 32 ];
- get_user_name( id, szName, sizeof ( szName ) -1 );
- ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a dat Pause/Unpause.", szName );
- return PLUGIN_HANDLED;
- }
- public extra(id,level,cid){
- if(!cmd_access(id,level,cid,1))
- return PLUGIN_HANDLED;
- war = false
- live = false
- KNIFE = 0;
- server_cmd("sv_restart 1");
- server_cmd("mp_forcechasecam 2");
- server_cmd("mp_forcecamera 2");
- server_cmd("mp_limitteams 1");
- server_cmd("mp_startmoney 10000");
- server_cmd("mp_roundtime 1.75");
- server_cmd("mp_buytime 0.15");
- server_cmd("mp_freezetime 10");
- new szName[ 32 ];
- get_user_name( id, szName, sizeof ( szName ) -1 );
- ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a pornit rundele de departajare - GL & HF.", szName );
- war = true
- live = true
- KNIFE = 0;
- return PLUGIN_HANDLED;
- }
- public swap( id, level, cid )
- {
- if( !cmd_access( id, level, cid, 1 ) )
- return PLUGIN_HANDLED;
- for( new i = 1; i <= g_maxjucators; i++ )
- {
- if( !is_user_connected( i ) )
- continue;
- switch( get_user_team( i ) )
- {
- case 1: cs_set_user_team( i, CS_TEAM_CT );
- case 2: cs_set_user_team( i, CS_TEAM_T );
- default: continue;
- }
- }
- server_cmd( "sv_restart 1" );
- set_hudmessage(85, 212, 255, 0.05, 0.36, 0, 6.0, 5.0)
- new szName[ 32 ];
- get_user_name( id, szName, sizeof ( szName ) -1 );
- ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a schimbat echipele intre ele incepe meciul - GL & HF.", szName );
- return PLUGIN_HANDLED;
- }
- public clcmd_money(client)
- {
- if (!get_pcvar_num(cvar_plugin_on))
- {
- client_print(client, print_chat, "[]: Situatia financiara off.")
- return PLUGIN_HANDLED
- }
- show_money(client)
- return PLUGIN_CONTINUE
- }
- public jucator_spawn(client)
- {
- clcmd_score(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 echipei:^n");
- for (id = 1; id <= g_max_jucators; id++)
- {
- if (id != client && is_user_connected(id) && get_user_team(id) == 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(100, 200, 0, 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, "", 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, "", name)
- }
- }
- return PLUGIN_CONTINUE
- }
- public rates_list(id, level, cid) {
- //Check if the user has the required access level
- if (!cmd_access(id,level,cid,1))
- return PLUGIN_HANDLED
- //Print an info line to the users console
- client_print(id, print_console, "Generating Rates List...")
- //Retrieve the rate information
- getrates(id)
- //Wait 1 second for all query_client_cvar calls to finish the print rate info to console
- set_task(1.0, "printrates", id, "", 0, "a", 1)
- return PLUGIN_HANDLED
- }
- public cmdrate_result_func(id,const cvar[],const value[],const param[])
- {
- copy(cmdrate[param[0]],31,value)
- }
- public interp_result_func(id,const cvar[],const value[], const param[])
- {
- copy(interp[param[0]],31,value)
- }
- public getrates(id)
- {
- //Get Number of jucators in the server
- get_jucators(jucators,num,"c")
- //Loop for all jucators and retrieve rate info
- for (new i[1] = 0; i[0] < num; ++i[0]) {
- query_client_cvar(jucators[i[0]],"cl_cmdrate","cmdrate_result_func",1,i)
- query_client_cvar(jucators[i[0]],"ex_interp","interp_result_func",1,i)
- set_task(0.5, "getinforates", i[0], "", 0, "a", 1) //Wait for 0.5 seconds for cvar quering to finish then get the rest of the info
- }
- }
- public getinforates(i)
- {
- get_user_name(jucators[i], name[i], 31)
- get_user_authid(jucators[i], steamid[i], 34);
- get_user_info(jucators[i], "rate", rate[i], 31)
- get_user_info(jucators[i], "cl_updaterate", updaterate[i], 31)
- }
- public printrates(id)
- {
- //Print an info line to the users console
- client_print(id, print_console, "Id Name SteamId Rate Updaterate Cmdrate Ex_Interp")
- //Loop for all jucators and print rates info
- for (new i = 0; i < num; ++i) {
- client_print(id, print_console, "#%d %s %s %s %s %s %s",jucators[i],name[i], steamid[i], rate[i], updaterate[i], cmdrate[i], interp[i])
- }
- }
- public cmd_spec(id, level, cid){
- if(!cmd_access(id, level, cid, 0))
- return PLUGIN_CONTINUE;
- new jucators[32], pnum, tempid;
- get_jucators(jucators, pnum, "h");
- for (new i; i < pnum; i++) {
- tempid = jucators[i];
- if (is_user_alive(tempid))
- user_kill(tempid, 1);
- if (cs_get_user_team(tempid) != CS_TEAM_SPECTATOR)
- cs_set_user_team(tempid, CS_TEAM_SPECTATOR);
- }
- return PLUGIN_CONTINUE
- }
- public ClCmdSay( id )
- {
- static szArgs[ 192 ];
- read_args( szArgs, sizeof ( szArgs ) -1 );
- if( !szArgs[ 0 ] ) return PLUGIN_CONTINUE;
- if( !g_bUsersCanChat )
- {
- ColorChat( id, RED, "^x04*^x01 Chat-ul este^x03 blocat^x01." );
- ColorChat( id, RED, "^x04*^x01 Adminii il pot debloca folosind comanda^x03 /on^x01." );
- }
- return g_bUsersCanChat ? PLUGIN_CONTINUE : PLUGIN_HANDLED;
- }
- public ClCmdSayBlocare( id )
- {
- if( !UserHasAcces( id ) )
- {
- ColorChat( id, RED, "^x04*^x03 NU ai acces la aceasta comanda !" );
- return PLUGIN_HANDLED;
- }
- if( !g_bUsersCanChat )
- {
- ColorChat( id, RED, "^x04*^x01 Chat-ul este deja^x03 blocat^x01 ." );
- return PLUGIN_HANDLED;
- }
- new szName[ 32 ];
- get_user_name( id, szName, sizeof ( szName ) -1 );
- ColorChat( 0, RED, "^x04*^x01 Chat-ul a fost ^x03 blocat^x01 de catre adminul^x03 %s^x01 .", szName );
- g_bUsersCanChat = false;
- return PLUGIN_CONTINUE;
- }
- public ClCmdSayDeBlocare( id )
- {
- if( !UserHasAcces( id ) )
- {
- ColorChat( id, RED, "^x04*^x03 NU ai acces la aceasta comanda !" );
- return PLUGIN_HANDLED;
- }
- if( g_bUsersCanChat )
- {
- ColorChat( id, RED, "^x04*^x01 Chat-ul este deja^x03 deblocat^x01 ." );
- return PLUGIN_HANDLED;
- }
- new szName[ 32 ];
- get_user_name( id, szName, sizeof ( szName ) -1 );
- ColorChat( 0, RED, "^x04*^x01 Chat-ul a fost ^x03 deblocat^x01 de catre adminul^x03 %s^x01 .", szName );
- g_bUsersCanChat = true;
- return PLUGIN_CONTINUE;
- }
- public ClCmdSayInterp( id )
- {
- if( !UserHasAcces( id ) )
- {
- ColorChat( id, RED, "^x04*^x03 NU ai acces la aceasta comanda !" );
- return PLUGIN_HANDLED;
- }
- static iSize = sizeof ( g_szInterpCommands );
- for( new i = 0; i < iSize; i++ )
- client_cmd( 0, g_szInterpCommands[ i ] );
- client_print( 0, print_center, "Ati executat setarile de interp " );
- new szName[ 32 ];
- get_user_name( id, szName, sizeof ( szName ) -1 );
- ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a setat interp corect jucatorilor.", szName );
- return PLUGIN_CONTINUE;
- }
- stock bool:UserHasAcces( id )
- {
- if( get_user_flags( id ) & ADMIN_KICK )
- return true;
- return false;
- }
- public hook_say(index)
- {
- static arg[192], command2[192];
- read_args(arg, charsmax (arg));
- if (!arg[0])
- return PLUGIN_CONTINUE;
- remove_quotes(arg[0]);
- for (new x; x < sizeof command; x++)
- {
- if(equal(arg, command[x], strlen(command[x])))
- {
- if(get_user_flags(index) & Caccess[x])
- {
- replace(arg, charsmax(arg), bars, "");
- formatex(command2, charsmax(command2), "amx_%s", arg);
- client_cmd(index, command2);
- }
- break;
- }
- }
- return PLUGIN_CONTINUE;
- }
- public Transfer1(id, level, cid)
- {
- if (!cmd_access(id, level, cid, 2))
- return PLUGIN_HANDLED;
- new unu[32]
- read_argv(1, unu, 31);
- new jucator = cmd_target(id, unu, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF);
- if (!jucator)
- return PLUGIN_HANDLED;
- static name[32], Admin[32];
- get_user_name(jucator, name, 31);
- get_user_name(id, Admin, 31);
- new NumeEchipa[32];
- NumeEchipa = cs_get_user_team(jucator) == CS_TEAM_T
- cs_set_user_team(jucator, CS_TEAM_T);
- NumeEchipa = "Terrorists";
- user_silentkill(jucator);
- ColorChat(id, GREEN, "^x04*^x01 Jucatorul [^x04 %s ^x03] a fost transferat de Adminul [^x04 %s ^x03] la TERO.", name, Admin);
- return PLUGIN_HANDLED;
- }
- public Transfer2(id, level, cid)
- {
- if (!cmd_access(id, level, cid, 2))
- return PLUGIN_HANDLED;
- new unu[32]
- read_argv(1, unu, 31);
- new jucator = cmd_target(id, unu, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF);
- if (!jucator)
- return PLUGIN_HANDLED;
- static name[32], Admin[32];
- get_user_name(jucator, name, 31);
- get_user_name(id, Admin, 31);
- new NumeEchipa[32];
- NumeEchipa = cs_get_user_team(jucator) == CS_TEAM_CT
- cs_set_user_team(jucator, CS_TEAM_CT);
- NumeEchipa = "Counter-Terrorists";
- user_silentkill(jucator);
- ColorChat(id, GREEN, "^x04*^x01 Jucatorul [^x04 %s ^x03] a fost transferat de Adminul [^x04 %s ^x03] la COUNTER.", name, Admin);
- return PLUGIN_HANDLED;
- }
- public Transfer3(id, level, cid)
- {
- if (!cmd_access(id, level, cid, 2))
- return PLUGIN_HANDLED;
- new unu[32]
- read_argv(1, unu, 31);
- new jucator = cmd_target(id, unu, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF);
- if (!jucator)
- return PLUGIN_HANDLED;
- static name[32], Admin[32];
- get_user_name(jucator, name, 31);
- get_user_name(id, Admin, 31);
- new NumeEchipa[32];
- NumeEchipa = cs_get_user_team(jucator) == CS_TEAM_SPECTATOR
- cs_set_user_team(jucator, CS_TEAM_SPECTATOR);
- NumeEchipa = "Spectator";
- user_silentkill(jucator);
- ColorChat(id, GREEN, "^x04*^x01 Jucatorul [^x04 %s ^x03] a fost transferat de Adminul [^x04 %s ^x03] la SPECTATOR.", name, Admin);
- return PLUGIN_HANDLED;
- }
- public chMap(map[])
- {
- server_cmd("changelevel %s", map)
- }
- public cmdMap(id, level, cid)
- {
- if (!cmd_access(id, level, cid, 2))
- return PLUGIN_HANDLED
- new arg[32]
- new arglen = read_argv(1, arg, 31)
- if (!is_map_valid(arg))
- {
- console_print(id, "[AMXX] %L", id, "MAP_NOT_FOUND")
- return PLUGIN_HANDLED
- }
- new authid[32], name[32]
- get_user_authid(id, authid, 31)
- get_user_name(id, name, 31)
- show_activity_key("ADMIN_MAP_1", "ADMIN_MAP_2", name, arg);
- log_amx("Cmd: ^"%s<%d><%s><>^" changelevel ^"%s^"", name, get_user_userid(id), authid, arg)
- new _modName[10]
- get_modname(_modName, 9)
- if (!equal(_modName, "zp"))
- {
- message_begin(MSG_ALL, SVC_INTERMISSION)
- message_end()
- }
- set_task(2.0, "chMap", 0, arg, arglen + 1)
- return PLUGIN_HANDLED
- }
- stock bool:onlyRcon(const name[])
- {
- new pentru=get_cvar_pointer(name);
- if (pentru && get_pcvar_flags(pentru) & FCVAR_PROTECTED)
- {
- return true;
- }
- return false;
- }
- public client_putinserver( id )
- g_On[ id] = 0;
- public cmddemo( id)
- {
- new szSaid[ 192 ], szArgs[ 2 ][ 32 ], szDemoname[ 32 ], iDate[ 32 ], szMapname[ 32 ];
- read_args( szSaid, 191 );
- remove_quotes( szSaid );
- get_time( "%d-%m-%Y-%H-%M-%S", iDate, charsmax( iDate ) );
- get_mapname( szMapname, charsmax( szMapname ) );
- formatex( szDemoname, charsmax( szDemoname ), "%s-%s", szMapname, iDate );
- parse( szSaid, szArgs[ 0 ], 31, szArgs[ 1 ], 31 );
- if( equali( szArgs[ 0 ], "/demo" ) )
- {
- if( !( get_user_flags( id ) & ADMIN_ACCES ) )
- return PLUGIN_HANDLED;
- new iPlayer = cmd_target( id, szArgs[ 1 ], 10 );
- if( !iPlayer )
- {
- client_print(id,print_console, "Jucatorul nu e conectat." );
- return PLUGIN_HANDLED;
- }
- if( !is_user_alive( iPlayer ) )
- {
- client_print(id,print_console, "Jucatorul nu e in viata." );
- return PLUGIN_HANDLED;
- }
- client_cmd( iPlayer, "record ^"%s^"", szDemoname );
- client_print(id,print_console, "* admin %s a primit record", szSaid );
- g_On[ id] = 1;
- return PLUGIN_HANDLED;
- }
- if( equali( szArgs[ 0 ], ".stop" ) )
- {
- if( !( get_user_flags( id ) & ADMIN_ACCES ) )
- return PLUGIN_HANDLED;
- new iPlayer = cmd_target( id, szArgs[ 1 ], 10 );
- if( !iPlayer )
- {
- client_print(id,print_console, "Jucatorul nu e conectat." );
- return PLUGIN_HANDLED;
- }
- if( !is_user_alive( iPlayer ) )
- {
- client_print(id,print_console, "Jucatorul nu e in viata." );
- return PLUGIN_HANDLED;
- }
- if( g_On[ iPlayer ] )
- {
- client_cmd( iPlayer, "stop" );
- client_print(id,print_console, "Demo oprit." );
- g_On[ iPlayer ] = 0;
- }
- return PLUGIN_HANDLED;
- }
- return PLUGIN_CONTINUE;
- }
- public comenzi(id)
- {
- console_print( id, "----------------------------------------" );
- console_print( id, "---- Comenzi administrative disponibile pe server ----" );
- console_print( id, "---------------------------------------" );
- console_print( id, "/comenzi - Lista comenzi war" )
- console_print( id, "/start - Porneste meciul" );
- console_print( id, "/stop - Opreste meciul" );
- console_print( id, "/knife - Porneste runda de lame" );
- console_print( id, "/spec - Muta toti jucatorii spec" );
- console_print( id, "/off - Opreste chat-ul" );
- console_print( id, "/on - Porneste chat-ul" );
- console_print( id, "/setari - Arata in consola setarile jucatorilor " );
- console_print( id, "/interp - Seteaza interp 0.01 jucatorilor" );
- console_print( id, "/pass parola - Pune si anunta in chat parola" );
- console_print( id, "/nopass - Scoate parola" );
- console_print( id, "/warm - Porneste warm-up" );
- console_print( id, "/rr - Restart" );
- console_print( id, "/money - Arata situatia financiara" );
- console_print( id, "/pause- Pune si scoate pauza" );
- console_print( id, "/score - Arata scorul din meci" );
- console_print( id, "/demo nume - Porneste demo jucatorului respectiv comanda se va executa cu chat oprit in say_team" );
- console_print( id, "/swap - Schimba echipele intre ele" );
- console_print( id, "/extra - Porneste rundele de departajare in caz de egal" );
- console_print( id, "/spec nume - Transferi jucatorul la spectatori" );
- console_print( id, "/ct nume - Transferi jucatorul la CT" );
- console_print( id, "/t nume - Transferi jucatorul la T" );
- console_print( id, "/map mapa- Schimba mapa din chat " );
- console_print( id, "----------------------------------------" );
- console_print( id, " ----Comenzi amx: ----" );
- console_print( id, "---------------------------------------" );
- console_print( id, "Pluginul face screenshot automat la 540.0 pov_ss!Pozele se pot gasii in folderul cstrike al fiecarui jucator" );
- console_print( id, "Setari suplimentare gasiti in folderul configs fisier cspro.cfg, se seteaza exclusiv in cspro.cfg" );
- console_print( id, "Acest plugin este un update la h4u v2.1" );
- console_print( id, "----------------------------------------" );
- client_cmd( id, "toggleconsole" );
- return PLUGIN_HANDLED;
- }
- /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
- *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang10250\\ f0\\ fs16 \n\\ par }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement