Поиск X KILL Give Admin

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
436
Реакции
17
Предупреждения
5
Помог
1 раз(а)
Неверный раздел форума
X KILL Give Admin

Who can update the code?
It's hard to give admin


Код:
*/
Plugins Created AngelOfdeath
Plugin Using all Mods

Fix - Server Crashing
Fix - 1 Kill statisc

Good Luck & Have Fun

*\
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <csx>
#include <ColorChat>
#include <hamsandwich>
#include <csstats>

#define PLUGIN_NAME    "Auto Admin Giver"
#define PLUGIN_AUTHOR    "AngelOfDeath-BY"
#define PLUGIN_VERSION    "1.0"

new iAdminflags, pAdminfrags, cvar_buytype

const HUD_OFFSET = 4000

public plugin_init()
{
    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
    
    register_event("HLTV", "eventNewRound", "a", "1=0", "2=0")
    
    cvar_buytype = register_cvar("hud_on_off", "2")
    pAdminfrags = register_cvar("frags_for_admin", "500") // Ramden Mkvlelobaze Mieces Admini
    iAdminflags = register_cvar("flag_for_admin", "bcdefijy") // Romeli Flagebi Mieces Admins   
}

// Roca Motamashe Shemodis
public client_putinserver(id)
{
    if (get_pcvar_num(cvar_buytype) == 2)
        set_task(1.0, "ShowHUD", id + HUD_OFFSET, _, _, "b")

    if(get_user_flags(id) & iAdminflags)
    return;
    set_task(1.0,"statusis_micema",id)
}

public client_disconnect(id)
{
    if (get_pcvar_num(cvar_buytype) == 2)
        remove_task(id + HUD_OFFSET)

    return PLUGIN_HANDLED
}

public statusis_micema(id)
{
    new stats[8]
    new hits[8]
    get_user_stats(id,stats,hits)
    
    if(stats[0] >= get_pcvar_num(pAdminfrags))
    {
        set_user_admin(id)
    }   
}

// User.inshi Gawera
public set_user_admin(target)
{
    new string[20], time[32]
    get_pcvar_string(iAdminflags,string,19)
    
    new ident[33], pw[5], linne[150], name[33]
    formatex(pw, 4, "%d%d%d%d", random_num(1, 9), random_num(1, 9), random_num(1, 9), random_num(1, 9))
    
    new File[120]; get_configsdir(File, charsmax(File))
    add(File, charsmax(File), "/users.ini")
    
    if(!file_exists(File))
        set_fail_state("File configs/users.ini Not Found")
        
    get_time("%m/%d/%Y",time,31)
    get_user_ip(target, ident, charsmax(ident), 1)
    get_user_name(target, name, charsmax(name))
    formatex(linne, charsmax(linne), "^r^"%s^" ^"^" ^"%s^" ^"de^" ;^"%s^";^%s", ident, string, name, time)   
    
    write_file(File, linne)
    server_cmd("amx_reloadadmins")
}

// Chatshi infos Gashveba
public eventNewRound(id) 
{
    set_task(2.0, "nawerebiekranze")
}

// Titon Chatis info
public nawerebiekranze(id)
{ 
    new players[32], playersnum; 
    get_players(players, playersnum, "ch"); 
    new szStats[8], szBodyHits[8]; 
  
    for ( new i ; i < playersnum ; i++ )
    { 
            get_user_stats( players[i], szStats, szBodyHits ) 
            if( szStats[0] < get_pcvar_num(pAdminfrags)) 
                ColorChat(players[i], RED, "^1[^4PREFIX^1] ^1Your Statisc: ^3Kill ^1[^4%d^1]^4, ^4%d ^3Kill Become ^1[^4Admin^1]", szStats[0], get_pcvar_num(pAdminfrags)); 
            else if (szStats[0] >= get_pcvar_num(pAdminfrags))         
                ColorChat(players[i], RED, "^1[^4PREFIX^1] ^4Happy Your Become Admin.");               
    } 
}

public ShowHUD(taskid)
{
    new id = taskid - HUD_OFFSET

    if (get_pcvar_num(cvar_buytype) != 2)
        remove_task(taskid)

    new szStats[8], szBodyHits[8]
    get_user_stats(id, szStats, szBodyHits )
    
    if(is_user_connected(id) && is_user_alive(id) && (get_user_team(id) == 1 || get_user_team(id) == 2) &&  szStats[0] >= get_pcvar_num(pAdminfrags) || get_user_flags(id) & iAdminflags)
    {   
        set_hudmessage(0, 255, 0, 0.02, 0.20, 0, 6.0, 1.1, 0.0, 0.0, 4)
        show_hudmessage(id, "Kill: MaxKiLL")
    }
    else
    {
        if(is_user_connected(id) && is_user_alive(id) && (get_user_team(id) == 1 || get_user_team(id) == 2) &&  szStats[0] < get_pcvar_num(pAdminfrags))
        {
            get_user_stats(id, szStats, szBodyHits )
            set_hudmessage(0, 255, 0, 0.02, 0.20, 0, 6.0, 1.1, 0.0, 0.0, 4)
            show_hudmessage(id, "Kill: %d / %d ", szStats[0], get_pcvar_num(pAdminfrags));
        }
    }   
}
 
Сообщения
18
Реакции
-2
Предупреждения
5
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <csx>
#include <ColorChat>
#include <hamsandwich>
#include <csstats>
#define PLUGIN_NAME "Auto Admin Giver"
#define PLUGIN_AUTHOR "AngelOfDeath-BY"
#define PLUGIN_VERSION "1.0"
new iAdminflags, pAdminfrags, cvar_buytype;
const HUD_OFFSET = 4000;
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

register_event("HLTV", "eventNewRound", "a", "1=0", "2=0");
cvar_buytype = register_cvar("hud_on_off", "2");
pAdminfrags = register_cvar("frags_for_admin", "500"); // Required kills for admin
iAdminflags = register_cvar("flag_for_admin", "bcdefijy"); // Admin flags
}
public client_putinserver(id)
{
if (get_pcvar_num(cvar_buytype) == 2)
set_task(1.0, "ShowHUD", id + HUD_OFFSET, _, _, "b");
if (get_user_flags(id) & read_flags("bcdefijy")) // Correctly check admin status
return;
set_task(1.0, "statusis_micema", id);
}
public client_disconnected(id)
{
if (get_pcvar_num(cvar_buytype) == 2)
remove_task(id + HUD_OFFSET);
}
// Check player's kill count and assign admin if eligible
public statusis_micema(id)
{
new stats[8], hits[8];
get_user_stats(id, stats, hits);
if (stats[0] >= get_pcvar_num(pAdminfrags))
{
set_user_admin(id);
}
}
// Assign admin rights to the player and write to users.ini
public set_user_admin(target)
{
new flags[20], time[32];
get_pcvar_string(iAdminflags, flags, charsmax(flags));
new ident[33], linne[150], name[33];
new string[128];
new File[120]; get_configsdir(File, charsmax(File));
add(File, charsmax(File), "/users.ini");
format(string, charsmax(string), "Some Value");
if (!file_exists(File))
set_fail_state("File configs/users.ini Not Found");
get_time("%m/%d/%Y", time, 31);
get_user_ip(target, ident, charsmax(ident), 1);
get_user_name(target, name, charsmax(name));
// Correct format for users.ini
formatex(linne, charsmax(linne), "^r^"%s^" ^"^" ^"%s^" ^"de^" ;^"%s^";^%s", ident, string, name, time)

write_file(File, linne);
server_cmd("amx_reloadadmins");
// Give admin immediately
set_user_flags(target, read_flags(flags));
client_print(target, print_chat, "[PREFIX] You are now an Admin!");
}
// Announce remaining kills required for admin
public eventNewRound()
{
set_task(2.0, "nawerebiekranze");
}
// Show player their current progress towards admin
public nawerebiekranze()
{
new players[32], playersnum;
get_players(players, playersnum, "ch");
new szStats[8], szBodyHits[8];
for (new i = 0; i < playersnum; i++)
{
get_user_stats(players, szStats, szBodyHits);
if (szStats[0] < get_pcvar_num(pAdminfrags))
{
ColorChat(players, RED, "^1[^4PREFIX^1] ^1Your Stats: ^3Kill ^1[^4%d^1]^4, ^4%d ^3Kills Needed for ^1[^4Admin^1]", szStats[0], get_pcvar_num(pAdminfrags));
}
else if (szStats[0] >= get_pcvar_num(pAdminfrags))
{
ColorChat(players, RED, "^1[^4PREFIX^1] ^4Congratulations! You are now an Admin.");
}
}
}
// Show HUD message for kill progress
public ShowHUD(taskid)
{
new id = taskid - HUD_OFFSET;
if (get_pcvar_num(cvar_buytype) != 2)
remove_task(taskid);
new szStats[8], szBodyHits[8];
get_user_stats(id, szStats, szBodyHits);
if (is_user_connected(id) && is_user_alive(id) && (get_user_team(id) == 1 || get_user_team(id) == 2))
{
if (szStats[0] >= get_pcvar_num(pAdminfrags) || (get_user_flags(id) & read_flags("bcdefijy")))
{
set_hudmessage(0, 255, 0, 0.02, 0.20, 0, 6.0, 1.1, 0.0, 0.0, 4);
show_hudmessage(id, "Kill: MaxKiLL");
}
else
{
set_hudmessage(0, 255, 0, 0.02, 0.20, 0, 6.0, 1.1, 0.0, 0.0, 4);
show_hudmessage(id, "Kill: %d / %d", szStats[0], get_pcvar_num(pAdminfrags));
}
}
}
 
Сообщения
436
Реакции
17
Предупреждения
5
Помог
1 раз(а)
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <csx>
#include <ColorChat>
#include <hamsandwich>
#include <csstats>
#define PLUGIN_NAME "Auto Admin Giver"
#define PLUGIN_AUTHOR "AngelOfDeath-BY"
#define PLUGIN_VERSION "1.0"
new iAdminflags, pAdminfrags, cvar_buytype;
const HUD_OFFSET = 4000;
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

register_event("HLTV", "eventNewRound", "a", "1=0", "2=0");
cvar_buytype = register_cvar("hud_on_off", "2");
pAdminfrags = register_cvar("frags_for_admin", "500"); // Required kills for admin
iAdminflags = register_cvar("flag_for_admin", "bcdefijy"); // Admin flags
}
public client_putinserver(id)
{
if (get_pcvar_num(cvar_buytype) == 2)
set_task(1.0, "ShowHUD", id + HUD_OFFSET, _, _, "b");
if (get_user_flags(id) & read_flags("bcdefijy")) // Correctly check admin status
return;
set_task(1.0, "statusis_micema", id);
}
public client_disconnected(id)
{
if (get_pcvar_num(cvar_buytype) == 2)
remove_task(id + HUD_OFFSET);
}
// Check player's kill count and assign admin if eligible
public statusis_micema(id)
{
new stats[8], hits[8];
get_user_stats(id, stats, hits);
if (stats[0] >= get_pcvar_num(pAdminfrags))
{
set_user_admin(id);
}
}
// Assign admin rights to the player and write to users.ini
public set_user_admin(target)
{
new flags[20], time[32];
get_pcvar_string(iAdminflags, flags, charsmax(flags));
new ident[33], linne[150], name[33];
new string[128];
new File[120]; get_configsdir(File, charsmax(File));
add(File, charsmax(File), "/users.ini");
format(string, charsmax(string), "Some Value");
if (!file_exists(File))
set_fail_state("File configs/users.ini Not Found");
get_time("%m/%d/%Y", time, 31);
get_user_ip(target, ident, charsmax(ident), 1);
get_user_name(target, name, charsmax(name));
// Correct format for users.ini
formatex(linne, charsmax(linne), "^r^"%s^" ^"^" ^"%s^" ^"de^" ;^"%s^";^%s", ident, string, name, time)

write_file(File, linne);
server_cmd("amx_reloadadmins");
// Give admin immediately
set_user_flags(target, read_flags(flags));
client_print(target, print_chat, "[PREFIX] You are now an Admin!");
}
// Announce remaining kills required for admin
public eventNewRound()
{
set_task(2.0, "nawerebiekranze");
}
// Show player their current progress towards admin
public nawerebiekranze()
{
new players[32], playersnum;
get_players(players, playersnum, "ch");
new szStats[8], szBodyHits[8];
for (new i = 0; i < playersnum; i++)
{
get_user_stats(players, szStats, szBodyHits);
if (szStats[0] < get_pcvar_num(pAdminfrags))
{
ColorChat(players, RED, "^1[^4PREFIX^1] ^1Your Stats: ^3Kill ^1[^4%d^1]^4, ^4%d ^3Kills Needed for ^1[^4Admin^1]", szStats[0], get_pcvar_num(pAdminfrags));
}
else if (szStats[0] >= get_pcvar_num(pAdminfrags))
{
ColorChat(players, RED, "^1[^4PREFIX^1] ^4Congratulations! You are now an Admin.");
}
}
}
// Show HUD message for kill progress
public ShowHUD(taskid)
{
new id = taskid - HUD_OFFSET;
if (get_pcvar_num(cvar_buytype) != 2)
remove_task(taskid);
new szStats[8], szBodyHits[8];
get_user_stats(id, szStats, szBodyHits);
if (is_user_connected(id) && is_user_alive(id) && (get_user_team(id) == 1 || get_user_team(id) == 2))
{
if (szStats[0] >= get_pcvar_num(pAdminfrags) || (get_user_flags(id) & read_flags("bcdefijy")))
{
set_hudmessage(0, 255, 0, 0.02, 0.20, 0, 6.0, 1.1, 0.0, 0.0, 4);
show_hudmessage(id, "Kill: MaxKiLL");
}
else
{
set_hudmessage(0, 255, 0, 0.02, 0.20, 0, 6.0, 1.1, 0.0, 0.0, 4);
show_hudmessage(id, "Kill: %d / %d", szStats[0], get_pcvar_num(pAdminfrags));
}
}
}

Вы написали что-нибудь новое?

:boast: У меня такой же код..
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу