Senior Member
Join Date: Feb 2012
Location: Serbia
|
04-09-2012
, 15:25
Re: VIP Menu for ZP 4.3Fix5a
|
#44
|
Quote:
Originally Posted by n1x0n
MercedesSx7 , i use your post , and new natives , and i can't compile again.
|
ohh .. sorry .. here
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
#include <zombieplague>
// Vip Access flag
#define STALVIPACCESS ADMIN_LEVEL_H
const MENU_KEY_AUTOSELECT = 7
const MENU_KEY_BACK = 7
const MENU_KEY_NEXT = 8
const MENU_KEY_EXIT = 9
// Menu keys
const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
//----------------
// Skin Menu Items
// Skin ID
new g_has_skin[33]
// Enable Skin
new g_enable_skin[33]
// skin list : vip players
static const VIP_SKIN1[] = "Darkness7_vip1"
static const VIP_SKIN2[] = "Darkness7_vip2"
// skin list : admin player
static const VIP_SKIN3[] = "Darkness7_admin"
// Skin Menu Items
//----------------
//-----------------------------
// Invisible ability items
// human invisible
new g_human_invisible[33]
new g_human_invisible_timer[33]
// zombie invisible
new g_zombie_invisible[33]
new g_zombie_invisible_timer[33]
// Invisible ability items
//-----------------------------
//-----------------------------
// Bonus menu variable
new g_bmenu_used_human[33]
new g_bmenu_used_zombie[33]
// Bonus menu variable
//-----------------------------
// Cvars register
//-----------------------------
new g_vipspeed, g_viphealth
//-----------------------------
// Cvars register
// Sync hud message variable
new g_MsgSync_svm
new id_killer
new maxplayers
#define is_user_valid(%1) (1 <= %1 <= maxplayers)
public plugin_init()
{
// Register plugin
register_plugin( "[ZP] ViP Menu", "1.35", "Dare-Devil" )
// Cmd Case
register_clcmd("vipmenu", "cmd_stayalive_vipmenu")
register_clcmd("say /vipmenu", "cmd_stayalive_vipmenu")
// Event Case
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
register_event("DeathMsg", "death_message", "a", "1>0")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
// Cvar Case
g_vipspeed = register_cvar("zp_vip_speed", "265")
g_viphealth = register_cvar("zp_vip_health", "250")
// Menus Case
register_menu("StayAlive ViP Menu", KEYSMENU, "menu_mainvipmenu")
register_menu("ViP Skin Menu", KEYSMENU, "menu_vipskinmenu")
register_menu("Page2 ViPSkinMenu", KEYSMENU, "menu_page2vipskinmenu")
register_menu("humanbonus", KEYSMENU, "menu_bhuman")
register_menu("zombiebonus", KEYSMENU, "menu_bzombie")
maxplayers = get_maxplayers()
g_MsgSync_svm = CreateHudSyncObj()
}
// Precache vip models
public plugin_precache()
{
engfunc(EngFunc_PrecacheModel, "models/player/Darkness7_vip1/Darkness7_vip1.mdl")
engfunc(EngFunc_PrecacheModel, "models/player/Darkness7_vip2/Darkness7_vip2.mdl")
engfunc(EngFunc_PrecacheModel, "models/player/Darkness7_admin/Darkness7_admin.mdl")
}
// Vip Speed
public fw_PlayerPreThink(id)
{
if (!is_user_alive(id))
return FMRES_IGNORED
if (zp_get_user_zombie(id))
return FMRES_IGNORED
if(get_user_flags(id) & STALVIPACCESS)
{
if (!zp_get_user_survivor(id))
{
set_pev(id, pev_maxspeed, get_pcvar_float(g_vipspeed))
}
}
return PLUGIN_CONTINUE
}
public death_message()
{
id_killer = read_data(1)
if (get_user_flags(id_killer) & STALVIPACCESS)
{
if(!zp_get_user_zombie(id_killer))
{
if((1<=id_killer<=maxplayers) && is_user_connected(id_killer) && is_user_valid(id_killer) && is_user_alive(id_killer))
{
set_pev(id_killer, pev_armorvalue, float(min(pev(id_killer, pev_armorvalue)+5, 999)))
set_hudmessage(150, 150, 150, 0.75, -1.0, 1, 0.5, 0.5, 1.0, 1.0, -1)
ShowSyncHudMsg(id_killer, g_MsgSync_svm, " +5 Armor^n +25 HP^n +1 Ammo Packs")
set_user_health(id_killer, get_user_health(id_killer)+25)
}
}
}
}
public client_connect(id)
{
g_bmenu_used_human[id] = true
g_bmenu_used_zombie[id] = true
g_human_invisible[id] = false
g_human_invisible_timer[id] = 1
g_zombie_invisible[id] = false
g_zombie_invisible_timer[id] = 1
g_has_skin[id] = 0
g_enable_skin[id] = 0
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
new name[100]
get_user_name(id, name, 100)
set_hudmessage(225, 225, 0, -1.0, 0.05, 1, 0.5, 0.5, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync_svm, "ViP %s Joined The Dark Angels!", name)
static Value_s[32]
static const Info_s[] = "_skin"
get_user_info(id, Info_s, Value_s, charsmax(Value_s))
if (Info_s[id] == 1)
{
g_has_skin[id] = 1
g_enable_skin[id] = 1
}
else if (Info_s[id] == 2)
{
g_has_skin[id] = 2
g_enable_skin[id] = 1
}
else if (Info_s[id] == 2)
{
g_has_skin[id] = 3
g_enable_skin[id] = 1
}
}
}
public event_round_start()
{
new id
for (id = 1; id <= get_maxplayers(); id++)
{
g_bmenu_used_human[id] = true
g_bmenu_used_zombie[id] = true
g_human_invisible[id] = false
g_zombie_invisible[id] = false
set_task( 0.1 , "Bhuman_invisible_timer", id)
set_task( 0.1 , "Bzombie_invisible_timer", id)
}
}
public cmd_stayalive_vipmenu(id)
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
// Make Action
show_menu_mainvipmenu(id)
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
public fwHamPlayerSpawnPost(id)
{
if (get_user_flags(id) & STALVIPACCESS)
{
if((1<=id<=maxplayers) && is_user_connected(id) && is_user_valid(id) && is_user_alive(id))
{
if(!zp_get_user_zombie(id))
{
if(g_has_skin[id] != 0)
{
set_task(1.5, "change_skin", id)
}
// Give nightvision
zp_set_user_nightvision(id, true)
static hp_add
hp_add = get_user_health(id)
hp_add + get_pcvar_float(g_viphealth)
set_user_health(id, hp_add)
}
}
}
}
// Set ViP Skins
public change_skin(id)
{
if(!zp_get_user_zombie(id) && !zp_get_user_survivor(id))
{
if(g_has_skin[id] == 1)
{
zp_set_user_model(id, VIP_SKIN1)
}
else if(g_has_skin[id] == 2)
{
zp_set_user_model(id, VIP_SKIN2)
}
else if(g_has_skin[id] == 3)
{
zp_set_user_model(id, VIP_SKIN3)
}
}
}
// Stay Alive Main Vip Menu
show_menu_mainvipmenu(id)
{
static menu[250], len, userflags
len = 0
userflags = get_user_flags(id)
len += formatex(menu[len], charsmax(menu) - len, "\r*Darkness Pain* v3.1.0 | ViP Menu^n^n")
// 1. ViP Extra items
if (userflags & STALVIPACCESS)
len += formatex(menu[len], charsmax(menu) - len, "\r1.\w ViP: Extra items^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\d1. ViP: Extra items^n")
// 2. ViP Skin Menu
if (userflags & STALVIPACCESS)
len += formatex(menu[len], charsmax(menu) - len, "\r2.\w ViP: Skin Menu^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\d2. ViP: Skin Menu^n")
// 3. ViP Bonus items (Human)
if (userflags & STALVIPACCESS)
{
if(g_bmenu_used_human[id])
{
if(!zp_get_user_zombie(id))
{
len += formatex(menu[len], charsmax(menu) - len, "\r3.\w ViP: Bonus items [Human]^n")
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\d3. ViP: Bonus items [Human]^n")
}
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\d3. ViP: Bonus items [Human]^n")
}
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\d3. ViP: Bonus items [Human]^n")
}
// 4. ViP Bonus Items (Zombie)
if (userflags & STALVIPACCESS)
{
if(g_bmenu_used_zombie[id])
{
if(zp_get_user_zombie(id))
{
len += formatex(menu[len], charsmax(menu) - len, "\r4.\w ViP: Bonus Items [Zombie]^n")
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\d4. ViP: Bonus Items [Zombie]^n")
}
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\d4. ViP: Bonus Items [Zombie]^n")
}
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\d4. ViP: Bonus Items [Zombie]^n")
}
// 5. ViP Buy Ammo Packs
if (userflags & STALVIPACCESS)
len += formatex(menu[len], charsmax(menu) - len, "\r5.\w ViP: Buy Ammo Packs^n^n^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\d5. ViP: Buy Ammo Packs^n^n^n")
// 8. Back
len += formatex(menu[len], charsmax(menu) - len, "\r8.\w Back^n", id, "MENU_BACK")
// 0. Exit
len += formatex(menu[len], charsmax(menu) - len, "\r0.\w Exit", id, "MENU_EXIT")
show_menu(id, KEYSMENU, menu, -1, "StayAlive ViP Menu")
}
// Oblivion ViP Skin menu
show_menu_vipskinmenu(id)
{
static menu[512], len, userflags
len = 0
userflags = get_user_flags(id)
len += formatex(menu[len], charsmax(menu) - len, "\r*Darkness Pain* v3.1.0 | Skin Menu\w Page 1/2^n^n")
len += formatex(menu[len], charsmax(menu) - len, "\rNB: Skin menu dont work right now!^n^n")
// 1. Vip Skin 1
if (userflags & STALVIPACCESS)
{
if (g_has_skin[id] == 1)
{
len += formatex(menu[len], charsmax(menu) - len, "\d1. Dark Elf^n")
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\r1.\w Dark Elf^n")
}
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\d1. Dark Elf^n")
}
// 2. Vip Skin 2
if (userflags & STALVIPACCESS)
{
if (g_has_skin[id] == 2)
{
len += formatex(menu[len], charsmax(menu) - len, "\d2. ViP Smith^n")
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\r2.\w ViP Smith^n")
}
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\d2. ViP Smith^n")
}
// 3. Vip Skin 3
if (userflags & STALVIPACCESS)
{
if (g_has_skin[id] == 3)
{
len += formatex(menu[len], charsmax(menu) - len, "\d3. Blue Wings Admin^n")
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\w3.\d Blue Wings Admin^n")
}
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\d3. Empty Spot^n")
}
// 4. Admin Skin
if (userflags & STALVIPACCESS)
{
if (g_has_skin[id] == 4)
{
len += formatex(menu[len], charsmax(menu) - len, "\r4. Error!^n^n")
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\r4.\r Error!^n^n")
}
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\r4. Error!^n^n")
}
// 7. Remember the skin
if (g_enable_skin[id] == 1)
len += formatex(menu[len], charsmax(menu) - len, "\r7.\w Remember Skin [Enabled]^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\r7.\w Remember Skin [Disabled]^n")
// 8. Back
len += formatex(menu[len], charsmax(menu) - len, "\r8.\w Back^n")
// 9. Next
len += formatex(menu[len], charsmax(menu) - len, "\r9.\w Next^n")
// 0. Exit
len += formatex(menu[len], charsmax(menu) - len, "\r0.\w Exit", id, "MENU_EXIT")
show_menu(id, KEYSMENU, menu, -1, "ViP Skin Menu")
}
// Oblivion ViP Skin menu
show_menu_page2vipskinmenu(id)
{
static menu[512], len, userflags
len = 0
userflags = get_user_flags(id)
len += formatex(menu[len], charsmax(menu) - len, "\r*Darkness Pain* v3.1.0 | Skin Menu\w Page 2/2^n^n")
len += formatex(menu[len], charsmax(menu) - len, "\rNB: Skin menu dont work right now!^n^n")
// 1. player skin 1
if (userflags & STALVIPACCESS)
{
if (g_has_skin[id] == 5)
{
len += formatex(menu[len], charsmax(menu) - len, "\r1. Error!^n")
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\r1.\w Error!^n")
}
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\r1. Error!^n")
}
// 2. player skin 2
if (userflags & STALVIPACCESS)
{
if (g_has_skin[id] == 6)
{
len += formatex(menu[len], charsmax(menu) - len, "\r2. Error!^n")
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\r2.\r Error!^n")
}
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\d2. Error!^n")
}
// 3. player skin 3
if (userflags & STALVIPACCESS)
{
if (g_has_skin[id] == 7)
{
len += formatex(menu[len], charsmax(menu) - len, "\r3. Error!^n")
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\r3.\r Error!^n")
}
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\r3. Error!^n")
}
// 4. player skin 4
if (userflags & STALVIPACCESS)
{
if (g_has_skin[id] == 8)
{
len += formatex(menu[len], charsmax(menu) - len, "\r4. Error!^n^n")
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\r4.\r Error!^n^n")
}
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\r4. Error!^n^n")
}
// 7. Remember the skin
if (g_enable_skin[id] == 1)
len += formatex(menu[len], charsmax(menu) - len, "\r7.\w Remember Skin [Enabled]^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\r7.\w Remember Skin [Disabled]^n")
// 8. Back
len += formatex(menu[len], charsmax(menu) - len, "\r8.\w Back^n")
// 0. Exit
len += formatex(menu[len], charsmax(menu) - len, "\r0.\w Exit", id, "MENU_EXIT")
show_menu(id, KEYSMENU, menu, -1, "Page2 ViPSkinMenu")
}
// HUMAN Bonus Menu
show_menu_bhuman(id)
{
static menu[250], len, userflags
len = 0
userflags = get_user_flags(id)
len += formatex(menu[len], charsmax(menu) - len, "\r*Darkness Pain* v3.1.0 | Human Bonus Menu^n^n")
// 1. +1500HP
if (userflags & STALVIPACCESS)
len += formatex(menu[len], charsmax(menu) - len, "\r1.\w +1500 Health^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\d1. +1500 Health^n")
// 2. +200Armor
if (userflags & STALVIPACCESS)
len += formatex(menu[len], charsmax(menu) - len, "\r2.\w +200 Armor^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\d2. +200 Armor^n")
// 3. +5 Gravity
if (userflags & STALVIPACCESS)
len += formatex(menu[len], charsmax(menu) - len, "\r3.\w +5 Gravity^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\d3. +5 Gravity^n")
// 4. 60 Sec Invisible
if (userflags & STALVIPACCESS)
len += formatex(menu[len], charsmax(menu) - len, "\r4.\w 60Sec Invisible^n^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\d4. 60Sec Invisible^n^n")
// 8. Back
len += formatex(menu[len], charsmax(menu) - len, "\r8.\w Back^n", id, "MENU_BACK")
// 0. Exit
len += formatex(menu[len], charsmax(menu) - len, "\r0.\w Exit", id, "MENU_EXIT")
show_menu(id, KEYSMENU, menu, -1, "humanbonus")
}
// ZOMBIE Bonus Menu
show_menu_bzombie(id)
{
static menu[250], len, userflags
len = 0
userflags = get_user_flags(id)
len += formatex(menu[len], charsmax(menu) - len, "\r*Darkness Pain* v3.1.0 | Human Bonus Menu^n^n")
// 1. +10000HP
if (userflags & STALVIPACCESS)
len += formatex(menu[len], charsmax(menu) - len, "\r1.\w +10000 Health^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\d1. +10000 Health^n")
// 2. +8 Gravity
if (userflags & STALVIPACCESS)
len += formatex(menu[len], charsmax(menu) - len, "\r2.\w +8 Gravity^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\d2. +8 Gravity^n")
// 3. +600Armor
if (userflags & STALVIPACCESS)
len += formatex(menu[len], charsmax(menu) - len, "\r3.\w +600Armor^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\d3. +600Armor^n")
// 4. 20 Sec Invisible
if (userflags & STALVIPACCESS)
len += formatex(menu[len], charsmax(menu) - len, "\r4.\w 20Sec Invisible^n^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\d4. 20Sec Invisible^n^n")
// 8. Back
len += formatex(menu[len], charsmax(menu) - len, "\r8.\w Back^n", id, "MENU_BACK")
// 0. Exit
len += formatex(menu[len], charsmax(menu) - len, "\r0.\w Exit", id, "MENU_EXIT")
show_menu(id, KEYSMENU, menu, -1, "zombiebonus")
}
// ViP main Menu
public menu_mainvipmenu(id, key)
{
switch (key)
{
case 0: // 1. ViP Extra items
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
// Make Action
client_cmd(id, "vipextraitems")
else
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
case 1: // 2. ViP Skin Menu
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
// Make Action
show_menu_vipskinmenu(id)
else
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
case 2: // 3. ViP Bonus items (Human)
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(g_bmenu_used_human[id])
{
if(!zp_get_user_zombie(id))
{
// Make Action
show_menu_bhuman(id)
}
else
{
show_menu_mainvipmenu(id)
client_print(id, print_chat,"[ZP] Zombies cant use this menu!");
}
}
else
{
show_menu_mainvipmenu(id)
client_print(id, print_chat,"[ZP] You can only use this one time on round.");
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 3: // 4. ViP Bonus Items (Zombie)
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(g_bmenu_used_zombie[id])
{
if(zp_get_user_zombie(id))
{
// Make Action
show_menu_bzombie(id)
}
else
{
show_menu_mainvipmenu(id)
client_print(id, print_chat,"[ZP] Humans cant use this menu!");
}
}
else
{
show_menu_mainvipmenu(id)
client_print(id, print_chat,"[ZP] You can only use this one time on round.");
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 4: // 5. BuyAp
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
// Make Action
client_cmd(id, "say /buyap")
else
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
case 7: // 8. Back
{
client_cmd(id, "zpmenu")
}
}
return PLUGIN_HANDLED;
}
// Vip Skin Menu
public menu_vipskinmenu(id, key)
{
switch (key)
{
case 0: // 1. Vip Skin 1
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(!zp_get_user_zombie(id) && !zp_get_user_survivor(id))
{
if (g_enable_skin[id] == 1)
{
zp_set_user_model(id, VIP_SKIN1)
client_cmd(id, "setinfo _skin 1")
client_print(id, print_chat,"[ZP] You have choosen ViP skin: Vip Skin 1");
g_has_skin[id] = 1
show_menu_vipskinmenu(id)
}
else
{
zp_set_user_model(id, VIP_SKIN1)
client_cmd(id, "setinfo _skin 0")
client_print(id, print_chat,"[ZP] You have choosen ViP skin: Vip Skin 1");
g_has_skin[id] = 1
show_menu_vipskinmenu(id)
}
}
else
{
client_print(id, print_chat,"[ZP] Zombies, Survivors and Snipers cant change skin!");
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 1: // 2. Vip Skin 2
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(!zp_get_user_zombie(id) && !zp_get_user_survivor(id))
{
if (g_enable_skin[id] == 1)
{
zp_set_user_model(id, VIP_SKIN2)
client_cmd(id, "setinfo _skin 2")
client_print(id, print_chat,"[ZP] You have choosen ViP skin: Vip Skin 2");
g_has_skin[id] = 2
show_menu_vipskinmenu(id)
}
else
{
zp_set_user_model(id, VIP_SKIN2)
client_cmd(id, "setinfo _skin 0")
client_print(id, print_chat,"[ZP] You have choosen ViP skin: Vip Skin 2");
g_has_skin[id] = 2
show_menu_vipskinmenu(id)
}
}
else
{
client_print(id, print_chat,"[ZP] Zombies, Survivors and Snipers cant change skin!");
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 2: // 3. Vip Skin 3
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(!zp_get_user_zombie(id) && !zp_get_user_survivor(id))
{
if (g_enable_skin[id] == 1)
{
zp_set_user_model(id, VIP_SKIN2)
client_cmd(id, "setinfo _skin 3")
client_print(id, print_chat,"[ZP] You have choosen ViP skin: Admin Skin 1");
g_has_skin[id] = 2
show_menu_vipskinmenu(id)
}
else
{
zp_set_user_model(id, VIP_SKIN2)
client_cmd(id, "setinfo _skin 0")
client_print(id, print_chat,"[ZP] You have choosen ViP skin: Admin Skin 1");
g_has_skin[id] = 2
show_menu_vipskinmenu(id)
}
}
else
{
client_print(id, print_chat,"[ZP] Zombies, Survivors and Snipers cant change skin!");
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 3: // 4. Admin Skin
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(!zp_get_user_zombie(id) && !zp_get_user_survivor(id))
{
if (g_enable_skin[id] == 1)
{
zp_set_user_model(id, VIP_SKIN3)
client_cmd(id, "setinfo _skin 3")
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 4");
g_has_skin[id] = 3
show_menu_vipskinmenu(id)
}
else
{
zp_set_user_model(id, VIP_SKIN3)
client_cmd(id, "setinfo _skin 0")
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 4");
g_has_skin[id] = 3
show_menu_vipskinmenu(id)
}
}
else
{
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 4");
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 6: // 7. Rembember Skin
{
if (g_enable_skin[id] == 1)
{
client_print(id, print_chat,"[ZP] You Disabled Remember Skin Option!");
g_enable_skin[id] = 0
client_cmd(id, "setinfo _skin 0")
show_menu_vipskinmenu(id)
}
else
{
client_print(id, print_chat,"[ZP] You Enabled Remember Skin Option, Skin stay now in ohter maps.");
g_enable_skin[id] = 1
show_menu_vipskinmenu(id)
// Save Skin option
if (g_has_skin[id] == 1)
{
client_cmd(id, "setinfo _skin 1")
}
else if (g_has_skin[id] == 2)
{
client_cmd(id, "setinfo _skin 2")
}
else if (g_has_skin[id] == 3)
{
client_cmd(id, "setinfo _skin 3")
}
}
}
case 7: // 8. Back
{
show_menu_mainvipmenu(id)
}
case 8: // 9. Next
{
show_menu_page2vipskinmenu(id)
}
}
return PLUGIN_HANDLED;
}
// Vip Skin Menu
public menu_page2vipskinmenu(id, key)
{
switch (key)
{
case 0: // Player Skin 1
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(!zp_get_user_zombie(id) && !zp_get_user_survivor(id))
{
if (g_enable_skin[id] == 1)
{
zp_set_user_model(id, VIP_SKIN3)
client_cmd(id, "setinfo _skin 1")
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 5");
g_has_skin[id] = 3
show_menu_page2vipskinmenu(id)
}
else
{
zp_set_user_model(id, VIP_SKIN3)
client_cmd(id, "setinfo _skin 0")
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 5");
g_has_skin[id] = 3
show_menu_page2vipskinmenu(id)
}
}
else
{
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 5");
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 1: // Player Skin 2
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(!zp_get_user_zombie(id) && !zp_get_user_survivor(id))
{
if (g_enable_skin[id] == 1)
{
zp_set_user_model(id, VIP_SKIN3)
client_cmd(id, "setinfo _skin 3")
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 6");
g_has_skin[id] = 3
show_menu_page2vipskinmenu(id)
}
else
{
zp_set_user_model(id, VIP_SKIN3)
client_cmd(id, "setinfo _skin 0")
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 6");
g_has_skin[id] = 3
show_menu_page2vipskinmenu(id)
}
}
else
{
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 6");
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 2: // Player Skin 3
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(!zp_get_user_zombie(id) && !zp_get_user_survivor(id))
{
if (g_enable_skin[id] == 1)
{
zp_set_user_model(id, VIP_SKIN3)
client_cmd(id, "setinfo _skin 3")
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 7");
g_has_skin[id] = 3
show_menu_page2vipskinmenu(id)
}
else
{
zp_set_user_model(id, VIP_SKIN3)
client_cmd(id, "setinfo _skin 0")
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 7");
g_has_skin[id] = 3
show_menu_page2vipskinmenu(id)
}
}
else
{
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 701");
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 3: // Player Skin 4
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(!zp_get_user_zombie(id) && !zp_get_user_survivor(id))
{
if (g_enable_skin[id] == 1)
{
zp_set_user_model(id, VIP_SKIN3)
client_cmd(id, "setinfo _skin 3")
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 8");
g_has_skin[id] = 7
show_menu_page2vipskinmenu(id)
}
else
{
zp_set_user_model(id, VIP_SKIN3)
client_cmd(id, "setinfo _skin 0")
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 8");
g_has_skin[id] = 3
show_menu_page2vipskinmenu(id)
}
}
else
{
client_print(id, print_chat,"[ZP] ERROR! wrong skin id 8");
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 6: // 7. Rembember Skin
{
if (g_enable_skin[id] == 1)
{
client_print(id, print_chat,"[ZP] You Disabled Remember Skin Option!");
g_enable_skin[id] = 0
client_cmd(id, "setinfo _skin 0")
show_menu_page2vipskinmenu(id)
}
else
{
client_print(id, print_chat,"[ZP] You Enabled Remember Skin Option, Skin stay now in ohter maps.");
g_enable_skin[id] = 1
show_menu_page2vipskinmenu(id)
// Save Skin option
if (g_has_skin[id] == 1)
{
client_cmd(id, "setinfo _skin 1")
}
else if (g_has_skin[id] == 2)
{
client_cmd(id, "setinfo _skin 2")
}
else if (g_has_skin[id] == 3)
{
client_cmd(id, "setinfo _skin 3")
}
}
}
case 7: // 8. Back
{
show_menu_vipskinmenu(id)
}
}
return PLUGIN_HANDLED;
}
// HUMAN Bonus Menu
public menu_bhuman(id, key)
{
switch (key)
{
case 0: // +1500HP
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(!zp_get_user_zombie(id))
{
set_user_health(id, get_user_health(id)+1500)
client_print(id, print_chat,"[ZP] +1500HP");
g_bmenu_used_human[id] = false
}
else
{
client_print(id, print_chat,"[ZP] Zombies cant use this menu!");
show_menu_mainvipmenu(id)
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 1: // +200Armor
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(!zp_get_user_zombie(id))
{
set_pev(id, pev_armorvalue, float(min(pev(id, pev_armorvalue)+200, 999)))
client_print(id, print_chat,"[ZP] +200Armor");
g_bmenu_used_human[id] = false
}
else
{
client_print(id, print_chat,"[ZP] Zombies cant use this menu!");
show_menu_mainvipmenu(id)
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 2: // +5 Gravity
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(!zp_get_user_zombie(id))
{
fm_set_user_gravity(id, 0.5)
client_print(id, print_chat,"[ZP] +5 Gravity");
g_bmenu_used_human[id] = false
}
else
{
client_print(id, print_chat,"[ZP] Zombies cant use this menu!");
show_menu_mainvipmenu(id)
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 3: // 60 Sec Invisible
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(!zp_get_user_zombie(id))
{
g_human_invisible_timer[id] = 60
g_human_invisible[id] = true
set_task( 0.1 , "Bhuman_invisible_timer", id)
set_task( 65.1 , "Bhuman_invisible_over", id)
set_user_rendering ( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0 )
client_print(id, print_chat,"[ZP] You are now 60sec Invisible");
g_bmenu_used_human[id] = false
}
else
{
client_print(id, print_chat,"[ZP] Zombies cant use this menu!");
show_menu_mainvipmenu(id)
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 7: // 8. Back
{
show_menu_mainvipmenu(id)
}
}
return PLUGIN_HANDLED;
}
public Bhuman_invisible_over(id)
{
if(g_human_invisible[id])
{
if(!zp_get_user_zombie(id) && is_user_alive(id))
{
g_human_invisible[id] = false
g_human_invisible_timer[id] = 60
set_user_rendering(id)
client_print(id, print_chat,"[ZP] Invisible time is over!");
}
}
}
public Bhuman_invisible_timer(id)
{
if(g_human_invisible[id])
{
if(!zp_get_user_zombie(id) && is_user_alive(id))
{
set_task( 1.0 , "Bhuman_invisible_timer", id)
set_hudmessage(60, 60, 60, 0.75, -1.0, 1, 0.5, 0.5, 1.0, 1.0, -1)
ShowSyncHudMsg(id, g_MsgSync_svm, "Invisible Time: %d", g_human_invisible_timer[id])
g_human_invisible_timer[id]--
}
else
{
set_task( 0.5 , "Bhuman_invisible_over", id)
}
}
}
// ZOMBIE Bonus Menu
public menu_bzombie(id, key)
{
switch (key)
{
case 0: // +10000HP
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(zp_get_user_zombie(id))
{
set_user_health(id, get_user_health(id)+10000)
client_print(id, print_chat,"[ZP] +10000HP");
g_bmenu_used_zombie[id] = false
}
else
{
client_print(id, print_chat,"[ZP] Humans cant use this menu!");
show_menu_mainvipmenu(id)
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 1: // +8 Gravity
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(zp_get_user_zombie(id))
{
fm_set_user_gravity(id, 0.3)
client_print(id, print_chat,"[ZP] +8 Gravity");
g_bmenu_used_zombie[id] = false
}
else
{
client_print(id, print_chat,"[ZP] Humans cant use this menu!");
show_menu_mainvipmenu(id)
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 2: // +600Armor
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(zp_get_user_zombie(id))
{
set_pev(id, pev_armorvalue, float(min(pev(id, pev_armorvalue)+600, 999)))
client_print(id, print_chat,"[ZP] +600Armor");
g_bmenu_used_zombie[id] = false
}
else
{
client_print(id, print_chat,"[ZP] Humans cant use this menu!");
show_menu_mainvipmenu(id)
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 3: // 20Sec Invisible
{
// Check Access
if (get_user_flags(id) & STALVIPACCESS)
{
if(zp_get_user_zombie(id))
{
g_zombie_invisible_timer[id] = 20
g_zombie_invisible[id] = true
set_task( 0.1 , "Bzombie_invisible_timer", id)
set_task( 22.3 , "Bzombie_invisible_over", id)
set_user_rendering ( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0 )
client_print(id, print_chat,"[ZP] You are now 20sec Invisible");
g_bmenu_used_zombie[id] = false
}
else
{
client_print(id, print_chat,"[ZP] Humans cant use this menu!");
show_menu_mainvipmenu(id)
}
}
else
{
// Not Access?
client_print(id, print_chat,"[ZP] You have no access.");
}
}
case 7: // 8. Back
{
show_menu_mainvipmenu(id)
}
}
return PLUGIN_HANDLED;
}
public Bzombie_invisible_over(id)
{
if(g_zombie_invisible[id])
{
if(zp_get_user_zombie(id) && is_user_alive(id))
{
g_zombie_invisible[id] = false
g_zombie_invisible_timer[id] = 20
set_user_rendering(id)
client_print(id, print_chat,"[ZP] Invisible time is over!");
}
}
}
public Bzombie_invisible_timer(id)
{
if(g_zombie_invisible[id])
{
if(zp_get_user_zombie(id) && is_user_alive(id))
{
set_task( 1.0 , "Bzombie_invisible_timer", id)
set_hudmessage(60, 60, 60, 0.75, -1.0, 1, 0.5, 0.5, 1.0, 1.0, -1)
ShowSyncHudMsg(id, g_MsgSync_svm, "Invisible Time: %d", g_zombie_invisible_timer[id])
g_zombie_invisible_timer[id]--
}
else
{
set_task( 0.5 , "Bhuman_invisible_over", id)
}
}
}
stock fm_set_user_gravity(index, Float:gravity = 1.0)
{
set_pev(index, pev_gravity, gravity);
return 1;
}
__________________
|
|