PHP Code:
#include amxmodx
#include amxmisc
#include fakemeta
#include cstrike
const ACCES_VIP = ADMIN_LEVEL_H
#define LIMITS 2
const KEYSMENU = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5
new bool:noflash[33]
new limit[33]
new bool:hasgravity[33]
public plugin_init()
{
register_event("HLTV", "newround", "a", "1=0", "2=0")
register_clcmd("say /vipmenu", "show_menu_vip")
register_menu("Vip Menu", KEYSMENU, "vip_menu")
register_concmd("vip_menu", "show_menu_vip")
register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199")
}
public newround(){
for(new id = 1; id <= get_maxplayers(); id++)
{
if(get_user_flags(id) & ACCES_VIP)
{
limit[id] = 0
noflash[id] = false
hasgravity[id] = false
}
}
}
public eventFlash(id)
{
if(is_user_connected(id) && noflash[id] == true && get_user_flags(id) & ACCES_VIP)
{
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1)
write_short(1)
write_short(1)
write_byte(0)
write_byte(0)
write_byte(0)
write_byte(255)
message_end()
}
}
public show_menu_vip(id)
{
static menu[255], len
len = 0
len += formatex(menu[len], charsmax(menu) - len, "\yVIP MENU | You is: %s^n^n", get_user_flags(id) & ACCES_VIP ? "VIP Member" : "Simple Player")
if(get_user_flags(id) & ACCES_VIP)
{
len += formatex(menu[len], charsmax(menu) - len, "\r1.\w 10HitPoints^n")
len += formatex(menu[len], charsmax(menu) - len, "\r2.\w 10Armour^n")
if(hasgravity[id] == false)
len += formatex(menu[len], charsmax(menu) - len, "\r3.\w Gravity 700^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\r3.\d Gravity 700^n")
if(noflash[id] == false)
len += formatex(menu[len], charsmax(menu) - len, "\r4.\w No Flash^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\r4.\d No Flash^n")
len += formatex(menu[len], charsmax(menu) - len, "\r5.\w 250$^n^n")
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\r1.\d 10HitPoints^n")
len += formatex(menu[len], charsmax(menu) - len, "\r2.\d 10Armour^n")
len += formatex(menu[len], charsmax(menu) - len, "\r3.\d Gravity 700^n")
len += formatex(menu[len], charsmax(menu) - len, "\r4.\d No Flash^n")
len += formatex(menu[len], charsmax(menu) - len, "\r5.\d 250$^n^n")
}
len += formatex(menu[len], charsmax(menu) - len, "^n^n\r0.\w Exit")
show_menu(id, KEYSMENU, menu, -1, "Vip Menu")
}
public vip_menu(id, key)
{
if(limit[id] >= LIMITS)
{
client_print(id, print_chat, "You can use a VIP Member privileges just %d times on round", LIMITS)
return;
}
if(get_user_flags(id) & ACCES_VIP)
{
switch (key)
{
case 0: {fm_set_user_health(id, pev(id, pev_health) + 10)
limit[id]++
}
case 1: {set_pev(id, pev_armorvalue, 10.0)
limit[id]++
}
case 2: { if(hasgravity[id] == true)
return;
set_pev(id, pev_gravity, 0.7)
hasgravity[id] = true
limit[id]++
}
case 3: {
if(noflash[id] == true)
return;
noflash[id] = true
limit[id]++
}
case 4: {cs_set_user_money(id, cs_get_user_money(id) + 250)
limit[id]++
}
}
}
}
stock fm_set_user_health(index, health)
{
(health > 0) ? set_pev(index, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, index)
}