Участник
Пользователь
- Сообщения
- 436
- Реакции
- 17
- Предупреждения
- 5
- Помог
- 1 раз(а)
Неверный раздел форума
X KILL Give Admin
Who can update the code?
It's hard to 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));
}
}
}