Jump to content
Sign in to follow this  
Senzor^ ;x

Cerere plugin redirect sau xredirect

Recommended Posts

Nume : Se[N]zor ;x

 

Versiune : -

 

Descriere detaliata : Vreau un plugin ca sa imi redirectioneze playerii de pe un server, ceva gen cum este pluginul de pe RESPAWN.RANGFORT

Share this post


Link to post
Share on other sites

Catre ce sv vrei? Da-mi ip ca iti fac licentiat sau daca vrei iti dau cel default

Share this post


Link to post
Share on other sites

#include <amxmodx>
#include <amxmisc>

#define PLUGIN    "RF REDIRECT SYSTEM"
#define AUTHOR    "RF COMMUNITY"
#define VERSION    "1.0"

new g_cvarMaxPlayers;
new g_cvarTipRedirect;

static tipredirect;
static randomint;
static precompute;

new const servere[][] = 
{
    "127.0.0.1",
    "127.0.0.2",
    "127.0.0.3"
}

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    g_cvarMaxPlayers = register_cvar("amx_rd_maxplayers", "0");
    
    // Tipul de redirect
    // -------------------
    // Valoarea 0 - disable
    // Valoarea 1 - Redirect tuturor inafara de cei care sunt slot +
    // Valoarea 2 - Redirect tuturor inafara de cei care sunt slot + si steameri
    // Valoarea 3 - Redirect tuturor (inclusiv admini) inafara de steameri
    // Valoarea 4 - Redirect tuturor, indiferent daca sunt steameri sau admini
    
    g_cvarTipRedirect = register_cvar("amx_rd_redirect_type", "1");
    
    tipredirect = get_pcvar_num(g_cvarTipRedirect);
    
    // Salvam marimea const servere pentru optimizare consum de resurse
    precompute = sizeof (servere);
}

public client_authorized(id)
{
    if(!(get_pcvar_num(g_cvarTipRedirect)))
        return PLUGIN_CONTINUE
    
    switch(tipredirect)
    {
        case(1):
        {
            if( (get_playersnum() >= get_pcvar_num(g_cvarMaxPlayers)) && !is_user_admin(id) )
            {
                randomint = random_num(0, precompute);
                client_cmd(id, "Connect %s", servere[randomint]);
            }
        }
        
        case(2):
        {
            if( (get_playersnum() >= get_pcvar_num(g_cvarMaxPlayers)) && !is_steam_user(id) )
            {
                randomint = random_num(0, precompute);
                client_cmd(id, "Connect %s", servere[randomint]);
            }
        }
        
        case(3):
        {
            if( (get_playersnum() >= get_pcvar_num(g_cvarMaxPlayers)) && !is_user_admin(id) && !is_steam_user(id) )
            {
                randomint = random_num(0, precompute);
                client_cmd(id, "Connect %s", servere[randomint]);
            }
        }
        
        case(4):
        {
            if(get_playersnum() >= get_pcvar_num(g_cvarMaxPlayers))
            {
                randomint = random_num(0, precompute);
                client_cmd(id, "Connect %s", servere[randomint]);
            }
        }
    }
    
    return PLUGIN_CONTINUE
}

stock bool:is_steam_user(index)
{
    new authid[8];
    get_user_authid(index, authid, sizeof authid - 1);
    if(authid[7] == ':')
        return true;
    return false;
}

 

incearca asta ,este foarte easy

  • Like 1

Share this post


Link to post
Share on other sites

Mi-se descarca acea arhiva si cand dau sa o deschid imi da o eroare "The archive is either in unknown format or demage"

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×