Advertisement
emilkgb

Mix - Counter-Strike 1.6 Plugin

Apr 25th, 2020
3,110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 41.05 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <fakemeta>
  5. #include <fun>
  6. #include <hamsandwich>
  7. #include <colorchat>
  8.  
  9. new name[32][32]
  10. new rate[32][32]
  11. new updaterate[32][32]
  12. new steamid[35][32]
  13. new cmdrate[32][32]
  14. new interp[32][32]
  15. new jucators[32]
  16. new num
  17.  
  18. new g_max_jucators, g_sync_creat_statustext, g_sync_creat_list
  19.  
  20. new bool:g_teammate[33]
  21.  
  22. new cvar_plugin_on
  23. new cvar_status_on
  24.  
  25. #define ADMIN_ACCES ADMIN_KICK
  26.  
  27. #define VERSION "2.3"
  28.  
  29. new team1_name[32]
  30. new team1_score = 0
  31. new team1_p2_score = 0
  32.  
  33. new team2_name[32]
  34. new team2_score = 0
  35. new team2_p2_score = 0
  36.  
  37. new roundcount = 0
  38.  
  39. new readycount = 0
  40.  
  41. new bool:war
  42. new bool:live
  43. new bool:segparte
  44. new bool:jgdrpronto[32]
  45. new bool:jgdrmsg[32]
  46. new numchecked
  47.  
  48.  
  49. new check_pcvar
  50. new enabled_pcvar
  51. new password_pcvar
  52. // Cvars
  53. new cvar_team1name
  54. new cvar_team2name
  55. new cvar_prefixo
  56. new cvar_autolive        
  57. new cvar_autorec
  58. new cvar_autoss            
  59. new cvar_switchround
  60. new cvar_roundsdraw
  61. new cvar_roundswin
  62.  
  63. new const saycmds[2][] = {
  64.     "score", "clcmd_score"
  65. }
  66. new  g_maxjucators;
  67. new KNIFE = 0;
  68. //new szArg[32];
  69.  
  70. new const g_szInterpCommands[ ][ ] =
  71. {
  72.    "ex_interp 0.01",
  73.    "cl_filterstuffcmd 0",
  74.    "cl_updaterate 101"
  75. };
  76.  
  77. new bool:g_bUsersCanChat = true;
  78.  
  79.  
  80. #define CMDTARGET_OBEY_IMMUNITY (1<<0)
  81. #define CMDTARGET_ALLOW_SELF    (1<<1)
  82. #define CMDTARGET_ONLY_ALIVE    (1<<2)
  83. #define CMDTARGET_NO_BOTS    (1<<3)
  84.  
  85. new const bars[] = "/";
  86.  
  87. new command[][] =
  88. {
  89.   "/t",
  90.   "/ct",
  91.   "/spec",
  92.    "/map"
  93. };
  94. new Caccess[] =
  95. {
  96.    ADMIN_KICK,
  97.    ADMIN_KICK,
  98.    ADMIN_KICK,
  99.    ADMIN_MAP
  100. };
  101. new g_On[ 33 ] = 0;
  102.  
  103.  
  104. public plugin_init()
  105. {
  106.     register_plugin("war5vs5", VERSION, "cs16cluj")
  107.    
  108.     register_clcmd("say /start", "clcmd_start", ADMIN_KICK)
  109.     register_clcmd("say_team /start", "clcmd_start", ADMIN_KICK)
  110.     register_clcmd("say /stop", "clcmd_stop", ADMIN_ACCES)
  111.     register_clcmd("say_team /stop", "clcmd_stop", ADMIN_ACCES)
  112.     register_clcmd("say /knife","say_knife", ADMIN_KICK,"-Runda de lame");
  113.     register_clcmd("say_team /knife","say_knife", ADMIN_KICK,"-Runda de lame");
  114.    
  115.     register_event("CurWeapon","switchweapon","be","1=1","2!29")
  116.     register_clcmd("say /warm", "warm", ADMIN_KICK, "- Incalzire ");
  117.     register_clcmd("say_team /warm", "warm", ADMIN_KICK, "- Incalzire ");
  118.     register_clcmd("say /rr","rr",ADMIN_KICK,"-Restart");
  119.     register_clcmd("say_team /rr","rr",ADMIN_KICK,"-Restart");
  120.     register_clcmd("say /pause", "pauza", ADMIN_KICK, "- Pause/Unpause")
  121.     register_clcmd("say_team /pause", "pauza", ADMIN_KICK, "- Pause/Unpause")
  122.     register_clcmd("say /setari", "rates_list", ADMIN_KICK, "- rates ");
  123.     register_clcmd("say_team /setari", "rates_list", ADMIN_KICK, "- rates ");
  124.     register_clcmd("say /extra", "extra", ADMIN_KICK, "- Runde de departajare ");
  125.     register_clcmd("say_team /extra", "extra", ADMIN_KICK, "- Runde de departajare ");
  126.     register_clcmd("say /swap", "swap", ADMIN_KICK, "- Schimba echipele intre ele");
  127.     register_clcmd("say_team /swap", "swap", ADMIN_KICK, "- Schimba echipele intre ele");
  128.     register_concmd("amx_t", "Transfer1", ADMIN_KICK, "<name>  - send to T's team");
  129.     register_concmd("amx_ct", "Transfer2", ADMIN_KICK, "<name>  - send to CT's team");
  130.     register_concmd("amx_spec", "Transfer3", ADMIN_KICK, "<name>  - send to Spectators team");
  131.  
  132.  
  133.     register_clcmd("say /off", "ClCmdSayBlocare" );
  134.     register_clcmd("say_team /off", "ClCmdSayBlocare" );
  135.     register_clcmd("say /on", "ClCmdSayDeBlocare" );
  136.     register_clcmd("say_team /on", "ClCmdSayDeBlocare" );
  137.     register_clcmd("say /interp", "ClCmdSayInterp" );
  138.     register_clcmd("say_team /interp", "ClCmdSayInterp" );
  139.     register_clcmd("say", "cmddemo" );
  140.     register_clcmd("say_team", "cmddemo" );
  141.     register_clcmd("say", "ClCmdSay" )
  142.     register_clcmd("say /comenzi", "comenzi" );
  143.     register_clcmd("say_team /comenzi", "comenzi" );
  144.     register_clcmd ("say", "hook_say");
  145.     register_clcmd ("say_team", "hook_say");
  146.     set_msg_block(49, BLOCK_SET)
  147.    
  148.     set_task(1.0, "executarConfig")
  149.     g_maxjucators = get_maxjucators();
  150.     new delay_pcvar = register_cvar("apr_checkdelay","60.0")
  151.     check_pcvar = register_cvar("apr_checktimes","2")
  152.     enabled_pcvar = register_cvar("apr_enabled","1")
  153.  
  154.     password_pcvar = get_cvar_pointer("sv_password")
  155.  
  156.     numchecked = 0
  157.  
  158.     if(get_pcvar_float(delay_pcvar)<=1.0)
  159.     set_pcvar_float(delay_pcvar,1.0)
  160.  
  161.     set_task(get_pcvar_float(delay_pcvar),"check_server",0,"",0,"b")
  162.  
  163.    
  164.     RegisterHam(Ham_Spawn, "jucator", "jucator_spawn", 1)
  165.    
  166.     register_clcmd("say /money", "clcmd_money")
  167.     register_clcmd("say_team /money", "clcmd_money")
  168.     register_event("StatusValue", "show_teammate_money", "be", "1=2", "2!0")
  169.     register_event("StatusValue", "set_team", "be", "1=1")
  170.    
  171.     cvar_plugin_on = register_cvar("stm_on", "1")
  172.     cvar_status_on = register_cvar("stm_st_on", "1")
  173.    
  174.     g_max_jucators = get_maxjucators()
  175.     g_sync_creat_statustext = CreateHudSyncObj()
  176.     g_sync_creat_list = CreateHudSyncObj()
  177.     new i, x
  178.     for(i = 0; i < 2; i++)
  179.     {
  180.         x = i + 1
  181.         new comando[32]
  182.         format(comando, sizeof(comando), "say /%s", saycmds[i])
  183.         register_clcmd(comando, saycmds[x])
  184.         format(comando, sizeof(comando), "say_team /%s", saycmds[i])
  185.         register_clcmd(comando, saycmds[x])
  186.         i++
  187.     }
  188.    
  189.    
  190.     cvar_team1name = register_cvar("amx_cspro_equipa1", "Team1")
  191.     cvar_team2name = register_cvar("amx_cspro_equipa2", "Team2")
  192.     cvar_prefixo = register_cvar("amx_cspro_prefixo", "[]")
  193.     cvar_autolive = register_cvar("amx_cspro_autolive", "1")
  194.     cvar_autorec = register_cvar("amx_cspro_autorec", "0")
  195.     cvar_autoss = register_cvar("amx_cspro_autoss", "1")
  196.     cvar_roundswin = register_cvar("amx_cspro_winrounds", "16")    
  197.     cvar_roundsdraw = register_cvar("amx_cspro_rounddraw", "15")
  198.     cvar_switchround = register_cvar("amx_cspro_switchround", "15")
  199.    
  200.     register_event("SendAudio","event_EndRound","a","2=%!MRAD_terwin","2=%!MRAD_ctwin")
  201.     register_event("ResetHUD", "event_ResetHud", "b");
  202.    
  203.     register_concmd("amx_map", "cmdMap", ADMIN_MAP, "<mapname>")
  204.    
  205.     register_clcmd("say /spec", "cmd_spec", ADMIN_ACCES)
  206.     register_clcmd("say_team /spec", "cmd_spec", ADMIN_ACCES)
  207.     register_clcmd("say", "password", ADMIN_ACCES)
  208.     register_clcmd("say_team", "password", ADMIN_ACCES)
  209.     register_clcmd("say /nopass", "nopassword", ADMIN_ACCES)
  210.     register_clcmd("say_team /nopass", "nopassword", ADMIN_ACCES)
  211.    
  212. }
  213.  
  214. public password(id, level, cid)
  215. {
  216.     static message[64]
  217.     read_args (message, 63)
  218.     remove_quotes (message)
  219.      
  220.     if( (message[0] == '/' || message[0] == '/' || message[0] == '.')  
  221.     && message[1] == 'p' && message[2] == 'a' && message[3] == 's' && message[4] == 's' )
  222.     {
  223.         static pass[31];
  224.         strbreak(message, message, 6, pass, 30);
  225.         remove_quotes(pass);
  226.              
  227.         {
  228.             client_cmd(id, "amx_cvar sv_password %s", pass)
  229.         }
  230.  
  231.         ColorChat( 0, DontChange,  "^x04*^x01 Parola setata este ^x04* %s", pass)
  232.          
  233.         return PLUGIN_HANDLED
  234.     }
  235.     return PLUGIN_CONTINUE
  236. }
  237.  
  238. public nopassword(id, level, cid)
  239. {
  240. if(!cmd_access(id, level, cid, 0))
  241. return PLUGIN_CONTINUE;
  242. client_cmd(id, "amx_cvar sv_password ^"^"")
  243. ColorChat( 0, DontChange, "^x04*^x01 Parola a fost scoasa de adminul ^x03%s^x01 ")
  244. return PLUGIN_CONTINUE
  245. }  
  246. public check_server()
  247. {
  248.     if(get_pcvar_num(enabled_pcvar))
  249.     {
  250.         new curpass[32]
  251.         get_pcvar_string(password_pcvar,curpass,31)
  252.        
  253.         if(strlen(curpass)>0 && !equali(curpass,"none"))
  254.         {
  255.             new jucators[32], num
  256.             get_jucators(jucators,num,"ch")
  257.             if(num==0)
  258.             {
  259.                 numchecked++
  260.                 if(numchecked>=get_pcvar_num(check_pcvar))
  261.                 {
  262.                     log_amx("%L",0,"MSG_REMOVE")
  263.                    
  264.                     set_cvar_string("sv_password","none")
  265.                    
  266.                     numchecked=0
  267.                 }
  268.             }
  269.             else
  270.                 numchecked = 0
  271.         }
  272.         else
  273.             numchecked = 0
  274.     }
  275.     else
  276.         numchecked = 0
  277. }
  278. public clcmd_start(id, level, cid)
  279. {
  280.  
  281.     if(!cmd_access(id, level, cid, 0))
  282.         return PLUGIN_HANDLED
  283.        
  284.     if(live)
  285.     {
  286.         new szName[ 32 ];
  287.         get_user_name( id, szName, sizeof ( szName ) -1 );
  288.         ColorChat( id, RED, "^x04*^x01 admin ^x03%s^x01 ~ Meciul este in curs, intai tasteaza /stop.", szName );
  289.         return PLUGIN_HANDLED
  290.     }
  291.    
  292.     if(!segparte)
  293.     {
  294.         console_print(id, "Se porneste meciul.")
  295.        
  296.         reniciar_dados()
  297.        
  298.         war = true
  299.         KNIFE = 0;
  300.         server_cmd("mp_friendlyfire 1");
  301.         server_cmd("mp_roundtime 1.75");
  302.         server_cmd("mp_freezetime 10");
  303.         server_cmd("mp_limitteams 1");
  304.         server_cmd("mp_autoteambalance 0");
  305.         server_cmd("mp_autokick 0");
  306.         server_cmd("mp_forcechasecam 2");
  307.         server_cmd("mp_forcecamera 2");
  308.         server_cmd("mp_buytime 0.15");
  309.         server_cmd("mp_startmoney 800");
  310.         new szName[ 32 ];
  311.         get_user_name( id, szName, sizeof ( szName ) -1 );
  312.         ColorChat( id, RED, "^x04*^x01 admin ^x03%s^x01 ~ Meciul a inceput - GL~HF.", szName );
  313.         if(get_pcvar_num(cvar_autorec))
  314.             pov_record()
  315.            
  316.         if(get_pcvar_num(cvar_autolive))
  317.             set_task(1.0, "executar_lo3")
  318.         if(get_pcvar_num(cvar_autoss))
  319.             set_task(540.0,"pov_ss",_,_,_,"b");
  320.     }
  321.     return PLUGIN_HANDLED
  322. }
  323.  
  324. public clcmd_stop(id, level, cid)
  325. {
  326.  
  327.     if(!cmd_access(id, level, cid, 0))
  328.         return PLUGIN_HANDLED
  329.        
  330.     if(!war)
  331.     {
  332.     new szName[ 32 ];
  333.     get_user_name( id, szName, sizeof ( szName ) -1 );
  334.     ColorChat( id, RED, "^x04*^x01 admin ^x03%s^x01 ~ Meciul s-a terminat - GL.", szName );
  335.     KNIFE = 0;
  336.     server_cmd("sv_restart 1");
  337.     server_cmd("mp_friendlyfire 1");
  338.     server_cmd("mp_freezetime 0");
  339.     server_cmd("mp_forcechasecam 2");
  340.     server_cmd("mp_forcecamera 2");
  341.     server_cmd("mp_limitteams 0");
  342.     server_cmd("mp_startmoney 16000");
  343.     server_cmd("mp_roundtime 1.75");
  344.     server_cmd("mp_buytime 3.0");
  345.     server_cmd("sv_restart 1");
  346.     return PLUGIN_HANDLED
  347.     }
  348.     new szName[ 32 ];
  349.     get_user_name( id, szName, sizeof ( szName ) -1 );
  350.     ColorChat( id, RED, "^x04*^x01 admin ^x03%s^x01 ~ Meciul s-a terminat - GL.", szName );
  351.     KNIFE = 0;
  352.     server_cmd("sv_restart 1");
  353.     server_cmd("mp_friendlyfire 1");
  354.     server_cmd("mp_freezetime 0");
  355.     server_cmd("mp_forcechasecam 2");
  356.     server_cmd("mp_forcecamera 2");
  357.     server_cmd("mp_limitteams 0");
  358.     server_cmd("mp_startmoney 16000");
  359.     server_cmd("mp_roundtime 1.75");
  360.     server_cmd("mp_buytime 3.0");
  361.     server_cmd("sv_restart 1");
  362.     war = false
  363.     live = false
  364.    
  365.     if(get_pcvar_num(cvar_autoss))
  366.     remove_task(1);
  367.    
  368.     return PLUGIN_HANDLED
  369. }
  370.  
  371. public clcmd_live(id, level, cid)
  372. {
  373.  
  374.     if(!cmd_access(id, level, cid, 0))
  375.         return PLUGIN_HANDLED
  376.        
  377.     executar_lo3()
  378.    
  379.     return PLUGIN_HANDLED
  380. }
  381.  
  382. public clcmd_score(id)
  383. {
  384.     if(!war)
  385.         return PLUGIN_CONTINUE
  386.        
  387.     get_pcvar_string(cvar_team1name, team1_name, 31)
  388.     get_pcvar_string(cvar_team2name, team2_name, 31)
  389.    
  390.     chatprint(id, "Score: ^x03%s^x01 %d - %d ^x03%s^x01", team1_name, team1_score, team2_score, team2_name)
  391.    
  392.     return PLUGIN_CONTINUE
  393. }
  394.  
  395. public client_connect(id)
  396. {
  397.     client_cmd(id, "echo =====================================================")
  398.     client_cmd(id, "echo Serverul foloseste pluginul de War: War5vs5 V2.3")
  399.     client_cmd(id, "echo =====================================================")
  400. }
  401.  
  402. public client_disconnect(id)
  403. {
  404.     if(jgdrpronto[id])
  405.     {
  406.         jgdrpronto[id] = false
  407.  
  408.         readycount--
  409.        
  410.         set_task(2.0, "remove")
  411.     }
  412. }
  413.  
  414. public event_ResetHud(id)
  415. {
  416.     if(is_user_alive(id))
  417.     {
  418.         if(!jgdrmsg[id])
  419.         {
  420.         client_cmd(id, "echo  Tasteaza /comenzi in chat pentru a vedea in consola toate comenzile de war/mix!")
  421.         jgdrmsg[id] = true
  422.         }
  423.        
  424.     }
  425.    
  426. }
  427.  
  428. public event_EndRound()
  429. {
  430.     get_pcvar_string(cvar_team1name, team1_name, 31)
  431.     get_pcvar_string(cvar_team2name, team2_name, 31)
  432.  
  433.     if(live)
  434.     {
  435.         new numroundswin = get_pcvar_num(cvar_roundswin)
  436.         new numroundsdraw = get_pcvar_num(cvar_roundsdraw)
  437.        
  438.         new msg[32]
  439.         read_data(2,msg,32)
  440.        
  441.         if(containi(msg,"ct") != -1)
  442.         {
  443.             if(segparte)
  444.                 team2_score++
  445.             else
  446.                 team1_score++
  447.         }
  448.        
  449.         else if(contain(msg,"ter") != -1)
  450.         {
  451.             if(segparte)
  452.                 team1_score++
  453.             else
  454.                 team2_score++
  455.         }
  456.        
  457.         if(team1_score == numroundswin)
  458.         {
  459.             chatprint(0, "Echipa ^x03%s^x01 a castigat !", team1_name)
  460.             chatprint(0, "Results: ^x03%s^x01 %d - %d ^x03%s^x01", team1_name, team1_score, team2_score, team2_name)
  461.             live = false
  462.             war = false
  463.             reniciar_dados()
  464.             KNIFE = 0;
  465.             server_cmd("sv_restart 1");
  466.             server_cmd("mp_friendlyfire 1");
  467.             server_cmd("mp_freezetime 0");
  468.             server_cmd("mp_limitteams 0");
  469.             server_cmd("mp_startmoney 16000");
  470.             server_cmd("mp_forcechasecam 2");
  471.             server_cmd("mp_forcecamera 2");
  472.             server_cmd("mp_roundtime 1.75");
  473.             server_cmd("mp_buytime 3.0");
  474.             return PLUGIN_HANDLED
  475.             }
  476.  
  477.         else if(team2_score == numroundswin)
  478.         {
  479.             chatprint(0, "Echipa ^x03%s^x01 a castigat!", team2_name)
  480.             chatprint(0, "Results: ^x03%s^x01 %d - %d ^x03%s^x01", team1_name, team1_score, team2_score, team2_name)
  481.             live = false
  482.             war = false
  483.             reniciar_dados()
  484.             KNIFE = 0;
  485.             server_cmd("sv_restart 1");
  486.             server_cmd("mp_friendlyfire 1");
  487.             server_cmd("mp_freezetime 0");
  488.             server_cmd("mp_limitteams 0");
  489.             server_cmd("mp_startmoney 16000");
  490.             server_cmd("mp_forcechasecam 2");
  491.             server_cmd("mp_forcecamera 2");
  492.             server_cmd("mp_roundtime 1.75");
  493.             server_cmd("mp_buytime 3.0");
  494.             return PLUGIN_HANDLED
  495.         }
  496.        
  497.         else if(team1_score == numroundsdraw && team2_score == numroundsdraw)
  498.         {
  499.             chatprint(0, "Sa terminat egal intre cele doua echipe.")
  500.             chatprint(0, "Results: ^x03%s^x01 %d - %d ^x03%s^x01", team1_name, team1_score, team2_score, team2_name)
  501.             live = false
  502.             war = false
  503.             reniciar_dados()
  504.             KNIFE = 0;
  505.             server_cmd("sv_restart 1");
  506.             server_cmd("mp_friendlyfire 1");
  507.             server_cmd("mp_freezetime 0");
  508.             server_cmd("mp_limitteams 0");
  509.             server_cmd("mp_startmoney 16000");
  510.             server_cmd("mp_forcechasecam 2");
  511.             server_cmd("mp_forcecamera 2");
  512.             server_cmd("mp_roundtime 1.75");
  513.             server_cmd("mp_buytime 3.0");
  514.             return PLUGIN_HANDLED
  515.         }
  516.        
  517.         else
  518.         {
  519.             roundcount++
  520.            
  521.             if(roundcount == get_pcvar_num(cvar_switchround))
  522.             {
  523.                 live = false
  524.                 chatprint(0, "Sfarsitul primei parti!")
  525.                 chatprint(0, "Score: ^x03%s^x01 %d - %d ^x03%s^x01", team1_name, team1_score, team2_score, team2_name)
  526.                 chatprint(0, "Schimb echipele ...")
  527.                
  528.                 segparte = true
  529.                 team1_p2_score = team1_score
  530.                 team2_p2_score = team2_score
  531.                 set_task(1.0, "trocar_equipas")
  532.                
  533.                 if(get_pcvar_num(cvar_autolive))
  534.                     set_task(1.0, "executar_lo3")
  535.  
  536.             }
  537.         }
  538.        
  539.     }
  540.     return PLUGIN_CONTINUE
  541. }
  542.  
  543. public executar_lo3()
  544. {
  545.  
  546.     if(!war)
  547.         return PLUGIN_HANDLED
  548.    
  549.     if(segparte)
  550.     {
  551.         team1_score = team1_p2_score
  552.         team2_score = team2_p2_score
  553.         roundcount = 15
  554.     }
  555.     else
  556.     {
  557.         team1_score = 0
  558.         team2_score = 0
  559.         roundcount = 0
  560.     }
  561.    
  562.     set_task(1.0, "lo3_rr1")
  563.     return PLUGIN_CONTINUE
  564. }
  565.  
  566. public lo3_rr1()
  567. {
  568.     if(!war)
  569.         return PLUGIN_HANDLED
  570.    
  571.     server_cmd("sv_restart 1")
  572.     chatprint(0, "Live ! Live ! Live ! " )
  573.     chatprint(0, "Live ! Live ! Live ! " )
  574.     chatprint(0, "Live ! Live ! Live ! " )
  575.     set_task(1.0, "lo3_saylive")
  576.     return PLUGIN_CONTINUE
  577. }
  578.  
  579. public lo3_saylive()
  580. {
  581.  
  582.     if(!war)
  583.         return PLUGIN_HANDLED
  584.  
  585.     live = true
  586.    
  587.     return PLUGIN_CONTINUE
  588. }
  589.  
  590.  
  591. public reniciar_dados()
  592. {
  593.     team1_score = 0
  594.     team2_score = 0
  595.     team1_p2_score = 0
  596.     team2_p2_score = 0
  597.     roundcount = 0
  598.     segparte = false
  599.     readycount = 0
  600.    
  601.     for(new i; i < 32; i++)
  602.         jgdrpronto[i] = false
  603. }
  604.  
  605.  
  606. public trocar_equipas()
  607. {
  608.     new jogador[32], numjogadores, i
  609.    
  610.     get_jucators(jogador, numjogadores, "h")
  611.    
  612.     for(i = 0; i < numjogadores; i++)
  613.     {
  614.         if(is_user_connected(jogador[i]))
  615.         {
  616.             if(cs_get_user_team(jogador[i]) != CS_TEAM_SPECTATOR)
  617.             {
  618.                 if(cs_get_user_team(jogador[i]) == CS_TEAM_CT)
  619.                     cs_set_user_team(jogador[i], CS_TEAM_T)
  620.                 else
  621.                     cs_set_user_team(jogador[i], CS_TEAM_CT)
  622.             }
  623.         }
  624.     }
  625. }
  626.  
  627. public pov_record()
  628. {
  629.    
  630.    
  631.     new jogador[32], numjogadores, i
  632.    
  633.     get_jucators(jogador, numjogadores, "h")
  634.    
  635.     new time_date[32]
  636.     new map_name[32]
  637.    
  638.     get_mapname ( map_name, 31 )
  639.    
  640.     get_time("%d-%m-%Y_%H-%M",time_date,31)
  641.    
  642.     get_pcvar_string(cvar_team1name, team1_name, 31)
  643.     get_pcvar_string(cvar_team2name, team2_name, 31)
  644.    
  645.     for(i = 0; i < numjogadores; i++)
  646.     {
  647.         if(is_user_connected(jogador[i]))
  648.         {
  649.             if(cs_get_user_team(jogador[i]) != CS_TEAM_SPECTATOR)
  650.             {
  651.                 new demo[256]
  652.                
  653.                 formatex(demo, sizeof(demo), "%s vs %s %s %s", team1_name, team2_name, time_date, map_name)
  654.                
  655.                 client_cmd(jogador[i], "stop")
  656.                
  657.                 while(replace(demo,255,"/","_")) {}
  658.                 while(replace(demo,255,"\","_")) {}
  659.                while(replace(demo,255,":","_")) {}
  660.                while(replace(demo,255,"*","_")) {}
  661.                while(replace(demo,255,"?","_")) {}
  662.                while(replace(demo,255,">","_")) {}
  663.                while(replace(demo,255,"<","_")) {}
  664.                while(replace(demo,255,"|","_")) {}
  665.                
  666.                client_cmd(jogador[i], "record ^"%s.dem.dem^"", demo)
  667.    
  668.                chatprint(jogador[i], "Inregistrare demo: ^x03%s", demo)
  669.            }
  670.        }
  671.    }
  672.    
  673.    
  674. }
  675.  
  676. public pov_ss(id)
  677. {
  678.  
  679. static jucators[32], index, num, i;
  680. get_jucators(jucators, num, "ch");
  681.  
  682. for(i = 0;i < num;i++)
  683. {
  684. index = jucators[i];
  685. if(!is_user_connected(index))
  686. continue;
  687. if(is_user_hltv(index))
  688. continue;
  689. client_cmd(id, "echo ScreenShot taken");
  690. client_cmd(index, "snapshot" );
  691.         }
  692. }
  693.  
  694.  
  695. public executarConfig()
  696. {
  697.    new Cfg[64]
  698.    get_configsdir(Cfg, 63)
  699.    add(Cfg, 63, "/h4u.cfg")
  700.    
  701.    if(file_exists(Cfg))
  702.        server_cmd("exec %s", Cfg)
  703.    else {
  704.        new f = fopen(Cfg, "wt")
  705.        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");
  706.        
  707.         new valortxt[32]
  708.        
  709.         fprintf(f, "amx_cspro_autorec ^"%i^"    // Auto Recording (POV)^n", get_pcvar_num(cvar_autorec))
  710.         fprintf(f, "amx_cspro_autoss ^"%i^"    // Auto ScreenShot (POV)^n", get_pcvar_num(cvar_autoss))
  711.         fprintf(f, "amx_cspro_winrounds ^"%i^"    // Number of rounds required to a team win the match^n", get_pcvar_num(cvar_roundswin))
  712.         fprintf(f, "amx_cspro_rounddraw ^"%i^"    // Number of rounds required to draw^n", get_pcvar_num(cvar_roundsdraw))
  713.        
  714.         fprintf(f, "amx_cspro_switchround ^"%i^"    // Number of rounds required to switch teams^n", get_pcvar_num(cvar_switchround))
  715.        
  716.         get_pcvar_string(cvar_prefixo, valortxt, 31)
  717.         fprintf(f, "amx_cspro_prefixo ^"%s^"    // Prefix of messages^n", valortxt)
  718.        
  719.         fclose(f)
  720.     }
  721.    
  722.     register_forward(FM_GetGameDescription, "fw_nomejogo", 0)
  723. }
  724. public fw_nomejogo()
  725. {
  726.     new NomeJogo[32]
  727.     format(NomeJogo, sizeof(NomeJogo), "War~5vs5v%s", VERSION)
  728.    
  729.     forward_return(FMV_STRING, NomeJogo)
  730.    
  731.     return FMRES_SUPERCEDE
  732. }
  733.  
  734. stock chatprint(target, const message[], any:...)
  735. {
  736.     static buffer[512], msg_SayText = 0
  737.     if( !msg_SayText ) msg_SayText = get_user_msgid("SayText")
  738.    
  739.     new cvarprefixo[32]
  740.     get_pcvar_string(cvar_prefixo, cvarprefixo, 31)
  741.    
  742.     if (!target)
  743.     {
  744.         static jucator, maxjucators
  745.         maxjucators = get_maxjucators()
  746.        
  747.         for (jucator = 1; jucator <= maxjucators; jucator++)
  748.         {
  749.             if (!is_user_connected(jucator))
  750.                 continue;
  751.            
  752.             vformat(buffer, charsmax(buffer), message, 3)
  753.             format(buffer, charsmax(buffer), "^x04%s^x01 %s", cvarprefixo, buffer)
  754.            
  755.             message_begin(MSG_ONE_UNRELIABLE, msg_SayText, _, jucator)
  756.             write_byte(jucator)
  757.             write_string(buffer)
  758.             message_end()
  759.            
  760.         }
  761.     }
  762.     else
  763.     {
  764.         vformat(buffer, charsmax(buffer), message, 3)
  765.         format(buffer, charsmax(buffer), "^x04%s^x01 %s", cvarprefixo, buffer)
  766.        
  767.         message_begin(MSG_ONE, msg_SayText, _, target)
  768.         write_byte(target)
  769.         write_string(buffer)
  770.         message_end()
  771.     }
  772. }
  773. public switchweapon(id)
  774. {
  775.     if (KNIFE == 1)
  776.     {
  777.         engclient_cmd(id, "weapon_knife");
  778.     }
  779. }
  780.  
  781. public say_knife(id, level, cid)
  782. {
  783.     if (!cmd_access(id,level,cid,2))
  784.     {
  785.         return PLUGIN_HANDLED;
  786.     }
  787.    
  788.     server_cmd("sv_restart 1");
  789.     server_cmd("mp_startmoney 800");
  790.     KNIFE = 1;
  791.     server_cmd("mp_freezetime 0");
  792.     new szName[ 32 ];
  793.     get_user_name( id, szName, sizeof ( szName ) -1 );
  794.     ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a pornit runda de lame - GL & HF.", szName );
  795.     strip_user_weapons(id);
  796.     give_item(id, "weapon_knife");
  797.     war = false
  798.     live = false
  799.     return PLUGIN_HANDLED;
  800. }
  801. public warm(id,level,cid){
  802.     if(!cmd_access(id,level,cid,1))
  803.         return PLUGIN_HANDLED;
  804.     KNIFE = 0;
  805.     server_cmd("sv_restart 1");
  806.     server_cmd("mp_friendlyfire 0");
  807.     server_cmd("mp_freezetime 0");
  808.     server_cmd("mp_limitteams 0");
  809.     server_cmd("mp_startmoney 16000");
  810.     server_cmd("mp_forcechasecam 2");
  811.     server_cmd("mp_forcecamera 2");
  812.     server_cmd("mp_roundtime 1.75");
  813.     server_cmd("mp_buytime 3.0");
  814.     new szName[ 32 ];
  815.     get_user_name( id, szName, sizeof ( szName ) -1 );
  816.     ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a pornit rundele de incalzire - HF.", szName );
  817.     war = false
  818.     live = false
  819.     KNIFE = 0;
  820.     KNIFE = 0;
  821.     return PLUGIN_HANDLED;
  822. }
  823. public rr(id,level,cid){
  824.     if(!cmd_access(id,level,cid,1))
  825.         return PLUGIN_HANDLED;
  826.     KNIFE = 0;
  827.     server_cmd("sv_restartround 1");
  828.     server_cmd("mp_forcechasecam 2");
  829.     server_cmd("mp_forcecamera 2");
  830.     new szName[ 32 ];
  831.     get_user_name( id, szName, sizeof ( szName ) -1 );
  832.     ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a dat Restart - GL & HF.", szName );
  833.     return PLUGIN_HANDLED;
  834. }
  835. public pauza(id,level,cid){
  836.     if(!cmd_access(id,level,cid,1))
  837.         return PLUGIN_HANDLED;
  838.     KNIFE = 0;
  839.     server_cmd("amx_pause");
  840.     new szName[ 32 ];
  841.     get_user_name( id, szName, sizeof ( szName ) -1 );
  842.     ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a dat Pause/Unpause.", szName );
  843.    
  844.     return PLUGIN_HANDLED;
  845. }
  846. public extra(id,level,cid){
  847.     if(!cmd_access(id,level,cid,1))
  848.         return PLUGIN_HANDLED;
  849.     war = false
  850.     live = false
  851.     KNIFE = 0;
  852.     server_cmd("sv_restart 1");
  853.     server_cmd("mp_forcechasecam 2");
  854.     server_cmd("mp_forcecamera 2");
  855.     server_cmd("mp_limitteams 1");
  856.     server_cmd("mp_startmoney 10000");
  857.     server_cmd("mp_roundtime 1.75");
  858.     server_cmd("mp_buytime 0.15");
  859.     server_cmd("mp_freezetime 10");
  860.     new szName[ 32 ];
  861.     get_user_name( id, szName, sizeof ( szName ) -1 );
  862.     ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a pornit rundele de departajare - GL & HF.", szName );
  863.     war = true
  864.     live = true
  865.     KNIFE = 0;
  866.     return PLUGIN_HANDLED;
  867. }
  868.  
  869. public swap( id, level, cid )
  870. {
  871.     if( !cmd_access( id, level, cid, 1 ) )
  872.         return PLUGIN_HANDLED;
  873.    
  874.     for( new i = 1; i <= g_maxjucators; i++ )
  875.     {
  876.         if( !is_user_connected( i ) )
  877.             continue;
  878.        
  879.         switch( get_user_team( i ) )
  880.         {
  881.             case 1: cs_set_user_team( i, CS_TEAM_CT );
  882.                 case 2: cs_set_user_team( i, CS_TEAM_T );
  883.                 default: continue;
  884.         }
  885.     }
  886.    
  887.     server_cmd( "sv_restart 1" );
  888.     set_hudmessage(85, 212, 255, 0.05, 0.36, 0, 6.0, 5.0)
  889.     new szName[ 32 ];
  890.     get_user_name( id, szName, sizeof ( szName ) -1 );
  891.     ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a schimbat echipele intre ele incepe meciul - GL & HF.", szName );
  892.    
  893.     return PLUGIN_HANDLED;
  894.    
  895. }
  896.  
  897. public clcmd_money(client)
  898. {
  899.     if (!get_pcvar_num(cvar_plugin_on))
  900.     {
  901.         client_print(client, print_chat, "[]: Situatia financiara off.")
  902.         return PLUGIN_HANDLED
  903.     }
  904.     show_money(client)
  905.     return PLUGIN_CONTINUE
  906. }
  907.  
  908. public jucator_spawn(client)
  909. {
  910.     clcmd_score(client)
  911.     remove_task(client)
  912.     if (is_user_alive(client) && get_pcvar_num(cvar_plugin_on))
  913.     {
  914.         set_task(1.0, "show_money", client)
  915.     }
  916. }
  917.  
  918. public show_money(client)
  919. {
  920.     static message[1024];
  921.     static name[32];
  922.    
  923.     new money, id, len;
  924.    
  925.     len = format(message, charsmax(message), "Situatia financiara a echipei:^n");
  926.     for (id = 1; id <= g_max_jucators; id++)
  927.     {
  928.         if (id != client && is_user_connected(id) && get_user_team(id) == get_user_team(client))
  929.         {
  930.             money = cs_get_user_money(id);
  931.             get_user_name(id, name, 31);
  932.             len += format(message[len], charsmax(message) - len, "%-22.22s: %d^n", name, money);
  933.         }
  934.     }
  935.     set_hudmessage(100, 200, 0, 0.05, 0.35, 0, 0.02, 5.0, 0.1, 0.2, 2);
  936.     ShowSyncHudMsg(client, g_sync_creat_list, message);
  937. }
  938.  
  939. public set_team(id)
  940.     g_teammate[id] = bool:(read_data(2) == 1);
  941.  
  942. public show_teammate_money(id)
  943. {
  944.     if (!get_pcvar_num(cvar_plugin_on))
  945.         return PLUGIN_HANDLED
  946.     if(!is_user_bot(id) && is_user_connected(id) && get_pcvar_num(cvar_status_on))
  947.     {
  948.         static name[32]
  949.        
  950.         new pid = read_data(2)
  951.         new red = 0, blue = 0
  952.        
  953.         if (cs_get_user_team(pid) == CS_TEAM_T)
  954.             red = 255
  955.         else if(cs_get_user_team(pid) == CS_TEAM_CT)
  956.             blue = 255
  957.        
  958.         get_user_name(pid, name, charsmax(name))
  959.         new money = cs_get_user_money(pid)
  960.         if (g_teammate[id])
  961.         {
  962.             set_hudmessage(red, 50, blue, -1.0, 0.60, 1, 0.01, 0.6, 0.01, 0.01, 8)
  963.             ShowSyncHudMsg(id, g_sync_creat_statustext, "", name, money)
  964.         }
  965.         else {
  966.             set_hudmessage(red, 50, blue, -1.0, 0.60, 1, 0.01, 0.6, 0.01, 0.01, 8)
  967.             ShowSyncHudMsg(id, g_sync_creat_statustext, "", name)
  968.         }
  969.     }
  970.     return PLUGIN_CONTINUE
  971. }
  972.  
  973. public rates_list(id, level, cid) {
  974.    
  975.     //Check if the user has the required access level
  976.     if (!cmd_access(id,level,cid,1))
  977.         return PLUGIN_HANDLED    
  978.  
  979.     //Print an info line to the users console
  980.     client_print(id, print_console, "Generating Rates List...")  
  981.  
  982.    //Retrieve the rate information
  983.     getrates(id)
  984.    
  985.    
  986.    
  987.     //Wait 1 second for all query_client_cvar calls to finish the print rate info to console
  988.     set_task(1.0, "printrates", id, "", 0, "a", 1)
  989.    
  990.      
  991.     return PLUGIN_HANDLED
  992. }
  993.  
  994.  
  995. public cmdrate_result_func(id,const cvar[],const value[],const param[])
  996. {
  997.     copy(cmdrate[param[0]],31,value)
  998.  
  999. }
  1000.  
  1001. public interp_result_func(id,const cvar[],const value[], const param[])
  1002. {
  1003.     copy(interp[param[0]],31,value)
  1004.  
  1005. }
  1006.  
  1007. public getrates(id)
  1008. {
  1009.     //Get Number of jucators in the server
  1010.     get_jucators(jucators,num,"c")
  1011.        
  1012.     //Loop for all jucators and retrieve rate info
  1013.     for (new i[1] = 0; i[0] < num; ++i[0]) {
  1014.        
  1015.     query_client_cvar(jucators[i[0]],"cl_cmdrate","cmdrate_result_func",1,i)
  1016.     query_client_cvar(jucators[i[0]],"ex_interp","interp_result_func",1,i)
  1017.  
  1018.         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  
  1019.        
  1020.     }
  1021.  
  1022. }
  1023.  
  1024. public getinforates(i)
  1025. {
  1026.     get_user_name(jucators[i], name[i], 31)
  1027.     get_user_authid(jucators[i], steamid[i], 34);
  1028.     get_user_info(jucators[i], "rate", rate[i], 31)
  1029.     get_user_info(jucators[i], "cl_updaterate", updaterate[i], 31)
  1030. }
  1031.  
  1032. public printrates(id)
  1033. {      
  1034.     //Print an info line to the users console
  1035.     client_print(id, print_console, "Id Name SteamId Rate Updaterate Cmdrate Ex_Interp")    
  1036.  
  1037.     //Loop for all jucators and print rates info
  1038.     for (new i = 0; i < num; ++i) {
  1039.     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])
  1040.    
  1041.     }
  1042.  
  1043. }
  1044.  
  1045. public cmd_spec(id, level, cid){
  1046. if(!cmd_access(id, level, cid, 0))
  1047. return PLUGIN_CONTINUE;
  1048. new jucators[32], pnum, tempid;
  1049. get_jucators(jucators, pnum, "h");
  1050.        
  1051. for (new i; i < pnum; i++) {
  1052. tempid = jucators[i];
  1053. if (is_user_alive(tempid))
  1054. user_kill(tempid, 1);
  1055. if (cs_get_user_team(tempid) != CS_TEAM_SPECTATOR)
  1056. cs_set_user_team(tempid, CS_TEAM_SPECTATOR);
  1057. }
  1058. return PLUGIN_CONTINUE
  1059. }
  1060. public ClCmdSay( id )
  1061. {
  1062.  
  1063. static szArgs[ 192 ];
  1064. read_args( szArgs, sizeof ( szArgs ) -1 );
  1065.  
  1066. if( !szArgs[ 0 ] )   return PLUGIN_CONTINUE;
  1067.  
  1068. if( !g_bUsersCanChat )
  1069. {
  1070. ColorChat( id, RED, "^x04*^x01 Chat-ul este^x03 blocat^x01." );
  1071. ColorChat( id, RED, "^x04*^x01 Adminii il pot debloca folosind comanda^x03 /on^x01." );
  1072. }
  1073.  
  1074. return g_bUsersCanChat ? PLUGIN_CONTINUE : PLUGIN_HANDLED;
  1075.  
  1076. }
  1077.  
  1078. public ClCmdSayBlocare( id )
  1079. {
  1080. if( !UserHasAcces( id ) )
  1081. {
  1082. ColorChat( id, RED, "^x04*^x03 NU ai acces la aceasta comanda !" );
  1083. return PLUGIN_HANDLED;
  1084. }
  1085.  
  1086. if( !g_bUsersCanChat )
  1087. {
  1088. ColorChat( id, RED, "^x04*^x01 Chat-ul este deja^x03 blocat^x01 ." );
  1089. return PLUGIN_HANDLED;
  1090. }
  1091.  
  1092. new szName[ 32 ];
  1093. get_user_name( id, szName, sizeof ( szName ) -1 );
  1094.  
  1095. ColorChat( 0, RED, "^x04*^x01 Chat-ul a fost ^x03 blocat^x01 de catre adminul^x03 %s^x01 .", szName );
  1096.  
  1097. g_bUsersCanChat = false;
  1098.  
  1099. return PLUGIN_CONTINUE;
  1100. }
  1101.  
  1102.  
  1103. public ClCmdSayDeBlocare( id )
  1104. {
  1105. if( !UserHasAcces( id ) )
  1106. {
  1107. ColorChat( id, RED, "^x04*^x03 NU ai acces la aceasta comanda !" );
  1108. return PLUGIN_HANDLED;
  1109. }
  1110.  
  1111. if( g_bUsersCanChat )
  1112. {
  1113. ColorChat( id, RED, "^x04*^x01 Chat-ul este deja^x03 deblocat^x01 ." );
  1114. return PLUGIN_HANDLED;
  1115. }
  1116.  
  1117. new szName[ 32 ];
  1118. get_user_name( id, szName, sizeof ( szName ) -1 );
  1119.  
  1120. ColorChat( 0, RED, "^x04*^x01 Chat-ul a fost ^x03 deblocat^x01 de catre adminul^x03 %s^x01 .", szName );
  1121.  
  1122. g_bUsersCanChat = true;
  1123.  
  1124. return PLUGIN_CONTINUE;
  1125. }
  1126.  
  1127. public ClCmdSayInterp( id )
  1128. {
  1129. if( !UserHasAcces( id ) )
  1130. {
  1131. ColorChat( id, RED, "^x04*^x03 NU ai acces la aceasta comanda !" );
  1132. return PLUGIN_HANDLED;
  1133. }
  1134.  
  1135. static iSize = sizeof ( g_szInterpCommands );
  1136.  
  1137. for( new i = 0; i < iSize; i++ )
  1138. client_cmd( 0, g_szInterpCommands[ i ] );
  1139.  
  1140. client_print( 0, print_center, "Ati executat setarile de interp " );
  1141.  
  1142. new szName[ 32 ];
  1143. get_user_name( id, szName, sizeof ( szName ) -1 );
  1144.  
  1145. ColorChat( 0, RED, "^x04*^x01 admin ^x03%s^x01 ~ a setat interp corect jucatorilor.", szName );
  1146.  
  1147. return PLUGIN_CONTINUE;
  1148. }
  1149.  
  1150. stock bool:UserHasAcces( id )
  1151. {
  1152. if( get_user_flags( id ) & ADMIN_KICK )
  1153.     return true;
  1154.    
  1155. return false;
  1156.    
  1157. }
  1158.  
  1159. public hook_say(index)
  1160. {
  1161.    static arg[192], command2[192];
  1162.    read_args(arg, charsmax (arg));
  1163.    
  1164.    if (!arg[0])
  1165.       return PLUGIN_CONTINUE;
  1166.  
  1167.    remove_quotes(arg[0]);
  1168.    
  1169.    for (new x; x < sizeof command; x++)
  1170.    {
  1171.     if(equal(arg, command[x], strlen(command[x])))
  1172.     {
  1173.      if(get_user_flags(index) & Caccess[x])
  1174.      {
  1175.        replace(arg, charsmax(arg), bars, "");
  1176.        formatex(command2, charsmax(command2), "amx_%s", arg);
  1177.        client_cmd(index, command2);
  1178.      }        
  1179.      break;
  1180.     }
  1181.    }    
  1182.    return PLUGIN_CONTINUE;
  1183. }
  1184. public Transfer1(id, level, cid)
  1185. {
  1186.    if (!cmd_access(id, level, cid, 2))
  1187.     return PLUGIN_HANDLED;
  1188.  
  1189.    new unu[32]
  1190.  
  1191.    read_argv(1, unu, 31);
  1192.  
  1193.    new jucator = cmd_target(id, unu, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF);
  1194.  
  1195.    if (!jucator)
  1196.     return PLUGIN_HANDLED;
  1197.  
  1198.    static name[32], Admin[32];
  1199.  
  1200.    get_user_name(jucator, name, 31);
  1201.    get_user_name(id, Admin, 31);    
  1202.  
  1203.    new NumeEchipa[32];
  1204.    NumeEchipa = cs_get_user_team(jucator) == CS_TEAM_T
  1205.  
  1206.    cs_set_user_team(jucator, CS_TEAM_T);
  1207.    NumeEchipa = "Terrorists";
  1208.    user_silentkill(jucator);
  1209.  
  1210.    ColorChat(id, GREEN, "^x04*^x01 Jucatorul [^x04 %s ^x03] a fost transferat de Adminul [^x04 %s ^x03] la TERO.",  name, Admin);
  1211.  
  1212.    return PLUGIN_HANDLED;
  1213. }
  1214.  
  1215. public Transfer2(id, level, cid)
  1216. {
  1217.    if (!cmd_access(id, level, cid, 2))
  1218.     return PLUGIN_HANDLED;
  1219.  
  1220.    new unu[32]
  1221.  
  1222.    read_argv(1, unu, 31);
  1223.  
  1224.    new jucator = cmd_target(id, unu, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF);
  1225.  
  1226.    if (!jucator)
  1227.     return PLUGIN_HANDLED;
  1228.  
  1229.    static name[32], Admin[32];
  1230.  
  1231.    get_user_name(jucator, name, 31);
  1232.    get_user_name(id, Admin, 31);    
  1233.  
  1234.    new NumeEchipa[32];
  1235.  
  1236.    NumeEchipa = cs_get_user_team(jucator) == CS_TEAM_CT
  1237.  
  1238.    cs_set_user_team(jucator, CS_TEAM_CT);
  1239.    NumeEchipa = "Counter-Terrorists";
  1240.    user_silentkill(jucator);
  1241.  
  1242.    ColorChat(id, GREEN, "^x04*^x01 Jucatorul [^x04 %s ^x03] a fost transferat de Adminul [^x04 %s ^x03] la COUNTER.", name, Admin);
  1243.  
  1244.    return PLUGIN_HANDLED;
  1245. }
  1246.  
  1247. public Transfer3(id, level, cid)
  1248. {
  1249.    if (!cmd_access(id, level, cid, 2))
  1250.     return PLUGIN_HANDLED;
  1251.  
  1252.    new unu[32]
  1253.  
  1254.    read_argv(1, unu, 31);
  1255.  
  1256.    new jucator = cmd_target(id, unu, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF);
  1257.  
  1258.    if (!jucator)
  1259.     return PLUGIN_HANDLED;
  1260.  
  1261.    static name[32], Admin[32];
  1262.  
  1263.    get_user_name(jucator, name, 31);
  1264.    get_user_name(id, Admin, 31);    
  1265.  
  1266.    new NumeEchipa[32];
  1267.    NumeEchipa = cs_get_user_team(jucator) == CS_TEAM_SPECTATOR
  1268.  
  1269.    cs_set_user_team(jucator, CS_TEAM_SPECTATOR);
  1270.    NumeEchipa = "Spectator";
  1271.    user_silentkill(jucator);
  1272.  
  1273.    ColorChat(id, GREEN, "^x04*^x01 Jucatorul [^x04 %s ^x03] a fost transferat de Adminul [^x04 %s ^x03] la SPECTATOR.", name, Admin);
  1274.  
  1275.    return PLUGIN_HANDLED;
  1276. }
  1277.  
  1278. public chMap(map[])
  1279. {
  1280.     server_cmd("changelevel %s", map)
  1281. }
  1282.  
  1283. public cmdMap(id, level, cid)
  1284. {
  1285.     if (!cmd_access(id, level, cid, 2))
  1286.         return PLUGIN_HANDLED
  1287.  
  1288.     new arg[32]
  1289.     new arglen = read_argv(1, arg, 31)
  1290.    
  1291.     if (!is_map_valid(arg))
  1292.     {
  1293.         console_print(id, "[AMXX] %L", id, "MAP_NOT_FOUND")
  1294.         return PLUGIN_HANDLED
  1295.     }
  1296.  
  1297.     new authid[32], name[32]
  1298.    
  1299.     get_user_authid(id, authid, 31)
  1300.     get_user_name(id, name, 31)
  1301.    
  1302.     show_activity_key("ADMIN_MAP_1", "ADMIN_MAP_2", name, arg);
  1303.    
  1304.     log_amx("Cmd: ^"%s<%d><%s><>^" changelevel ^"%s^"", name, get_user_userid(id), authid, arg)
  1305.    
  1306.     new _modName[10]
  1307.     get_modname(_modName, 9)
  1308.    
  1309.     if (!equal(_modName, "zp"))
  1310.     {
  1311.         message_begin(MSG_ALL, SVC_INTERMISSION)
  1312.         message_end()
  1313.     }
  1314.    
  1315.     set_task(2.0, "chMap", 0, arg, arglen + 1)
  1316.    
  1317.     return PLUGIN_HANDLED
  1318. }
  1319.  
  1320. stock bool:onlyRcon(const name[])
  1321. {
  1322.     new pentru=get_cvar_pointer(name);
  1323.     if (pentru && get_pcvar_flags(pentru) & FCVAR_PROTECTED)
  1324.     {
  1325.         return true;
  1326.     }
  1327.     return false;
  1328. }
  1329.  
  1330. public client_putinserver( id )
  1331.     g_On[ id] = 0;
  1332.    
  1333.    
  1334. public cmddemo( id)
  1335. {
  1336.     new szSaid[ 192 ], szArgs[ 2 ][ 32 ], szDemoname[ 32 ], iDate[ 32 ], szMapname[ 32 ];
  1337.     read_args( szSaid, 191 );
  1338.     remove_quotes( szSaid );
  1339.    
  1340.     get_time( "%d-%m-%Y-%H-%M-%S", iDate, charsmax( iDate ) );
  1341.     get_mapname( szMapname, charsmax( szMapname ) );
  1342.    
  1343.     formatex( szDemoname, charsmax( szDemoname ), "%s-%s", szMapname, iDate );
  1344.    
  1345.     parse( szSaid, szArgs[ 0 ], 31, szArgs[ 1 ], 31 );
  1346.    
  1347.     if( equali( szArgs[ 0 ], "/demo" ) )
  1348.     {
  1349.         if( !( get_user_flags( id ) & ADMIN_ACCES ) )
  1350.             return PLUGIN_HANDLED;
  1351.        
  1352.         new iPlayer = cmd_target( id, szArgs[ 1 ], 10 );
  1353.        
  1354.         if( !iPlayer )
  1355.         {
  1356.             client_print(id,print_console, "Jucatorul nu e conectat." );
  1357.             return PLUGIN_HANDLED;
  1358.         }
  1359.        
  1360.         if( !is_user_alive( iPlayer ) )
  1361.         {
  1362.             client_print(id,print_console, "Jucatorul nu e in viata." );
  1363.             return PLUGIN_HANDLED;
  1364.         }
  1365.        
  1366.        
  1367.         client_cmd( iPlayer, "record ^"%s^"", szDemoname );
  1368.         client_print(id,print_console, "* admin %s a primit record", szSaid );
  1369.        
  1370.         g_On[ id] = 1;
  1371.         return PLUGIN_HANDLED;
  1372.         }
  1373.    
  1374.     if( equali( szArgs[ 0 ], ".stop" ) )
  1375.     {
  1376.         if( !( get_user_flags( id ) & ADMIN_ACCES ) )
  1377.             return PLUGIN_HANDLED;
  1378.        
  1379.         new iPlayer = cmd_target( id, szArgs[ 1 ], 10 );
  1380.        
  1381.         if( !iPlayer )
  1382.         {
  1383.             client_print(id,print_console,  "Jucatorul nu e conectat." );
  1384.             return PLUGIN_HANDLED;
  1385.         }
  1386.        
  1387.         if( !is_user_alive( iPlayer ) )
  1388.         {
  1389.             client_print(id,print_console, "Jucatorul nu e in viata." );
  1390.             return PLUGIN_HANDLED;
  1391.         }
  1392.        
  1393.         if( g_On[ iPlayer ] )
  1394.         {
  1395.             client_cmd( iPlayer, "stop" );
  1396.             client_print(id,print_console, "Demo oprit." );
  1397.             g_On[ iPlayer ] = 0;
  1398.         }
  1399.        
  1400.         return PLUGIN_HANDLED;
  1401.     }
  1402.    
  1403.     return PLUGIN_CONTINUE;
  1404. }
  1405. public comenzi(id)
  1406. {
  1407.     console_print( id, "----------------------------------------" );
  1408.     console_print( id, "---- Comenzi administrative disponibile pe server ----" );
  1409.     console_print( id, "---------------------------------------" );
  1410.     console_print( id, "/comenzi - Lista comenzi war" )
  1411.     console_print( id, "/start - Porneste meciul" );
  1412.     console_print( id, "/stop - Opreste meciul" );
  1413.     console_print( id, "/knife - Porneste runda de lame" );
  1414.     console_print( id, "/spec - Muta toti jucatorii spec" );
  1415.     console_print( id, "/off - Opreste chat-ul" );
  1416.     console_print( id, "/on - Porneste chat-ul" );
  1417.     console_print( id, "/setari - Arata in consola setarile jucatorilor " );
  1418.     console_print( id, "/interp - Seteaza interp 0.01 jucatorilor" );
  1419.     console_print( id, "/pass parola - Pune si anunta in chat parola" );
  1420.     console_print( id, "/nopass - Scoate parola" );
  1421.     console_print( id, "/warm - Porneste warm-up" );
  1422.     console_print( id, "/rr - Restart" );
  1423.     console_print( id, "/money - Arata situatia financiara" );
  1424.     console_print( id, "/pause- Pune si scoate pauza" );
  1425.     console_print( id, "/score - Arata scorul din meci" );
  1426.     console_print( id, "/demo nume - Porneste demo jucatorului respectiv comanda se va executa cu chat oprit in say_team" );
  1427.     console_print( id, "/swap - Schimba echipele intre ele" );
  1428.     console_print( id, "/extra - Porneste rundele de departajare in caz de egal" );
  1429.     console_print( id, "/spec nume - Transferi jucatorul la spectatori" );
  1430.     console_print( id, "/ct nume - Transferi jucatorul la CT" );
  1431.     console_print( id, "/t nume - Transferi jucatorul la T" );
  1432.     console_print( id, "/map mapa- Schimba mapa din chat " );
  1433.     console_print( id, "----------------------------------------" );
  1434.     console_print( id, " ----Comenzi amx: ----" );
  1435.     console_print( id, "---------------------------------------" );
  1436.     console_print( id, "Pluginul face screenshot automat la 540.0 pov_ss!Pozele se pot gasii in folderul cstrike al fiecarui jucator" );
  1437.     console_print( id, "Setari suplimentare gasiti in folderul configs fisier cspro.cfg, se seteaza exclusiv in cspro.cfg" );
  1438.     console_print( id, "Acest plugin este un update la h4u v2.1" );
  1439.     console_print( id, "----------------------------------------" );
  1440.     client_cmd( id, "toggleconsole" );
  1441.  
  1442.     return PLUGIN_HANDLED;
  1443. }
  1444. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  1445. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang10250\\ f0\\ fs16 \n\\ par }
  1446. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement