i have this plugin , but the player chooses his model it disappears when he's transfered too another team (Deathrun Mod Server)
so how i can make it stays for all the map without changing
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <colorchat>
#define PLUGIN "Model Menu"
#define VERSION "1.0"
#define AUTHOR "BloodyPro"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /model", "model_menu")
}
public plugin_precache()
{
precache_model("models/player/sonic/sonic.mdl")
precache_model("models/player/spiderman/spiderman.mdl")
precache_model("models/player/trollman/trollman.mdl")
precache_model("models/player/man/man.mdl")
precache_model("models/player/horse/horse.mdl")
precache_model("models/player/vip/vip.mdl")
}
public model_menu(id)
{
new menu = menu_create("\rModel Menu", "menu_wybierz")
menu_additem(menu, "\wSonic \y(Admins)", "1", 0)
menu_additem(menu, "\wSpiderMan \y(Level30)", "2", 0)
menu_additem(menu, "\wTrollMan \y(Level30)", "3", 0)
menu_additem(menu, "\wMan \y(Level30)", "4", 0)
menu_additem(menu, "\wHorse \y(Level30)", "5", 0)
menu_additem(menu, "\wSexy \y(VIPS)", "6", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
}
public menu_wybierz(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new acces, callback
menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1 :
{
if (get_user_flags(id) & ADMIN_VOTE)
{
cs_set_user_model(id, "sonic")
}
else
{
ColorChat(id, GREEN, "**You must be an admin to use this Model.**")
}
}
case 2 :
{
if (get_user_flags(id) & ADMIN_LEVEL_G)
{
cs_set_user_model(id, "spiderman")
}
else
{
ColorChat(id, GREEN, "**You must be Level 30 to use this Model.**")
}
}
case 3 :
{
if (get_user_flags(id) & ADMIN_LEVEL_G)
{
cs_set_user_model(id, "trollman")
}
else
{
ColorChat(id, GREEN, "**You must be Level 30 to use this Model.**")
}
}
case 4 :
{
if (get_user_flags(id) & ADMIN_LEVEL_G)
{
cs_set_user_model(id, "man")
}
else
{
ColorChat(id, GREEN, "**You must be Level 30 to use this Model.**")
}
}
case 5 : cs_set_user_model(id, "horse")
{
if (get_user_flags(id) & ADMIN_LEVEL_G)
{
cs_set_user_model(id, "horse")
}
else
{
ColorChat(id, GREEN, "**You must be Level 30 to use this Model.**")
}
}
case 6 : cs_set_user_model(id, "vip")
{
if (get_user_flags(id) & ADMIN_LEVEL_H)
{
cs_set_user_model(id, "vip")
}
else
{
ColorChat(id, GREEN, "**You must be VIP to use this Model.**")
}
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}