Вот может кому-то понадобится, но плагин ещё не доработан, а именно 2 последних функции.
Код:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <colorchat>
#define PLUGIN "AdminElite"
#define VERSION "1.0"
#define AUTHOR "-NegaTiV-"
new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MEN
U_KEY_9|MENU_KEY_0
new Gravity[33], Speed[33], Bunny_Hop[33], Rendering[33], Through[33], szTwoJump[33], szTwoJumpNum[33], szDoTwoJump[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_menu("Menu 1", keys, "func_menu")
register_clcmd("super_admin_menu", "AdminMenu")
RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
RegisterHam(Ham_Player_Jump, "player", "PreTwoJump")
}
public player_spawn(id)
{
if(is_user_connected(id) & is_user_alive(id))
{
Gravity[id] = true
Speed[id] = true
szTwoJump[id] = false
Bunny_Hop[id] = false
Rendering[id] = true
Through[id] = true
}
}
public AdminMenu(id)
{
static menu[650], len
len = 0
// Меню элитного администратора
len += formatex(menu[len], charsmax(menu) - len, "\r[\yAdminMenu\r] \wРазвлекательное меню^n^n")
if(get_user_flags(id) & ADMIN_IMMUNITY)
{
if(Gravity[id])
{
len += formatex(menu[len], charsmax(menu) - len, "\r1. \wГравитация: \rВыкл^n")
keys |= MENU_KEY_1
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r1. \wГравитация: \yВкл^n")
keys |= MENU_KEY_1
}
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r1. \dГравитация: \rВыкл^n")
keys &= ~MENU_KEY_1
}
if(get_user_flags(id) & ADMIN_IMMUNITY)
{
if(Speed[id])
{
len += formatex(menu[len], charsmax(menu) - len, "\r2. \wСкорость: \rВыкл^n")
keys |= MENU_KEY_2
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r2. \wСкорость: \yВкл^n")
keys |= MENU_KEY_2
}
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r1. \dСкорость: \rВыкл^n")
keys &= ~MENU_KEY_2
}
if(get_user_flags(id) & ADMIN_IMMUNITY)
{
if(szTwoJump[id])
{
len += formatex(menu[len], charsmax(menu) - len, "\r3. \wДвойной прыжок: \yВкл^n")
keys |= MENU_KEY_3
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r3. \wДвойной прыжок: \rВыкл^n")
keys |= MENU_KEY_3
}
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r3. \dДвойной прыжок: \rВыкл^n")
keys &= ~MENU_KEY_3
}
if(get_user_flags(id) & ADMIN_IMMUNITY)
{
if(Bunny_Hop[id])
{
len += formatex(menu[len], charsmax(menu) - len, "\r4. \wРаспрыжка: \yВкл^n")
keys |= MENU_KEY_4
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r4. \wРаспрыжка: \rВыкл^n")
keys |= MENU_KEY_4
}
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r4. \dРаспрыжка: \rВыкл^n")
keys &= ~MENU_KEY_4
}
if(get_user_flags(id) & ADMIN_IMMUNITY)
{
if(Rendering[id])
{
len += formatex(menu[len], charsmax(menu) - len, "\r5. \wНевидимость: \rВыкл^n")
keys |= MENU_KEY_5
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r5. \wНевидимость: \yВкл^n")
keys |= MENU_KEY_5
}
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r1. \dНевидимость: \rВыкл^n")
keys &= ~MENU_KEY_5
}
if(get_user_flags(id) & ADMIN_IMMUNITY)
{
if(Through[id])
{
len += formatex(menu[len], charsmax(menu) - len, "\r6. \wСквозь стены: \rВыкл^n")
keys |= MENU_KEY_6
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r6. \wСквозь стены: \yВкл^n")
keys |= MENU_KEY_6
}
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r6. \dСквозь стены: \rВыкл^n")
keys &= ~MENU_KEY_6
}
len += formatex(menu[len], charsmax(menu) - len, "\r7. \wПодарочное меню^n^n")
keys |= MENU_KEY_7
len += formatex(menu[len], charsmax(menu) - len, "\r9. \wНазад^n")
keys |= MENU_KEY_9
len += formatex(menu[len], charsmax(menu) - len, "\r0. \wВыход")
keys |= MENU_KEY_0
show_menu(id, keys, menu, -1, "Menu 1")
return PLUGIN_HANDLED;
}
public func_menu(id, key)
{
new name[33]
get_user_name(id, name, 31)
switch(key)
{
case 0:{
if(Gravity[id])
{
Gravity[id] = false
set_user_gravity(id, 0.5)
ColorChat(id, NORMAL, "^1[^4Knife^1] ^3Элитный Админ ^4%s ^3включил ^4Гравитацию", name)
AdminMenu(id)
return PLUGIN_CONTINUE;
} else {
Gravity[id] = true
set_user_gravity(id, 1.0)
ColorChat(id, NORMAL, "^1[^4Knife^1] ^3Элитный Админ ^4%s ^3выключил ^4Гравитацию", name)
AdminMenu(id)
return PLUGIN_CONTINUE;
}
}
case 1:{
if(Speed[id])
{
Speed[id] = false
set_user_maxspeed(id, 320.0)
ColorChat(id, NORMAL, "^1[^4Knife^1] ^3Элитный Админ ^4%s ^3включил ^4Скорость", name)
AdminMenu(id)
return PLUGIN_CONTINUE;
} else {
Speed[id] = true
set_user_maxspeed(id, 250.0)
ColorChat(id, NORMAL, "^1[^4Knife^1] ^3Элитный Админ ^4%s ^3выключил ^4Скорость", name)
AdminMenu(id)
return PLUGIN_CONTINUE;
}
}
case 2:{
if(szTwoJump[id])
{
szTwoJump[id] = false
ColorChat(id, NORMAL, "^1[^4Knife^1] ^3Элитный Админ ^4%s ^3выключил ^4Двойной прыжок", name)
AdminMenu(id)
return PLUGIN_CONTINUE;
} else {
szTwoJump[id] = true
ColorChat(id, NORMAL, "^1[^4Knife^1] ^3Элитный Админ ^4%s ^3включил ^4Двойной прыжок", name)
AdminMenu(id)
return PLUGIN_CONTINUE;
}
}
case 3:{
if(Bunny_Hop[id])
{
Bunny_Hop[id] = false
ColorChat(id, NORMAL, "^1[^4Knife^1] ^3Элитный Админ ^4%s ^3выключил ^4Распрыжку", name)
AdminMenu(id)
return PLUGIN_CONTINUE;
} else {
Bunny_Hop[id] = true
ColorChat(id, NORMAL, "^1[^4Knife^1] ^3Элитный Админ ^4%s ^3включил ^4Распрыжку", name)
AdminMenu(id)
return PLUGIN_CONTINUE;
}
}
}
return PLUGIN_HANDLED;
}
public PreTwoJump(id)
{
if(szTwoJump[id] && get_user_weapon(id) == CSW_KNIFE)
{
new szButton = pev(id, pev_button)
new szOldButton = pev(id, pev_oldbuttons)
if((szButton & IN_JUMP) && !(pev(id, pev_flags) & FL_ONGROUND) && !(szOldButton & IN_JUMP))
{
if(szTwoJumpNum[id] < 1)
{
szDoTwoJump[id] = true
szTwoJumpNum[id]++
PostTwoJump(id)
return PLUGIN_CONTINUE
}
}
if((szButton & IN_JUMP) && (pev(id, pev_flags) & FL_ONGROUND))
{
szTwoJumpNum[id] = 0
}
}
return PLUGIN_CONTINUE
}
public PostTwoJump(id)
{
if(szTwoJump[id])
{
if(!is_user_alive(id))
return PLUGIN_CONTINUE
if(szDoTwoJump[id])
{
new Float:szVelocity[3]
pev(id, pev_velocity, szVelocity)
szVelocity[2] = random_float(295.0,305.0)
set_pev(id, pev_velocity, szVelocity)
szDoTwoJump[id] = false
return PLUGIN_CONTINUE
}
}
return PLUGIN_CONTINUE
}
public client_PreThink(id)
{
entity_set_float(id, EV_FL_fuser2, 0.0)
if(entity_get_int(id, EV_INT_button) & 2)
{
new flags = entity_get_int(id, EV_INT_flags)
if(flags & FL_WATERJUMP)
return PLUGIN_CONTINUE
if(entity_get_int(id, EV_INT_waterlevel) >= 2)
return PLUGIN_CONTINUE
if(!(flags & FL_ONGROUND))
return PLUGIN_CONTINUE
new Float:vecVelocity[3]
entity_get_vector(id, EV_VEC_velocity, vecVelocity)
if(Bunny_Hop[id])
vecVelocity[2] += 250.0
entity_set_vector(id, EV_VEC_velocity, vecVelocity)
entity_set_int(id, EV_INT_gaitsequence, 6)
}
return PLUGIN_CONTINUE
}