Jump to content
Boosted your CS1.6 server ×
Welcome to
BLACKGAMES Romania
This community was created in 2012 as a laid back gaming environment to give gamers a place to call home and be able to communicate with others. Don't forget to present yourself to us in a small topic then you can try to read our community rules and most importantly, don't forget to have fun, we are a gaming community with the desire to change the meaning of gaming, we try to offer everything that is best for members of our community, at the same time we are looking for staff, servers, designers, pulleys and more.

[PLUGIN] Admin Transfer & Mover


Recommended Posts

PLUGIN: Acest plugin, este unul clasic și normal, până acum întânit de mulți, acel plugin prin care Administratorii pot muta jucătorii la diferite echipe, și jucătorii au comenzi publice, în chat precum : [/t /ct /spec].

VERSIUNE: Versiunea actuală a acestuia este: 1.1, dar cu timpul sau prin anumite solicitării vom avansa versiunea.

Necesități pentru buna funcționare: Amx Mod X 1.8.2 / 1.9+

 

Quote

Comenzile publice: /spec /t /ct - te poți muta la echipa respectivă, doar în cazul în care ești mort, pentru a evita niște eventuale abuzuri sau bug-uri. 

Comenzi Administrative: amx_t/ct/spec <name> -> Adminii pot muta forțat un jucător la o echipa specificată. 

 

Quote

Cvar-uri:
amx_public_movecmd 0/1 - Activare și dezactivare comenzi publice.
amx_immunity_movecmd 1/2 - Dacă aceasta este setat pe 1, Adminii nu pot muta, alți Admini care au flag-ul de imunitate, iar dacă este pus pe 2, Admini pot muta și alți Admini cu imunitate. 


Alte informații: Plugin-ul este tradus în limba engleză, textele din chat, atât și logurile se regăsesc în engleză. 

 

Spoiler

/*
*
*
* * * ***** ***** * ***** * * ***** * * * *
* * * * * * * * * * ** * * ** * * * *
* ****** ****** ****** * * ****** * * * * * * * * * * *
* * * * * ******* * * * * * * * * * * * *
* * * ***** ***** * * ***** * * ***** * * * *
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* AMX MOD X Script. *
* Plugin made by CyBer[N]eTicK *
  
  > ts.blackgames.ro
  > blackgames.ro/forum

* Important! You can modify the code, but DO NOT modify the author! *
* Contacts with me: *

* DISCORD: CyBer[N]eTicK#5615 - username cybernetick_cbk *
* STEAM: https://steamcommunity.com/id/cybernetick_cbk/ *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Special thanks to: *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
*
*/


#include <amxmodx>
#include <amxmisc>
#include <cstrike>


#define PLUGIN  "CYBER : Admin Mover"
#define VERSION "1.1"
#define AUTHOR  "CyBer[N]eTicK"

new g_iCvarPublicCommands;
new g_iCvarCommandImmunity;

#pragma semicolon 1

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    register_cvar("cyber_plugins", VERSION, FCVAR_SERVER | FCVAR_SPONLY);


    register_concmd("amx_t", "cmdAdminMove", ADMIN_KICK, "<name>");
    register_concmd("amx_ct", "cmdAdminMove", ADMIN_KICK, "<name>");
    register_concmd("amx_spec", "cmdAdminMove", ADMIN_KICK, "<name>");

    g_iCvarPublicCommands     = register_cvar("amx_public_movecmd", "1");
    g_iCvarCommandImmunity    = register_cvar("amx_immunity_movecmd", "1");

    register_clcmd("say", "cmdPlayerMove");
    register_clcmd("say_team", "cmdPlayerMove");

    set_task(120.0, "eventMSG",_,_,_, "b");
}

public eventMSG()
{
    ChatColor(0, "^4[Commands] ^3Available commands for changing teams:^4 -> /ct -> /t -> /spec");
}

public cmdPlayerMove(client) {
    if(get_pcvar_num(g_iCvarPublicCommands) != 1)
        return;

    new szArgs[192];

    read_args(szArgs, charsmax(szArgs));
    remove_quotes(szArgs);

    if(equal(szArgs, "/t", 2)) {
        if(IsPlayerInTeam(client, 1) || is_user_alive(client)) return;
        user_silentkill(client);
        cs_set_user_team(client, CS_TEAM_T);
    } else if(equal(szArgs, "/ct", 3)) {
        if(IsPlayerInTeam(client, 2) || is_user_alive(client)) return;
        user_silentkill(client);
        cs_set_user_team(client, CS_TEAM_CT);
    } else if(equal(szArgs, "/spec", 5)) {
        if(IsPlayerInTeam(client, 3) || is_user_alive(client)) return;
        user_silentkill(client);
        cs_set_user_team(client, CS_TEAM_SPECTATOR);
    }
}

public cmdAdminMove(client, level, cid) {
    if (!cmd_access(client, level, cid, 2)) 
        return 1;

    new iTeam[16];    
    new iTarget[32];
    new iPlayer;

    read_argv(0, iTeam, charsmax(iTeam));
    read_argv(1, iTarget, charsmax(iTarget));

    if (get_pcvar_num(g_iCvarCommandImmunity) == 1) {
        iPlayer = cmd_target(client, iTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF);
    } else if (get_pcvar_num(g_iCvarCommandImmunity) == 2) {
        iPlayer = cmd_target(client, iTarget, (1 << 0) | (1 << 1) | (1 << 3));
    } else {
        iPlayer = cmd_target(client, iTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF);
    }
        
    if (!iPlayer) 
        return 1;

    if (equal(iTeam, "amx_t", 5)) 
    {
        if(IsPlayerInTeam(iPlayer, 1)) 
        {
            console_print(client, "Player %s is already on the Terrorists team.", get_name(iPlayer));
            return 1;
        }
        user_silentkill(iPlayer);
        cs_set_user_team(iPlayer, CS_TEAM_T);
        log_amx("Administrator [%s] transferred [%s] to the Terrorists team.", get_name(client), get_name(iPlayer));
        ChatColor(0, "^3Administrator: ^4%s ^3moved the player: ^4%s ^3to the Terrorist team.", get_name(client), get_name(iPlayer));
    } else if (equal(iTeam, "amx_ct", 6)) 
    {
        if(IsPlayerInTeam(iPlayer, 2)) 
        {
            console_print(client, "Player %s is already on the Counter-Terrorists team.", get_name(iPlayer));
            return 1;
        }
        user_silentkill(iPlayer);
        cs_set_user_team(iPlayer, CS_TEAM_CT);
        log_amx("Administrator [%s] transferred [%s] to the Counter-Terrorists team.", get_name(client), get_name(iPlayer));
        ChatColor(0, "^3Administrator: ^4%s ^3moved the player: ^4%s ^3to the Counter-Terrorist team.", get_name(client), get_name(iPlayer));
    } 
    else if (equal(iTeam, "amx_spec", 8)) 
    {
        if(IsPlayerInTeam(iPlayer, 3)) 
        {
            console_print(client, "Player %s is already on the Spectators team.", get_name(iPlayer));
            return 1;
        }
        user_silentkill(iPlayer);
        cs_set_user_team(iPlayer, CS_TEAM_SPECTATOR);
        log_amx("Administrator [%s] transferred [%s] to the Spectators team.", get_name(client), get_name(iPlayer));
        ChatColor(0, "^3Administrator:^4 %s ^3moved the player:^4 %s ^3to the Spectator team.", get_name(client), get_name(iPlayer));
    } 
    else {}

    return 1;
}


////////////////////// STOCK //////////////////////
stock IsPlayerInTeam(playerIndex, team) {
    new currentTeam = get_user_team(playerIndex);
    return currentTeam == team;
}
////////////////////// STOCK //////////////////////
stock get_name(index)
{
    new szName[32];
    get_user_name(index, szName, charsmax(szName));
    return szName;
}
////////////////////// STOCK //////////////////////
stock ChatColor(const id, const input[], any:...) 

new count = 1, players[32]; 
static msg[191]; 
vformat(msg, 190, input, 3); 

replace_all(msg, 190, "!g", "^4"); 
replace_all(msg, 190, "!y", "^1"); 
replace_all(msg, 190, "!team", "^3"); 

if (id) players[0] = id; else get_players(players, count, "ch"); 

for (new i = 0; i < count; i++) 

if (is_user_connected(players)) 

message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players); 
write_byte(players); 
write_string(msg); 
message_end(); 



}

Oficial link: https://github.com/CyBerNeTicK-cbk/Amx-Mod-X-public-plugins/blob/main/cyber_mover.sma

   Write to me at Email: forum@blackgames.ro or on Discord: cybernetick_cbk
> For assistance and help within the community, or for any other issues or questions. <
Signal: aan.01

Spoiler

[DNS] Oferim beneficii destul de semnificative pentru persoanele care se vor afilia cu serverul în comunitatea BlackGames.

DNS pe IP
Redirect link personalizat către categoria de pe forum
Categorie canal voice pe serverul nostru de TeamSpeak, atât pe Discord.
Asistență imediată
Ajutor și sprijin (support, promovare)
Categorie forum creată după bunul plac

Pentru mai multe detalii, mă puteți contacta direct pe Discord sau printr-un mesaj privat pe forum; voi răspunde cât de repede posibil.
Discord-ul comunității BlackGames: https://discord.com/invite/Zg84G5fsXc sau https://blackgames.ro/discord

[Cerere STAFF]

Dacă dorești să faci parte din staff-ul BlackGames, te aștept cu o cerere la campania noastră: https://blackgames.ro/campaniemoderators (în cazul în care este deschisă!)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Who's Online   0 Members, 0 Anonymous, 7 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...