Code: Select all
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <zombie_escape>
#include <ze_vip>
#define PLUGIN "Admin Model Menu"
#define VERSION "1.0"
#define AUTHOR "Dimision"
new g_pCvarUseTimes
new g_iUsedTimes[33]
public plugin_natives()
{
register_native("ze_open_skin_menu", "native_ze_open_skin_menu", 1)
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_pCvarUseTimes = register_cvar("ze_skin_menu_used", "1")
}
public plugin_precache()
{
precache_model("models/ZE_skznzs/Asasin.mdl")
precache_model("models/ZE_skznzs/Death.mdl")
precache_model("models/ZE_skznzs/Dobby.mdl")
precache_model("models/ZE_skznzs/Sonic.mdl")
precache_model("models/ZE_skznzs/Skeleton.mdl")
precache_model("models/ZE_skznzs/Joker.mdl")
precache_model("models/ZE_skznzs/Iron.mdl")
precache_model("models/ZE_skznzs/DeadSpace2.mdl")
precache_model("models/ZE_skznzs/Trump.mdl")
precache_model("models/ZE_skznzs/trollface.mdl")
precache_model("models/ZE_skznzs/PokerFace.mdl")
precache_model("models/ZE_skznzs/ZE_hm_Admin.mdl")
}
public model_menu(id)
{
if (ze_is_user_zombie(id))
{
ze_colored_print(id, "!tYou can't change your skin while zombie!y.")
return PLUGIN_HANDLED
}
if (g_iUsedTimes[id] >= get_pcvar_num(g_pCvarUseTimes))
{
ze_colored_print(id, "!tMaximum have been reached !y[!g%d!y]!", get_pcvar_num(g_pCvarUseTimes))
return PLUGIN_HANDLED
}
else
{
new menu = menu_create("\r[\wSkin Models\r]\r", "menu_wybierz")
menu_additem(menu, "\wAsasin", "1", 0)
menu_additem(menu, "\wDeath", "2", 0)
menu_additem(menu, "\wDobby", "3", 0)
menu_additem(menu, "\wSonic", "4", 0)
menu_additem(menu, "\wSkeleton", "5", 0)
menu_additem(menu, "\wJoker", "6", 0)
menu_additem(menu, "\wIron", "7", 0)
menu_additem(menu, "\wDead Space", "8", 0)
menu_additem(menu, "\wTrump \r[*VIP*]", "9", 0)
menu_additem(menu, "\wPokerFace \r[*VIP*]", "10", 0)
menu_additem(menu, "\wTrollFace \r[*VIP*]", "11", 0)
menu_additem(menu, "\wSkull \r[*ADMIN*]", "12", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
}
return PLUGIN_HANDLED
}
public menu_wybierz(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[20], iName[500]
new acces, callback
menu_item_getinfo(menu, item, acces, data,20, iName, 500, callback)
new key = str_to_num(data)
switch(key)
{
case 1 : {
cs_set_user_model(id, "Asasin")
ze_colored_print(id, "You picked the Assassin skin", id)
g_iUsedTimes[id]++
}
case 2 : {
cs_set_user_model(id, "Death")
ze_colored_print(id, "You picked the Death skin", id)
g_iUsedTimes[id]++
}
case 3 : {
cs_set_user_model(id, "Dobby")
ze_colored_print(id, "You picked the Dobby skin", id)
g_iUsedTimes[id]++
}
case 4 : {
cs_set_user_model(id, "Sonic")
ze_colored_print(id, "You picked the Sonic skin", id)
g_iUsedTimes[id]++
}
case 5 : {
cs_set_user_model(id, "Skeleton")
ze_colored_print(id, "You picked the Skeleton skin", id)
g_iUsedTimes[id]++
}
case 6 : {
cs_set_user_model(id, "Joker")
ze_colored_print(id, "You picked the Joker skin", id)
g_iUsedTimes[id]++
}
case 7 : {
cs_set_user_model(id, "Iron")
ze_colored_print(id, "You picked the Iron skin", id)
g_iUsedTimes[id]++
}
case 8 : {
cs_set_user_model(id, "DeadSpace2")
ze_colored_print(id, "You picked the Dead Space skin", id)
g_iUsedTimes[id]++
}
case 9 :
if (ze_get_vip_flags(id) & VIP_H)
{
cs_set_user_model(id, "Trump")
ze_colored_print(id, "You picked the Trump skin", id)
g_iUsedTimes[id]++
}
else
{
ze_colored_print(id, "You can't use this skin, it's only for VIPS!", id)
}
case 10 :
if (ze_get_vip_flags(id) & VIP_H)
{
cs_set_user_model(id, "PokerFace")
ze_colored_print(id, "You picked the PokerFace skin", id)
g_iUsedTimes[id]++
}
else
{
ze_colored_print(id, "You can't use this skin, it's only for VIPS!", id)
}
case 11 :
if (ze_get_vip_flags(id) & VIP_H)
{
cs_set_user_model(id, "trollface")
ze_colored_print(id, "You picked the TrollFace skin", id)
g_iUsedTimes[id]++
}
else
{
ze_colored_print(id, "You can't use this skin, it's only for VIPS!", id)
}
case 12 :
if(get_user_flags(id, ADMIN_KICK))
{
cs_set_user_model(id, "ZE_hm_Admin")
ze_colored_print(id, "You picked the Skull skin", id)
g_iUsedTimes[id]++
}
else
{
ze_colored_print(id, "You can't use this skin, it's only for ADMINS!", id)
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
public native_ze_open_skin_menu(id)
{
model_menu(id)
}
stock ChatColor(const id, const input[], any:...) {
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!g", "^4"); // verde
replace_all(msg, 190, "!n", "^1"); // galben/alb/negru
replace_all(msg, 190, "!t", "^3"); // rosu/albastru/gri
replace_all(msg, 190, "!t2", "^0"); // rosu2/albastru2/gri2
if (id) players[0] = id; else get_players(players, count, "ch");
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}