AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   I need some help with the plugin (https://forums.alliedmods.net/showthread.php?t=328455)

sebiq 11-10-2020 09:43

I need some help with the plugin
 
hello guys, i ve been searched a plugin for a war/mix server and i found but i have some problems with that, some errors, can somebody rezolve that?

Code:

#include <amxmodx>
#include <cstrike>
#include <ColorChat>
#include <fun>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>

#pragma semicolon        1

#define MAX_ROUNDS        15
#define TASK                1337
#define ACCESS ADMIN_KICK
#define TIME 30.0
#define ADVERTISING_TIME 80.0


static const

        PLUGIN[ ] =                "RGLeague Mix",
        VERSION[ ] =                "0.0.1",
        AUTHOR[ ] =                "regiZoru",
        TAG[ ] =                "[RGLeague]";

new const g_szInterpCommands[ ][ ] =
{
        "cl_filterstuffcmd 0",
        "ex_interp 0.01"
       
};

stock const messages [ ] [ ] =
{
        "^x04[RGLeague]^x01 Forum:^x04 www.RGLeague.Ro",
        "^x04[RGLeague]^x01 Adresa TeamSpeak:^x04 TS.RGLeague.RO",
        "^x04[RGLeague]^x01 Plugin creat de^x04 www.RGLeague.Ro"

};
       
//new g_On[ 33 ] = 0;

       
new bool: g_bMixStarted;
new bool: g_bEndRound;
new bool: g_bSecondPart;

new g_iTeroScore, g_iCTScore;
new g_iTeroSScore, g_iCTSScore;

new cvar_msg;
new SyncHud;
new KNIFE = 0;
new paused = 0;
new amx_gamename;


new Float:player_origin[33][3];
new bool:g_bUsersCanChat = true;
new bool:hasdemo[33];

public plugin_init( )
{
        register_plugin(PLUGIN, VERSION, AUTHOR);
       
        register_clcmd("say .start", "cmdStart", ADMIN_KICK);
        register_clcmd("say .stop", "cmdStop", ADMIN_KICK);
        register_clcmd("say .warm", "cmdWarm", ADMIN_KICK);
        register_clcmd("say .extra", "cmdExtra", ADMIN_KICK);
        register_clcmd("say .lame", "cmdKnife", ADMIN_KICK);
        register_clcmd("say .specall", "moveSpec", ADMIN_KICK);
        register_clcmd("say .rr", "cmdRestart", ADMIN_KICK);
        register_clcmd( "say .off", "cmdBlocare", ADMIN_KICK);
        register_clcmd( "say .on", "cmdDeblocare", ADMIN_KICK);
        register_clcmd( "say .interp", "cmdSetari", ADMIN_KICK);
        register_clcmd( "say .comenzi", "cmdComenzi", ADMIN_KICK);
        register_concmd("amx_t", "admin_chteam", ADMIN_KICK, "<authid, nick or #userid>");
        register_concmd("amx_ct", "admin_chteam", ADMIN_KICK, "<authid, nick or #userid>");
        register_concmd("amx_spec", "admin_chteam", ADMIN_KICK, "<authid, nick or #userid>");
        register_clcmd("say .pause", "cmdPause", ADMIN_KICK);
        register_clcmd("say .unpause", "cmdUnPause", ADMIN_KICK);
        register_clcmd("say_team .start", "cmdStart", ADMIN_KICK);
        register_clcmd("say_team .stop", "cmdStop", ADMIN_KICK);
        register_clcmd("say_team .warm", "cmdWarm", ADMIN_KICK);
        register_clcmd("say_team .extra", "cmdExtra", ADMIN_KICK);
        register_clcmd("say_team .lame", "cmdKnife", ADMIN_KICK);
        register_clcmd("say_team .specall", "moveSpec", ADMIN_KICK);
        register_clcmd("say_team .rr", "cmdRestart", ADMIN_KICK);
        register_clcmd( "say_team .off", "cmdBlocare", ADMIN_KICK);
        register_clcmd( "say_team .on", "cmdDeblocare", ADMIN_KICK);
        register_clcmd( "say_team .interp", "cmdSetari", ADMIN_KICK);
        register_clcmd( "say_team .comenzi", "cmdComenzi", ADMIN_KICK);
        register_clcmd("say_team .pause", "cmdPause", ADMIN_KICK);
        register_clcmd("say_team .unpause", "cmdUnPause", ADMIN_KICK);

       
        register_clcmd( "say", "ClCmdSay" );
        register_clcmd( "say", "hookSay" );
        register_clcmd( "say_team", "hookSay" );
       
        RegisterHam(Ham_Spawn, "player", "e_Spawn", 1);
        amx_gamename = register_cvar( "amx_gamename", "www.RGLeague.Ro" );
        register_forward( FM_GetGameDescription, "GameDesc" );
        register_event("SendAudio", "EventTeroWin", "a", "2&%!MRAD_terwin");
        register_event("SendAudio", "EventCTWin", "a", "2&%!MRAD_ctwin");
        register_event("CurWeapon","switchweapon","be","1=1","2!29");
        register_logevent("LogEventRoundEnd", 2, "1=Round_End");
        register_logevent("LogEventRound", 2, "1=Round_End");
        register_logevent("LogEventRoundStart", 2, "1=Round_Start");
        set_task ( ADVERTISING_TIME, "show_messages", _, _, _,"b" );
        cvar_msg = register_cvar("score_msg", "3");
        SyncHud = CreateHudSyncObj( );
}

//=================================================MIX COMMANDS===============================================//

public switchweapon(id)
{
        if (KNIFE == 1)
        {
                engclient_cmd(id, "weapon_knife");
        }
}

public cmdRestart(id)
{
        if( !UserHasAcces( id ) )
        {
                ColorChat( id, GREEN, "%s^x01 Nu ai acces la aceasta comanda.", TAG );
                return PLUGIN_HANDLED;
        }
        if( !g_bMixStarted )
        {
                ColorChat(id, GREEN, "%s^x01 Nu poti da restart inainte sa inceapa meciul.", TAG);

                return PLUGIN_HANDLED;
        }
       
        if( g_bSecondPart )
        {
                g_iTeroScore = g_iTeroSScore;
                g_iCTScore = g_iCTSScore;
                KNIFE = 0;
                g_bMixStarted = true;
                new szName[ 32 ];
                get_user_name( id, szName, sizeof ( szName ) -1 );
               
                ColorChat(0, GREEN, "%s^x01 %s a repornit partea a II-a a meciului. Good luck!", TAG, szName);
        }
       
        else if( !g_bSecondPart )
        {
                g_iTeroScore = 0;
                g_iCTScore = 0;
                g_iTeroSScore = 0;
                g_iCTSScore = 0;
                KNIFE = 0;
                g_bMixStarted = true;
                g_bSecondPart = false;
                new szName[ 32 ];
                get_user_name( id, szName, sizeof ( szName ) -1 );
                server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 800" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

                ColorChat(0, GREEN, "%s^x01 %s a repornit prima parte a meciului. Good luck!", TAG, szName);
        }
       
        server_cmd("sv_restart 1");
       
        return PLUGIN_HANDLED;
}

public cmdKnife(id)
{
        if( !UserHasAcces( id ) )
        {
                ColorChat( id, GREEN, "%s^x01 Nu ai acces la aceasta comanda.", TAG );
                return PLUGIN_HANDLED;
        }
        if( g_bMixStarted )
        {
                ColorChat(id, GREEN, "%s^x01 Nu poti porni runda de lame in timpul meciului.", TAG);
               
                return PLUGIN_HANDLED;
        }
        KNIFE = 1;
        new szName[ 32 ];
        get_user_name( id, szName, sizeof ( szName ) -1 );
        server_cmd("sv_restart 1");
        server_cmd("exec live.cfg");
        server_cmd("mp_freezetime 0");
        ColorChat(0, GREEN, "%s^x01 %s a pornit runda de lame.", TAG, szName);
        strip_user_weapons(0);
       
        return PLUGIN_HANDLED;
}

public cmdStart(id)
{
        if( !UserHasAcces( id ) )
        {
                ColorChat( id, GREEN, "%s^x01 Nu ai acces la aceasta comanda.", TAG );
                return PLUGIN_HANDLED;
        }
        if( !g_bSecondPart )
        {
                if( g_bMixStarted )
                {
                        ColorChat(id, GREEN, "%s^x01 Meciul este deja pornit.", TAG);
                       
                        return PLUGIN_HANDLED;
                }
               
                g_iTeroScore = 0;
                g_iCTScore = 0;
                g_iTeroSScore = 0;
                g_iCTSScore = 0;
                KNIFE = 0;
                g_bMixStarted = true;
                g_bSecondPart = false;
                new szName[ 32 ];
                get_user_name( id, szName, sizeof ( szName ) -1 );
                taskMSG(TASK);
               
                server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 800" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

               
                ColorChat(0, GREEN, "%s^x01 %s a pornit prima parte a meciului. Good luck!", TAG, szName);
                ColorChat(0, GREEN, "LIVE LIVE LIVE !!! Good luck!");
                ColorChat(0, GREEN, "LIVE LIVE LIVE !!! Good luck!");
                ColorChat(0, GREEN, "LIVE LIVE LIVE !!! Good luck!");
        }
       
        else if( g_bSecondPart )
        {
                KNIFE = 0;
                g_bMixStarted = true;
                new szName[ 32 ];
                get_user_name( id, szName, sizeof ( szName ) -1 );
                server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 800" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

               
                ColorChat(0, GREEN, "%s^x01 %s a pornit a II-a parte a meciului. Good luck!", TAG, szName);
                ColorChat(0, GREEN, "LIVE LIVE LIVE !!! Good luck!");
                ColorChat(0, GREEN, "LIVE LIVE LIVE !!! Good luck!");
                ColorChat(0, GREEN, "LIVE LIVE LIVE !!! Good luck!");
        }
       
        return PLUGIN_HANDLED;
}

public cmdWarm(id)
{
        if( !UserHasAcces( id ) )
        {
                ColorChat( id, GREEN, "%s^x01 Nu ai acces la aceasta comanda.", TAG );
                return PLUGIN_HANDLED;
        }
        if( g_bMixStarted )
        {
                ColorChat(id, GREEN, "%s^x01 Nu poti da warm in timpul meciului.", TAG);
               
                return PLUGIN_HANDLED;
        }
       
        g_iTeroScore = 0;
        g_iCTScore = 0;
        KNIFE = 0;
        g_bMixStarted = false;
        g_bSecondPart = false;
        new szName[ 32 ];
        get_user_name( id, szName, sizeof ( szName ) -1 );
        if( task_exists(TASK) )
        {
                remove_task(TASK);
        }
       
        ColorChat(0, GREEN, "%s^x01 %s a pornit rundele de incalzire.", TAG, szName);
        server_cmd("sv_restart 1");
        server_cmd( "mp_freezetime 0" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 16000" );
        server_cmd( "mp_roundtime 8.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");

       
        return PLUGIN_HANDLED;
}

public cmdStop(id)
{
        if( !UserHasAcces( id ) )
        {
                ColorChat( id, GREEN, "%s^x01 Nu ai acces la aceasta comanda.", TAG );
                return PLUGIN_HANDLED;
        }
        if( !g_bMixStarted )
        {
                ColorChat(id, GREEN, "%s^x01 Meciul este deja oprit.", TAG);
               
                return PLUGIN_HANDLED;
        }
       
        g_iTeroScore = 0;
        g_iCTScore = 0;
        g_iTeroSScore = 0;
        g_iCTSScore = 0;
       
        g_bMixStarted = false;
        g_bSecondPart = false;
        new szName[ 32 ];
        get_user_name( id, szName, sizeof ( szName ) -1 );
        if( task_exists(TASK) )
        {
                remove_task(TASK);
        }
       
        ColorChat(0, GREEN, "%s^x01 %s a anulat meciul.", TAG, szName);
        server_cmd("sv_restart 1");
        server_cmd( "mp_freezetime 0" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 16000" );
        server_cmd( "mp_roundtime 8.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");

        return PLUGIN_HANDLED;
}

public EventTeroWin( )
{
        if( g_bMixStarted && !g_bEndRound )
        {
                g_bEndRound = true;
   
                g_iTeroScore++;
       
        }
}

public EventCTWin( )
{
        if( g_bMixStarted && !g_bEndRound )
        {
                g_bEndRound = true;
               
                g_iCTScore++;
 
        }
}

public LogEventRoundStart( )
{
        g_bEndRound = false;
       
}

public LogEventRoundEnd( )
{
        if( g_bMixStarted )
        {
                if( g_iTeroScore + g_iCTScore == MAX_ROUNDS )
                {
                        new iPlayers[32], iNum, player;
                       
                        get_players(iPlayers, iNum, "h");
                       
                        for( new i = 0; i < iNum; i++ )
                        {
                                player = iPlayers;
                               
                                if( cs_get_user_team(player) == CS_TEAM_T )
                                {
                                        cs_set_user_team(player, CS_TEAM_CT);
                                }
                               
                                else if( cs_get_user_team(player) == CS_TEAM_CT )
                                {
                                        cs_set_user_team(player, CS_TEAM_T);
                                }
                        }
                server_cmd( "sv_restart 1");
        server_cmd( "mp_freezetime 10" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 800" );
        server_cmd( "mp_roundtime 1.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");
                       
                        new iAux = g_iTeroScore;
                        g_iTeroScore = g_iCTScore;
                        g_iCTScore = iAux;
                       
                        g_iTeroSScore = g_iTeroScore;
                        g_iCTSScore = g_iCTScore;
                       
                        g_bSecondPart = true;
                        g_bMixStarted = false;
                       
                        server_cmd("sv_restart 1");
                }
               
                if( g_iTeroScore >= MAX_ROUNDS + 1 )
               
                {
               
                        ColorChat(0, GREEN, "%s^x03 Echipa Tero^x01 a castigat meciul cu^x04 %d^x01 la^x04 %d^x01.", TAG, g_iTeroScore, g_iCTScore);
                server_cmd( "sv_restart 1");
        server_cmd( "mp_freezetime 0" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 16000" );
        server_cmd( "mp_roundtime 8.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");
        if( task_exists(TASK) )
        {
                remove_task(TASK);
        }
                        cmdStop(TASK);
                       
                        return PLUGIN_HANDLED;
                }
               
                else if( g_iCTScore >= MAX_ROUNDS + 1 )
                {
                        ColorChat(0, GREEN, "%s^x03 Echipa CT^x01 a castigat meciul cu^x04 %d^x01 la^x04 %d^x01.", TAG, g_iCTScore, g_iTeroScore);
                server_cmd( "sv_restart 1");
        server_cmd( "mp_freezetime 0" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 16000" );
        server_cmd( "mp_roundtime 8.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");       
        if( task_exists(TASK) )
        {
                remove_task(TASK);
        }
                        cmdStop(TASK);
                       
                        return PLUGIN_HANDLED;
                }
                       
                else if( g_iTeroScore == MAX_ROUNDS && g_iCTScore == MAX_ROUNDS )
                {
                        ColorChat(0, GREEN, "%s^x01 Meciul s-a terminat egal.", TAG);
                        ColorChat(0, GREEN, "%s^x01 Pentru prelungiri,dati comanda /extra", TAG);
                       
                        cmdStop(TASK);
                       
                        return PLUGIN_HANDLED;
                }
               
                if( get_pcvar_num(cvar_msg) != 2 )
                {
                        ColorChat(0, GREEN, "%s^x01 Terrorists^x04 %d^x01 -^x04 %d^x01 Counter-Terrorists", TAG, g_iTeroScore, g_iCTScore);
                }
        }
       
        return PLUGIN_HANDLED;
}

public taskMSG(T_A_S_K)
{
        if( get_pcvar_num(cvar_msg) > 1 )
        {
                set_hudmessage(80, 80, 80, -1.0, 0.03, 0, 0.0, 1.1, 0.0, 0.0, -1);
                ShowSyncHudMsg(0, SyncHud, "Echipa TERO %d - %d Echipa CT", g_iTeroScore, g_iCTScore);
        }
       
        set_task(1.0, "taskMSG", TASK);
}

public moveSpec(id, level, cid)
{
                if (!cmd_access(id, level, cid, 2))
                {
                        return PLUGIN_HANDLED;
                }
                if( g_bMixStarted )
                {
                ColorChat(id, GREEN, "%s^x01 Nu poti pune jucatorii Spectator in timpul meciului.", TAG);
               
                return PLUGIN_HANDLED;
                }
                new players[32], total, i;
                get_players(players,total,"h");
                for (i=0; i<total;i++)
                {
                        user_kill(players, 0);
                        cs_set_user_team(players, CS_TEAM_SPECTATOR);
                }
                ColorChat(0, GREEN, "%s^x01 Jucatorii au fost pusi ^x04Spectator ^x01pentru alegeri.", TAG);
                return PLUGIN_HANDLED;
}

//===============================================================================================//
//==================================AFK REPORT=======================================================================//
public e_Spawn(id)
{
    remove_task(id);
    if(is_user_alive(id))
    {
        set_task(0.8, "get_spawn", id);
    }
    return HAM_IGNORED;
}

public get_spawn(id)
{
    pev(id, pev_origin, player_origin[id]);
    set_task(TIME, "check_afk", id);
}

public check_afk(id)
{
    if(is_user_alive(id))
    {
        if(same_origin(id))
        {
            new name[33];
            get_user_name(id, name, 32);
            ColorChat(0, GREEN, "%s^x01 Player-ul^x04 %s^x01 a fost raportat ca AFK!", TAG, name);
        }
    }
}

public same_origin(id)
{
    new Float:origin[3];
    pev(id, pev_origin, origin);
    for(new i = 0; i < 3; i++)
        if(origin != player_origin[id])
            return 0;
    return 1;
}
//=====================================================================================================================
public LogEventRound( )
{
        new iPlayers[32], iNum, player;
       
        get_players(iPlayers, iNum, "ch");
       
        for( new i = 0; i < iNum; i++ )
        {
                player = iPlayers;
        }
}
//===============================================BLOCK CHAT=============================================================
public ClCmdSay( id )
{
       
        static szArgs[ 192 ];
        read_args( szArgs, sizeof ( szArgs ) -1 );
       
        if( !szArgs[ 0 ] )        return PLUGIN_CONTINUE;
       
        if( !g_bUsersCanChat )
        {
                ColorChat( id, GREEN, "%s^x01 Chat-ul este^x04 blocat^x01, folositi functia say_team!", TAG );
        }
               
        return g_bUsersCanChat ? PLUGIN_CONTINUE : PLUGIN_HANDLED;
       
}

public cmdBlocare( id )
{
        if( !UserHasAcces( id ) )
        {
                ColorChat( id, GREEN, "%s^x01 Nu ai acces la aceasta comanda.", TAG );
                return PLUGIN_HANDLED;
        }
       
        if( !g_bUsersCanChat )
        {
                ColorChat( id, GREEN, "%s^x01 Chat-ul este deja^x04 blocat^x01.", TAG );
                return PLUGIN_HANDLED;
        }
       
        new szName[ 32 ];
        get_user_name( id, szName, sizeof ( szName ) -1 );
       
        ColorChat( 0, GREEN, "%s^x01 Chat-ul a fost^x04 blocat^x01 de catre adminul^x04 %s^x01.", TAG, szName );
       
        g_bUsersCanChat = false;
       
        return PLUGIN_CONTINUE;
}


public cmdDeblocare( id )
{
        if( !UserHasAcces( id ) )
        {
                ColorChat( id, GREEN, "%s^x01 Nu ai acces la aceasta comanda.", TAG );
                return PLUGIN_HANDLED;
        }
       
        if( g_bUsersCanChat )
        {
                ColorChat( id, GREEN, "%s^x01 Chat-ul este deja^x04 deblocat^x01.", TAG );
                return PLUGIN_HANDLED;
        }
       
        new szName[ 32 ];
        get_user_name( id, szName, sizeof ( szName ) -1 );
       
        ColorChat( 0, GREEN, "%s^x01 Chat-ul a fost^x04 deblocat^x01 de catre adminul^x04 %s^x01.", TAG, szName );
       
        g_bUsersCanChat = true;
       
        return PLUGIN_CONTINUE;
}

stock bool:UserHasAcces( id )
{
        if( get_user_flags( id ) & ADMIN_KICK )
                return true;
               
        return false;
       
}

public cmdSetari( id )
{
        if( !UserHasAcces( id ) )
        {
                ColorChat( id, GREEN, "%s^x01 Nu ai acces la aceasta comanda.", TAG );
                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_console, "=================== Setari War-Mix ================" );
        client_print( 0, print_console, "[RGLeague.Ro] ex_interp setat pe valoarea 0.01" );
        client_print( 0, print_console, "====================================================" );
                       
        new szName[ 32 ];
        get_user_name( id, szName, sizeof ( szName ) -1 );
       
        ColorChat( 0, GREEN, "%s ^x04%s^x01 executa interp pe jucatori. Verificati consola.", TAG, szName );
       
        return PLUGIN_CONTINUE;
}

public cmdComenzi( id )
{
        if( !UserHasAcces( id ) )
        {
                ColorChat( id, GREEN, "%s^x01 Nu ai acces la aceasta comanda.", TAG );
                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_console, "=================== Comenzi War-Mix ================" );

        client_print( 0, print_console, "/comenzi - Lista comenzi war" );
        client_print( 0, print_console, "/start - Porneste meciul" );
        client_print( 0, print_console, "/stop - Opreste meciul" );
        client_print( 0, print_console, "/lame - Porneste runda de lame" );
        client_print( 0, print_console, "/off - Opreste chat-ul" );
        client_print( 0, print_console, "/on - Porneste chat-ul " );
        client_print( 0, print_console, "/interp - Seteaza interp 0.01 playerilor" );
        client_print( 0, print_console, "/warm - Porneste warm-up" );
        client_print( 0, print_console, "/rr - Restart" );
        client_print( 0, print_console, "/money - Arata situatia financiara" );
        client_print( 0, print_console, "/demo nick - Porneste demo jucatorului respectiv" );
        client_print( 0, print_console, "/extra - Porneste rundele de departajare in caz de egal" );
        client_print( 0, print_console, "/specall- Transferi toti playerii la SPEC" );
 
        client_print( 0, print_console, "----------------------------------------" );
        client_print( 0, print_console, "----Comenzi amx: ----" );
        client_print( 0, print_console, "---------------------------------------" );

        client_print( 0, print_console, "amx_ct nume - Transferi player-ul la CT" );
        client_print( 0, print_console, "amx_t nume - Transferi player-ul la T" );
        client_print( 0, print_console, "amx_spec nume - Transferi player-ul la spectatori" );
        client_print( 0, print_console, "====================================================" );
                       
        new szName[ 32 ];
        get_user_name( id, szName, sizeof ( szName ) -1 );
       
       
       
        return PLUGIN_CONTINUE;
}

//======================================= Prelungiri =================================================
public cmdExtra(id)
{
        if( !UserHasAcces( id ) )
        {
                ColorChat( id, GREEN, "%s^x01 Nu ai acces la aceasta comanda.", TAG );
                return PLUGIN_HANDLED;
        }
        if( !g_bSecondPart )
        {
                if( g_bMixStarted )
                {
                        ColorChat(id, GREEN, "%s^x01 Meciul este deja pornit.", TAG);
                       
                        return PLUGIN_HANDLED;
                }
               
                g_iTeroScore = 0;
                g_iCTScore = 0;
                g_iTeroSScore = 0;
                g_iCTSScore = 0;
                KNIFE = 0;
                g_bMixStarted = true;
                g_bSecondPart = false;
                new szName[ 32 ];
                get_user_name( id, szName, sizeof ( szName ) -1 );
                taskMSG(TASK);
               
                        server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 10000" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

               
                ColorChat(0, GREEN, "%s^x01 %s a pornit prima parte a prelungirilor. Good luck!", TAG, szName);
                ColorChat(0, GREEN, "LIVE LIVE LIVE !!! Good luck!");
                ColorChat(0, GREEN, "LIVE LIVE LIVE !!! Good luck!");
                ColorChat(0, GREEN, "LIVE LIVE LIVE !!! Good luck!");
        }
       
        else if( g_bSecondPart )
        {
                KNIFE = 0;
                g_bMixStarted = true;
                new szName[ 32 ];
                get_user_name( id, szName, sizeof ( szName ) -1 );
                server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 10000" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

               
                ColorChat(0, GREEN, "%s^x01 %s a pornit a II-a parte a prelungirilor. Good luck!", TAG, szName);
                ColorChat(0, GREEN, "LIVE LIVE LIVE !!! Good luck!");
                ColorChat(0, GREEN, "LIVE LIVE LIVE !!! Good luck!");
                ColorChat(0, GREEN, "LIVE LIVE LIVE !!! Good luck!");
        }
       
        return PLUGIN_HANDLED;
}
//==========================================DEMO=======================================================
     
new const g_Demoname[] = "DEMO_RGLeague_RO";


public client_connect(id)
{
        hasdemo[id] = false;

}

public hookSay( id )
{
        new szSaid[ 192 ];
        read_args( szSaid, sizeof( szSaid ) -1 );
        remove_quotes( szSaid );
       
        if( contain( szSaid, "/demo" ) != -1 )
        {
                if( get_user_flags( id ) & ADMIN_KICK )
                {
                        new target[ 32 ];
                        copy( target, sizeof( target ) -1, szSaid[ 6 ] );
                       
                        new id2 = cmd_target( id, target, 2 );
                       
                        if(hasdemo[id2])
                        {
                                static szName[ 32 ];
                                new mapname[32];
                                get_user_name( id2, szName, sizeof( szName ) -1 );
                                get_mapname(mapname,31);
                                ColorChat( id, GREEN, "%s ^x01 Jucatorul %s are deja demo!", TAG, szName );
                                return PLUGIN_HANDLED;
                        }
                       
                        if( id2 )
                        {
                                static szName[ 32 ];
                                new mapname[32];
                                get_user_name( id2, szName, sizeof( szName ) -1 );
                                get_mapname(mapname,31);
                                hasdemo[id2] = true;
                               
                                client_cmd( id2, "record ^"%s-%s^"", g_Demoname, mapname);
                               
                                ColorChat( id, GREEN, "%s^x01 Ai pornit demo pe jucatorul^x04 %s^x01!", TAG, szName );
                        }
                       
                        else
                        {
                                console_print( id, "Player-ul nu exista !!!" );
                        }
                       
                        return PLUGIN_HANDLED;
                }
        }
        return PLUGIN_CONTINUE;
}

//========================================TRANSFER===================================================
public admin_chteam(id, level, cid) {
  if (!cmd_access(id, level, cid, 2))
      return PLUGIN_HANDLED;
 
  new cmd[10];
  new arg[32];
  new name[32], name2[32];
 
  read_argv(0,cmd,9);
  read_argv(1,arg,31);
  new player = cmd_target(id,arg,2);
  if (!player) return PLUGIN_HANDLED;
 
  user_kill(player, 1);
  get_user_name(id, name, 31);
  get_user_name(player, name2, 31);
 
  if(cmd[4]=='t')
  {
      cs_set_user_team(player,1);
      ColorChat( 0, GREEN, "%s^x01 Adminul^x04 %s^x01 l-a mutat pe^x04 %s^x01 la^x04 TERO^x01.", TAG, name, name2 );
  }
  if(cmd[4]=='c')
  {
      cs_set_user_team(player,2);
      ColorChat( 0, GREEN, "%s^x01 Adminul^x04 %s^x01 l-a mutat pe^x04 %s^x01 la^x04 CT^x01.", TAG, name, name2 );
  }
  if(cmd[4]=='s')
  {
      cs_set_user_team(player,3);
      ColorChat( 0, GREEN, "%s^x01 Adminul^x04 %s^x01 l-a mutat pe^x04 %s^x01 la^x04 Spectator^x01.", TAG, name, name2 );
  }
  return PLUGIN_HANDLED;
}

//============================================PAUSE & NOPAUSE=========================================
public cmdPause(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;
if (paused == 0)
{
paused = 1;
server_cmd("amx_pause");
ColorChat( 0, GREEN, "%s^x01 SERVER PAUSED!", TAG);
}
return PLUGIN_HANDLED;
}
public cmdUnPause(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;
if (paused == 1)
{
paused = 0;
server_cmd("amx_pause");
ColorChat( 0, GREEN, "%s^x01 SERVER UNPAUSED!", TAG);
}
return PLUGIN_HANDLED;
}

public show_messages ( )
{
        new Buffer[256];
        formatex(Buffer, sizeof Buffer - 1, "^x04%s", messages[random(sizeof messages)]);
       
        new players[32], num, id;
        get_players(players, num);
       
        for(new i = 0 ; i < num ; i++)
        {
                id = players;
       
                message_begin(MSG_ONE, get_user_msgid("SayText"), _, id);
                write_byte(id);
                write_string(Buffer);
                message_end();
        }
}
public GameDesc( ) {
static gamename[32];
get_pcvar_string( amx_gamename, gamename, 31 );
forward_return( FMV_STRING, gamename );
return FMRES_SUPERCEDE;
}


OciXCrom 11-10-2020 09:47

Re: I need some help with the plugin
 
Maybe if you tell what the errors are we can know what's wrong?

sebiq 11-10-2020 09:48

Re: I need some help with the plugin
 
mixx.sma(392) : error 006: must be assigned to an array
mixx.sma(404) : warning 217: loose indentation
mixx.sma(405) : warning 217: loose indentation
mixx.sma(413) : warning 217: loose indentation
mixx.sma(431) : warning 217: loose indentation
mixx.sma(432) : warning 217: loose indentation
mixx.sma(443) : warning 217: loose indentation
mixx.sma(451) : warning 217: loose indentation
mixx.sma(452) : warning 217: loose indentation
mixx.sma(463) : warning 217: loose indentation
mixx.sma(514) : error 035: argument type mismatch (argument 1)
mixx.sma(515) : error 035: argument type mismatch (argument 1)
mixx.sma(557) : error 033: array must be indexed (variable "origin")
mixx.sma(570) : error 006: must be assigned to an array
mixx.sma(748) : warning 217: loose indentation
mixx.sma(749) : warning 217: loose indentation
mixx.sma(920) : error 006: must be assigned to an array

this is...

Napoleon_be 11-10-2020 15:48

Re: I need some help with the plugin
 
No idea who made or customized this plugin, but there's a lot of work on it to optimize it, make it "bugfree" and make it efficient, but here you go. Here's a quick fix without errors. Don't mind about the warnings, they won't affect your code.

PHP Code:

#include <amxmodx>
#include <cstrike>
#include <ColorChat>
#include <fun>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>

#pragma semicolon    1

#define MAX_ROUNDS    15
#define TASK        1337
#define ACCESS ADMIN_KICK
#define TIME 30.0
#define ADVERTISING_TIME 80.0


static const

    
PLUGIN[ ] =        "RGLeague Mix",
    
VERSION[ ] =        "0.0.1",
    
AUTHOR[ ] =        "regiZoru",
    
TAG[ ] =        "[RGLeague]";

new const 
g_szInterpCommands[ ][ ] =
{
    
"cl_filterstuffcmd 0",
    
"ex_interp 0.01"

};

stock const messages [ ] [ ] =
{
    
"^x04[RGLeague]^x01 Forum:^x04 www.RGLeague.Ro",
        
"^x04[RGLeague]^x01 Adresa TeamSpeak:^x04 TS.RGLeague.RO",
    
"^x04[RGLeague]^x01 Plugin creat de^x04 www.RGLeague.Ro"

};

//new g_On[ 33 ] = 0;


new boolg_bMixStarted;
new 
boolg_bEndRound;
new 
boolg_bSecondPart;

new 
g_iTeroScoreg_iCTScore;
new 
g_iTeroSScoreg_iCTSScore;

new 
cvar_msg;
new 
SyncHud;
new 
KNIFE 0;
new 
paused 0;
new 
amx_gamename;


new 
Float:player_origin[33][3];
new 
bool:g_bUsersCanChat true;
new 
bool:hasdemo[33];

public 
plugin_init( )
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_clcmd("say .start""cmdStart"ADMIN_KICK);
    
register_clcmd("say .stop""cmdStop"ADMIN_KICK);
    
register_clcmd("say .warm""cmdWarm"ADMIN_KICK);
        
register_clcmd("say .extra""cmdExtra"ADMIN_KICK);
    
register_clcmd("say .lame""cmdKnife"ADMIN_KICK);
    
register_clcmd("say .specall""moveSpec"ADMIN_KICK);
    
register_clcmd("say .rr""cmdRestart"ADMIN_KICK);
    
register_clcmd"say .off""cmdBlocare"ADMIN_KICK);
    
register_clcmd"say .on""cmdDeblocare"ADMIN_KICK);
    
register_clcmd"say .interp""cmdSetari"ADMIN_KICK);
    
register_clcmd"say .comenzi""cmdComenzi"ADMIN_KICK);
    
register_concmd("amx_t""admin_chteam"ADMIN_KICK"<authid, nick or #userid>");
    
register_concmd("amx_ct""admin_chteam"ADMIN_KICK"<authid, nick or #userid>");
    
register_concmd("amx_spec""admin_chteam"ADMIN_KICK"<authid, nick or #userid>");
    
register_clcmd("say .pause""cmdPause"ADMIN_KICK);
    
register_clcmd("say .unpause""cmdUnPause"ADMIN_KICK);
    
register_clcmd("say_team .start""cmdStart"ADMIN_KICK);
    
register_clcmd("say_team .stop""cmdStop"ADMIN_KICK);
    
register_clcmd("say_team .warm""cmdWarm"ADMIN_KICK);
        
register_clcmd("say_team .extra""cmdExtra"ADMIN_KICK);
    
register_clcmd("say_team .lame""cmdKnife"ADMIN_KICK);
    
register_clcmd("say_team .specall""moveSpec"ADMIN_KICK);
    
register_clcmd("say_team .rr""cmdRestart"ADMIN_KICK);
    
register_clcmd"say_team .off""cmdBlocare"ADMIN_KICK);
    
register_clcmd"say_team .on""cmdDeblocare"ADMIN_KICK);
    
register_clcmd"say_team .interp""cmdSetari"ADMIN_KICK);
    
register_clcmd"say_team .comenzi""cmdComenzi"ADMIN_KICK);
    
register_clcmd("say_team .pause""cmdPause"ADMIN_KICK);
    
register_clcmd("say_team .unpause""cmdUnPause"ADMIN_KICK);


    
register_clcmd"say""ClCmdSay" );
    
register_clcmd"say""hookSay" );
    
register_clcmd"say_team""hookSay" );

    
RegisterHam(Ham_Spawn"player""e_Spawn"1);
    
amx_gamename register_cvar"amx_gamename""www.RGLeague.Ro" );
    
register_forwardFM_GetGameDescription"GameDesc" );
    
register_event("SendAudio""EventTeroWin""a""2&%!MRAD_terwin");
    
register_event("SendAudio""EventCTWin""a""2&%!MRAD_ctwin");
    
register_event("CurWeapon","switchweapon","be","1=1","2!29");
    
register_logevent("LogEventRoundEnd"2"1=Round_End");
    
register_logevent("LogEventRound"2"1=Round_End");
    
register_logevent("LogEventRoundStart"2"1=Round_Start");
    
set_task ADVERTISING_TIME"show_messages"___,"b" );
    
cvar_msg register_cvar("score_msg""3");
    
SyncHud CreateHudSyncObj( );
}

//=================================================MIX COMMANDS===============================================//

public switchweapon(id)
{
    if (
KNIFE == 1)
    {
        
engclient_cmd(id"weapon_knife");
    }
}

public 
cmdRestart(id)
{
    if( !
UserHasAccesid ) )
    {
        
ColorChatidGREEN"%s^x01 Nu ai acces la aceasta comanda."TAG );
        return 
PLUGIN_HANDLED;
    }
    if( !
g_bMixStarted )
    {
        
ColorChat(idGREEN"%s^x01 Nu poti da restart inainte sa inceapa meciul."TAG);

        return 
PLUGIN_HANDLED;
    }

    if( 
g_bSecondPart )
    {
        
g_iTeroScore g_iTeroSScore;
        
g_iCTScore g_iCTSScore;
        
KNIFE 0;
        
g_bMixStarted true;
        new 
szName32 ];
        
get_user_nameidszNamesizeof szName ) -);

        
ColorChat(0GREEN"%s^x01 %s a repornit partea a II-a a meciului. Good luck!"TAGszName);
    }

    else if( !
g_bSecondPart )
    {
        
g_iTeroScore 0;
        
g_iCTScore 0;
        
g_iTeroSScore 0;
        
g_iCTSScore 0;
        
KNIFE 0;
        
g_bMixStarted true;
        
g_bSecondPart false;
        new 
szName32 ];
        
get_user_nameidszNamesizeof szName ) -);
        
server_cmd("sv_restart 1");
                
server_cmd"mp_freezetime 10" );
                
server_cmd"mp_buytime 0.25" );
                
server_cmd"mp_startmoney 800" );
                
server_cmd"mp_roundtime 1.75" );
                
server_cmd"mp_forcecamera 2" );
                
server_cmd"mp_friendlyfire 1");
                
server_cmd"mp_c4timer 35");

        
ColorChat(0GREEN"%s^x01 %s a repornit prima parte a meciului. Good luck!"TAGszName);
    }

    
server_cmd("sv_restart 1");

    return 
PLUGIN_HANDLED;
}

public 
cmdKnife(id)
{
    if( !
UserHasAccesid ) )
    {
        
ColorChatidGREEN"%s^x01 Nu ai acces la aceasta comanda."TAG );
        return 
PLUGIN_HANDLED;
    }
    if( 
g_bMixStarted )
    {
        
ColorChat(idGREEN"%s^x01 Nu poti porni runda de lame in timpul meciului."TAG);

        return 
PLUGIN_HANDLED;
    }
    
KNIFE 1;
    new 
szName32 ];
    
get_user_nameidszNamesizeof szName ) -);
    
server_cmd("sv_restart 1");
    
server_cmd("exec live.cfg");
    
server_cmd("mp_freezetime 0");
    
ColorChat(0GREEN"%s^x01 %s a pornit runda de lame."TAGszName);
    
strip_user_weapons(0);

    return 
PLUGIN_HANDLED;
}

public 
cmdStart(id)
{
    if( !
UserHasAccesid ) )
    {
        
ColorChatidGREEN"%s^x01 Nu ai acces la aceasta comanda."TAG );
        return 
PLUGIN_HANDLED;
    }
    if( !
g_bSecondPart )
    {
        if( 
g_bMixStarted )
        {
            
ColorChat(idGREEN"%s^x01 Meciul este deja pornit."TAG);

            return 
PLUGIN_HANDLED;
        }

        
g_iTeroScore 0;
        
g_iCTScore 0;
        
g_iTeroSScore 0;
        
g_iCTSScore 0;
        
KNIFE 0;
        
g_bMixStarted true;
        
g_bSecondPart false;
        new 
szName32 ];
        
get_user_nameidszNamesizeof szName ) -);
        
taskMSG(TASK);

        
server_cmd("sv_restart 1");
                
server_cmd"mp_freezetime 10" );
                
server_cmd"mp_buytime 0.25" );
                
server_cmd"mp_startmoney 800" );
                
server_cmd"mp_roundtime 1.75" );
                
server_cmd"mp_forcecamera 2" );
                
server_cmd"mp_friendlyfire 1");
                
server_cmd"mp_c4timer 35");


        
ColorChat(0GREEN"%s^x01 %s a pornit prima parte a meciului. Good luck!"TAGszName);
                
ColorChat(0GREEN"LIVE LIVE LIVE !!! Good luck!");
                
ColorChat(0GREEN"LIVE LIVE LIVE !!! Good luck!");
                
ColorChat(0GREEN"LIVE LIVE LIVE !!! Good luck!");
    }

    else if( 
g_bSecondPart )
    {
        
KNIFE 0;
        
g_bMixStarted true;
        new 
szName32 ];
        
get_user_nameidszNamesizeof szName ) -);
                
server_cmd("sv_restart 1");
                
server_cmd"mp_freezetime 10" );
                
server_cmd"mp_buytime 0.25" );
                
server_cmd"mp_startmoney 800" );
                
server_cmd"mp_roundtime 1.75" );
                
server_cmd"mp_forcecamera 2" );
                
server_cmd"mp_friendlyfire 1");
                
server_cmd"mp_c4timer 35");


        
ColorChat(0GREEN"%s^x01 %s a pornit a II-a parte a meciului. Good luck!"TAGszName);
                
ColorChat(0GREEN"LIVE LIVE LIVE !!! Good luck!");
                
ColorChat(0GREEN"LIVE LIVE LIVE !!! Good luck!");
                
ColorChat(0GREEN"LIVE LIVE LIVE !!! Good luck!");
    }

    return 
PLUGIN_HANDLED;
}

public 
cmdWarm(id)
{
    if( !
UserHasAccesid ) )
    {
        
ColorChatidGREEN"%s^x01 Nu ai acces la aceasta comanda."TAG );
        return 
PLUGIN_HANDLED;
    }
    if( 
g_bMixStarted )
    {
        
ColorChat(idGREEN"%s^x01 Nu poti da warm in timpul meciului."TAG);

        return 
PLUGIN_HANDLED;
    }

    
g_iTeroScore 0;
    
g_iCTScore 0;
    
KNIFE 0;
    
g_bMixStarted false;
    
g_bSecondPart false;
    new 
szName32 ];
    
get_user_nameidszNamesizeof szName ) -);
    if( 
task_exists(TASK) )
    {
        
remove_task(TASK);
    }

    
ColorChat(0GREEN"%s^x01 %s a pornit rundele de incalzire."TAGszName);
    
server_cmd("sv_restart 1");
        
server_cmd"mp_freezetime 0" );
        
server_cmd"mp_buytime 0.25" );
        
server_cmd"mp_startmoney 16000" );
        
server_cmd"mp_roundtime 8.75" );
        
server_cmd"mp_forcecamera 2" );
        
server_cmd"mp_friendlyfire 0");
        
server_cmd"mp_c4timer 35");


    return 
PLUGIN_HANDLED;
}

public 
cmdStop(id)
{
    if( !
UserHasAccesid ) )
    {
        
ColorChatidGREEN"%s^x01 Nu ai acces la aceasta comanda."TAG );
        return 
PLUGIN_HANDLED;
    }
    if( !
g_bMixStarted )
    {
        
ColorChat(idGREEN"%s^x01 Meciul este deja oprit."TAG);

        return 
PLUGIN_HANDLED;
    }

    
g_iTeroScore 0;
    
g_iCTScore 0;
    
g_iTeroSScore 0;
    
g_iCTSScore 0;

    
g_bMixStarted false;
    
g_bSecondPart false;
    new 
szName32 ];
    
get_user_nameidszNamesizeof szName ) -);
    if( 
task_exists(TASK) )
    {
        
remove_task(TASK);
    }

    
ColorChat(0GREEN"%s^x01 %s a anulat meciul."TAGszName);
        
server_cmd("sv_restart 1");
        
server_cmd"mp_freezetime 0" );
        
server_cmd"mp_buytime 0.25" );
        
server_cmd"mp_startmoney 16000" );
        
server_cmd"mp_roundtime 8.75" );
        
server_cmd"mp_forcecamera 2" );
        
server_cmd"mp_friendlyfire 0");
        
server_cmd"mp_c4timer 35");

    return 
PLUGIN_HANDLED;
}

public 
EventTeroWin( )
{
    if( 
g_bMixStarted && !g_bEndRound )
    {
        
g_bEndRound true;

        
g_iTeroScore++;

    }
}

public 
EventCTWin( )
{
    if( 
g_bMixStarted && !g_bEndRound )
    {
        
g_bEndRound true;

        
g_iCTScore++;

    }
}

public 
LogEventRoundStart( )
{
    
g_bEndRound false;

}

public 
LogEventRoundEnd( )
{
    if( 
g_bMixStarted )
    {
        if( 
g_iTeroScore g_iCTScore == MAX_ROUNDS )
        {
            new 
iPlayers[32], iNumplayer;

            
get_players(iPlayersiNum"h");

            for( new 
0iNumi++ )
            {
                
player iPlayers[i];

                if( 
cs_get_user_team(player) == CS_TEAM_T )
                {
                    
cs_set_user_team(playerCS_TEAM_CT);
                }

                else if( 
cs_get_user_team(player) == CS_TEAM_CT )
                {
                    
cs_set_user_team(playerCS_TEAM_T);
                }
            }
        
server_cmd"sv_restart 1");
        
server_cmd"mp_freezetime 10" );
        
server_cmd"mp_buytime 0.25" );
        
server_cmd"mp_startmoney 800" );
        
server_cmd"mp_roundtime 1.75" );
        
server_cmd"mp_forcecamera 2" );
        
server_cmd"mp_friendlyfire 0");
        
server_cmd"mp_c4timer 35");

            new 
iAux g_iTeroScore;
            
g_iTeroScore g_iCTScore;
            
g_iCTScore iAux;

            
g_iTeroSScore g_iTeroScore;
            
g_iCTSScore g_iCTScore;

            
g_bSecondPart true;
            
g_bMixStarted false;

            
server_cmd("sv_restart 1");
        }

        if( 
g_iTeroScore >= MAX_ROUNDS )

        {

            
ColorChat(0GREEN"%s^x03 Echipa Tero^x01 a castigat meciul cu^x04 %d^x01 la^x04 %d^x01."TAGg_iTeroScoreg_iCTScore);
        
server_cmd"sv_restart 1");
        
server_cmd"mp_freezetime 0" );
        
server_cmd"mp_buytime 0.25" );
        
server_cmd"mp_startmoney 16000" );
        
server_cmd"mp_roundtime 8.75" );
        
server_cmd"mp_forcecamera 2" );
        
server_cmd"mp_friendlyfire 0");
        
server_cmd"mp_c4timer 35");
    if( 
task_exists(TASK) )
    {
        
remove_task(TASK);
    }
            
cmdStop(TASK);

            return 
PLUGIN_HANDLED;
        }

        else if( 
g_iCTScore >= MAX_ROUNDS )
        {
            
ColorChat(0GREEN"%s^x03 Echipa CT^x01 a castigat meciul cu^x04 %d^x01 la^x04 %d^x01."TAGg_iCTScoreg_iTeroScore);
        
server_cmd"sv_restart 1");
        
server_cmd"mp_freezetime 0" );
        
server_cmd"mp_buytime 0.25" );
        
server_cmd"mp_startmoney 16000" );
        
server_cmd"mp_roundtime 8.75" );
        
server_cmd"mp_forcecamera 2" );
        
server_cmd"mp_friendlyfire 0");
        
server_cmd"mp_c4timer 35");
    if( 
task_exists(TASK) )
    {
        
remove_task(TASK);
    }
            
cmdStop(TASK);

            return 
PLUGIN_HANDLED;
        }

        else if( 
g_iTeroScore == MAX_ROUNDS && g_iCTScore == MAX_ROUNDS )
        {
            
ColorChat(0GREEN"%s^x01 Meciul s-a terminat egal."TAG);
            
ColorChat(0GREEN"%s^x01 Pentru prelungiri,dati comanda /extra"TAG);

            
cmdStop(TASK);

            return 
PLUGIN_HANDLED;
        }

        if( 
get_pcvar_num(cvar_msg) != )
        {
            
ColorChat(0GREEN"%s^x01 Terrorists^x04 %d^x01 -^x04 %d^x01 Counter-Terrorists"TAGg_iTeroScoreg_iCTScore);
        }
    }

    return 
PLUGIN_HANDLED;
}

public 
taskMSG(T_A_S_K)
{
    if( 
get_pcvar_num(cvar_msg) > )
    {
        
set_hudmessage(808080, -1.00.0300.01.10.00.0, -1);
        
ShowSyncHudMsg(0SyncHud"Echipa TERO %d - %d Echipa CT"g_iTeroScoreg_iCTScore);
    }

    
set_task(1.0"taskMSG"TASK);
}

public 
moveSpec(idlevelcid)
{
        if (!
cmd_access(idlevelcid2))
        {
            return 
PLUGIN_HANDLED;
        }
        if( 
g_bMixStarted )
        {
        
ColorChat(idGREEN"%s^x01 Nu poti pune jucatorii Spectator in timpul meciului."TAG);

        return 
PLUGIN_HANDLED;
        }
        new 
players[32], totali;
        
get_players(players,total,"h");
        for (
i=0i<total;i++)
        {
            
user_kill(players[i], 0);
            
cs_set_user_team(players[i], CS_TEAM_SPECTATOR);
        }
        
ColorChat(0GREEN"%s^x01 Jucatorii au fost pusi ^x04Spectator ^x01pentru alegeri."TAG);
        return 
PLUGIN_HANDLED;
}

//===============================================================================================//
//==================================AFK REPORT=======================================================================//
public e_Spawn(id)
{
    
remove_task(id);
    if(
is_user_alive(id))
    {
        
set_task(0.8"get_spawn"id);
    }
    return 
HAM_IGNORED;
}

public 
get_spawn(id)
{
    
pev(idpev_originplayer_origin[id]);
    
set_task(TIME"check_afk"id);
}

public 
check_afk(id)
{
    if(
is_user_alive(id))
    {
        if(
same_origin(id))
        {
            new 
name[33];
            
get_user_name(idname32);
            
ColorChat(0GREEN"%s^x01 Player-ul^x04 %s^x01 a fost raportat ca AFK!"TAGname);
        }
    }
}

public 
same_origin(id)
{
    new 
Float:origin[3];
    
pev(idpev_originorigin);
    for(new 
03i++)
        if(
origin[i] != player_origin[id][i])
            return 
0;
    return 
1;
}
//=====================================================================================================================
public LogEventRound( )
{
    new 
iPlayers[32], iNumplayer;

    
get_players(iPlayersiNum"ch");

    for( new 
0iNumi++ )
    {
        
player iPlayers[i];
    }
}
//===============================================BLOCK CHAT=============================================================
public ClCmdSayid )
{

    static 
szArgs192 ];
    
read_argsszArgssizeof szArgs ) -);

    if( !
szArgs] )    return PLUGIN_CONTINUE;

    if( !
g_bUsersCanChat )
    {
        
ColorChatidGREEN"%s^x01 Chat-ul este^x04 blocat^x01, folositi functia say_team!"TAG );
    }

    return 
g_bUsersCanChat PLUGIN_CONTINUE PLUGIN_HANDLED;

}

public 
cmdBlocareid )
{
    if( !
UserHasAccesid ) )
    {
        
ColorChatidGREEN"%s^x01 Nu ai acces la aceasta comanda."TAG );
        return 
PLUGIN_HANDLED;
    }

    if( !
g_bUsersCanChat )
    {
        
ColorChatidGREEN"%s^x01 Chat-ul este deja^x04 blocat^x01."TAG );
        return 
PLUGIN_HANDLED;
    }

    new 
szName32 ];
    
get_user_nameidszNamesizeof szName ) -);

    
ColorChat0GREEN"%s^x01 Chat-ul a fost^x04 blocat^x01 de catre adminul^x04 %s^x01."TAGszName );

    
g_bUsersCanChat false;

    return 
PLUGIN_CONTINUE;
}


public 
cmdDeblocareid )
{
    if( !
UserHasAccesid ) )
    {
        
ColorChatidGREEN"%s^x01 Nu ai acces la aceasta comanda."TAG );
        return 
PLUGIN_HANDLED;
    }

    if( 
g_bUsersCanChat )
    {
        
ColorChatidGREEN"%s^x01 Chat-ul este deja^x04 deblocat^x01."TAG );
        return 
PLUGIN_HANDLED;
    }

    new 
szName32 ];
    
get_user_nameidszNamesizeof szName ) -);

    
ColorChat0GREEN"%s^x01 Chat-ul a fost^x04 deblocat^x01 de catre adminul^x04 %s^x01."TAGszName );

    
g_bUsersCanChat true;

    return 
PLUGIN_CONTINUE;
}

stock bool:UserHasAccesid )
{
    if( 
get_user_flagsid ) & ADMIN_KICK )
        return 
true;

    return 
false;

}

public 
cmdSetariid )
{
    if( !
UserHasAccesid ) )
    {
        
ColorChatidGREEN"%s^x01 Nu ai acces la aceasta comanda."TAG );
        return 
PLUGIN_HANDLED;
    }

    static 
iSize sizeof g_szInterpCommands );

    for( new 
0iSizei++ )
        
client_cmd0g_szInterpCommands] );

    
client_print0print_console"=================== Setari War-Mix ================" );
    
client_print0print_console"[RGLeague.Ro] ex_interp setat pe valoarea 0.01" );
    
client_print0print_console"====================================================" );

    new 
szName32 ];
    
get_user_nameidszNamesizeof szName ) -);

    
ColorChat0GREEN"%s ^x04%s^x01 executa interp pe jucatori. Verificati consola."TAGszName );

    return 
PLUGIN_CONTINUE;
}

public 
cmdComenziid )
{
    if( !
UserHasAccesid ) )
    {
        
ColorChatidGREEN"%s^x01 Nu ai acces la aceasta comanda."TAG );
        return 
PLUGIN_HANDLED;
    }

    static 
iSize sizeof g_szInterpCommands );

    for( new 
0iSizei++ )
        
client_cmd0g_szInterpCommands] );

    
client_print0print_console"=================== Comenzi War-Mix ================" );

    
client_print0print_console"/comenzi - Lista comenzi war" );
    
client_print0print_console"/start - Porneste meciul" );
    
client_print0print_console"/stop - Opreste meciul" );
    
client_print0print_console"/lame - Porneste runda de lame" );
    
client_print0print_console"/off - Opreste chat-ul" );
    
client_print0print_console"/on - Porneste chat-ul " );
    
client_print0print_console"/interp - Seteaza interp 0.01 playerilor" );
    
client_print0print_console"/warm - Porneste warm-up" );
    
client_print0print_console"/rr - Restart" );
    
client_print0print_console"/money - Arata situatia financiara" );
    
client_print0print_console"/demo nick - Porneste demo jucatorului respectiv" );
    
client_print0print_console"/extra - Porneste rundele de departajare in caz de egal" );
    
client_print0print_console"/specall- Transferi toti playerii la SPEC" );

    
client_print0print_console"----------------------------------------" );
    
client_print0print_console"----Comenzi amx: ----" );
    
client_print0print_console"---------------------------------------" );

    
client_print0print_console"amx_ct nume - Transferi player-ul la CT" );
    
client_print0print_console"amx_t nume - Transferi player-ul la T" );
    
client_print0print_console"amx_spec nume - Transferi player-ul la spectatori" );
    
client_print0print_console"====================================================" );

    new 
szName32 ];
    
get_user_nameidszNamesizeof szName ) -);



    return 
PLUGIN_CONTINUE;
}

//======================================= Prelungiri =================================================
public cmdExtra(id)
{
    if( !
UserHasAccesid ) )
    {
        
ColorChatidGREEN"%s^x01 Nu ai acces la aceasta comanda."TAG );
        return 
PLUGIN_HANDLED;
    }
    if( !
g_bSecondPart )
    {
        if( 
g_bMixStarted )
        {
            
ColorChat(idGREEN"%s^x01 Meciul este deja pornit."TAG);

            return 
PLUGIN_HANDLED;
        }

        
g_iTeroScore 0;
        
g_iCTScore 0;
        
g_iTeroSScore 0;
        
g_iCTSScore 0;
        
KNIFE 0;
        
g_bMixStarted true;
        
g_bSecondPart false;
        new 
szName32 ];
        
get_user_nameidszNamesizeof szName ) -);
        
taskMSG(TASK);

                
server_cmd("sv_restart 1");
                
server_cmd"mp_freezetime 10" );
                
server_cmd"mp_buytime 0.25" );
                
server_cmd"mp_startmoney 10000" );
                
server_cmd"mp_roundtime 1.75" );
                
server_cmd"mp_forcecamera 2" );
                
server_cmd"mp_friendlyfire 1");
                
server_cmd"mp_c4timer 35");


        
ColorChat(0GREEN"%s^x01 %s a pornit prima parte a prelungirilor. Good luck!"TAGszName);
                
ColorChat(0GREEN"LIVE LIVE LIVE !!! Good luck!");
                
ColorChat(0GREEN"LIVE LIVE LIVE !!! Good luck!");
                
ColorChat(0GREEN"LIVE LIVE LIVE !!! Good luck!");
    }

    else if( 
g_bSecondPart )
    {
        
KNIFE 0;
        
g_bMixStarted true;
        new 
szName32 ];
        
get_user_nameidszNamesizeof szName ) -);
                
server_cmd("sv_restart 1");
                
server_cmd"mp_freezetime 10" );
                
server_cmd"mp_buytime 0.25" );
                
server_cmd"mp_startmoney 10000" );
                
server_cmd"mp_roundtime 1.75" );
                
server_cmd"mp_forcecamera 2" );
                
server_cmd"mp_friendlyfire 1");
                
server_cmd"mp_c4timer 35");


        
ColorChat(0GREEN"%s^x01 %s a pornit a II-a parte a prelungirilor. Good luck!"TAGszName);
                
ColorChat(0GREEN"LIVE LIVE LIVE !!! Good luck!");
                
ColorChat(0GREEN"LIVE LIVE LIVE !!! Good luck!");
                
ColorChat(0GREEN"LIVE LIVE LIVE !!! Good luck!");
    }

    return 
PLUGIN_HANDLED;
}
//==========================================DEMO=======================================================

new const g_Demoname[] = "DEMO_RGLeague_RO";


public 
client_connect(id)
{
    
hasdemo[id] = false;

}

public 
hookSayid )
{
    new 
szSaid192 ];
    
read_argsszSaidsizeofszSaid ) -);
    
remove_quotesszSaid );

    if( 
containszSaid"/demo" ) != -)
    {
        if( 
get_user_flagsid ) & ADMIN_KICK )
        {
            new 
target32 ];
            
copytargetsizeoftarget ) -1szSaid] );

            new 
id2 cmd_targetidtarget);

            if(
hasdemo[id2])
            {
                static 
szName32 ];
                new 
mapname[32];
                
get_user_nameid2szNamesizeofszName ) -);
                
get_mapname(mapname,31);
                
ColorChatidGREEN"%s ^x01 Jucatorul %s are deja demo!"TAGszName );
                return 
PLUGIN_HANDLED;
            }

            if( 
id2 )
            {
                static 
szName32 ];
                new 
mapname[32];
                
get_user_nameid2szNamesizeofszName ) -);
                
get_mapname(mapname,31);
                
hasdemo[id2] = true;

                
client_cmdid2"record ^"%s-%s^""g_Demonamemapname);

                
ColorChatidGREEN"%s^x01 Ai pornit demo pe jucatorul^x04 %s^x01!"TAGszName );
            }

            else
            {
                
console_printid"Player-ul nu exista !!!" );
            }

            return 
PLUGIN_HANDLED;
        }
    }
    return 
PLUGIN_CONTINUE;
}

//========================================TRANSFER===================================================
public admin_chteam(idlevelcid) {
   if (!
cmd_access(idlevelcid2))
      return 
PLUGIN_HANDLED;

   new 
cmd[10];
   new 
arg[32];
   new 
name[32], name2[32];

   
read_argv(0,cmd,9);
   
read_argv(1,arg,31);
   new 
player cmd_target(id,arg,2);
   if (!
player) return PLUGIN_HANDLED;

   
user_kill(player1);
   
get_user_name(idname31);
   
get_user_name(playername231);

   if(
cmd[4]=='t')
   {
      
cs_set_user_team(player,1);
      
ColorChat0GREEN"%s^x01 Adminul^x04 %s^x01 l-a mutat pe^x04 %s^x01 la^x04 TERO^x01."TAGnamename2 );
   }
   if(
cmd[4]=='c')
   {
      
cs_set_user_team(player,2);
      
ColorChat0GREEN"%s^x01 Adminul^x04 %s^x01 l-a mutat pe^x04 %s^x01 la^x04 CT^x01."TAGnamename2 );
   }
   if(
cmd[4]=='s')
   {
      
cs_set_user_team(player,3);
      
ColorChat0GREEN"%s^x01 Adminul^x04 %s^x01 l-a mutat pe^x04 %s^x01 la^x04 Spectator^x01."TAGnamename2 );
   }
   return 
PLUGIN_HANDLED;
}

//============================================PAUSE & NOPAUSE=========================================
public cmdPause(idlevelcid)
{
if (!
cmd_access(idlevelcid2))
return 
PLUGIN_HANDLED;
if (
paused == 0)
{
paused 1;
server_cmd("amx_pause");
ColorChat0GREEN"%s^x01 SERVER PAUSED!"TAG);
}
return 
PLUGIN_HANDLED;
}
public 
cmdUnPause(idlevelcid)
{
if (!
cmd_access(idlevelcid2))
return 
PLUGIN_HANDLED;
if (
paused == 1)
{
paused 0;
server_cmd("amx_pause");
ColorChat0GREEN"%s^x01 SERVER UNPAUSED!"TAG);
}
return 
PLUGIN_HANDLED;
}

public 
show_messages ( )
{
    new 
Buffer[256];
    
formatex(Buffersizeof Buffer 1"^x04%s"messages[random(sizeof messages)]);

    new 
players[32], numid;
    
get_players(playersnum);

    for(new 
num i++)
    {
        
id players[i];

        
message_begin(MSG_ONEget_user_msgid("SayText"), _id);
        
write_byte(id);
        
write_string(Buffer);
        
message_end();
    }
}
public 
GameDesc( ) {
static 
gamename[32];
get_pcvar_stringamx_gamenamegamename31 );
forward_returnFMV_STRINGgamename );
return 
FMRES_SUPERCEDE;




All times are GMT -4. The time now is 12:04.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.