|
楼主 |
发表于 2013-2-24 23:37:04
|
显示全部楼层
来自 中国–贵州–贵阳
本帖最后由 294421338 于 2013-2-24 23:42 编辑
我还是吧源码发出来吧
#include <amxmodx>
#include <amxmisc>
#include <engine>
new player_flags;
new da[33],db[33],dc[33],dd[33],de[33],df[33]
public plugin_init()
{
register_plugin("VIP武器皮肤", "1.0", "不二病后期修改");
register_clcmd( "say /wq","ExtraMenu",ADMIN_KICK)
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
player_flags = register_cvar("amx_vip_flags","b")
register_event("CurWeapon", "SwitchWeapon", "be", "1=1")
}
public plugin_precache()
{
precache_model("models/v_ak47_vip.mdl");
precache_model("models/v_m4a1_vip.mdl");
precache_model("models/v_awp_vip.mdl");
precache_model("models/v_deagle_vip.mdl");
precache_model("models/v_knife_vip.mdl");
}
public ExtraMenu(id)
{
new menu = menu_create("\r<会员武器皮肤更换菜单>", "menu_handler");
if(da[id]==0) menu_additem(menu, "\r【\y#\r】.按下对应的编号选择菜单^n^n", "0", 0);
else menu_additem(menu, "\r【\y#\r】.按下对应的编号选择菜单^n^n", "0", 0);
if(da[id]==1) menu_additem(menu, "\y黄金AK皮肤|\d普通AK皮肤", "1", 0);
else menu_additem(menu, "\d黄金AK皮肤|\y普通AK皮肤", "1", 0);
if(db[id]==2) menu_additem(menu, "\y黄金M4皮肤|\d普通M4皮肤", "2", 0);
else menu_additem(menu, "\d黄金M4皮肤|\y普通M4皮肤", "2", 0);
if(dc[id]==3) menu_additem(menu, "\y黄金大狙皮肤|\d普通大狙皮肤", "3", 0);
else menu_additem(menu, "\d黄金大狙皮肤|\y普通大狙皮肤", "3", 0);
if(dd[id]==4) menu_additem(menu, "\y黄金沙鹰皮肤|\d普通沙鹰皮肤", "4", 0);
else menu_additem(menu, "\d黄金沙鹰皮肤|\y普通沙鹰皮肤", "4", 0);
if(df[id]==5) menu_additem(menu, "\y黄金背刺皮肤|\d普通刀子皮肤", "6", 0);
else menu_additem(menu, "\d黄金背刺皮肤|\y普通刀子皮肤", "6", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
public menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
if(da[id]==0) da[id]=1
else da[id]=0
client_print(id, print_chat,"【服务器】您的AK47皮肤已经更换")
menu_destroy(menu); // 消除选单
return PLUGIN_HANDLED; // 离开插件
}
case 2:
{
if(db[id]==0) db[id]=2
else db[id]=0
client_print(id, print_chat,"【服务器】您的M4A1皮肤已经更换")
menu_destroy(menu); // 消除选单
return PLUGIN_HANDLED; // 离开插件
}
case 3:
{
if(dc[id]==0) dc[id]=3
else dc[id]=0
client_print(id, print_chat,"【服务器】您的大狙皮肤已经更换")
menu_destroy(menu); // 消除选单
return PLUGIN_HANDLED; // 离开插件
}
case 4:
{
if(dd[id]==0) dd[id]=4
else dd[id]=0
client_print(id, print_chat,"【服务器】您的沙鹰皮肤已经更换")
menu_destroy(menu); // 消除选单
return PLUGIN_HANDLED; // 离开插件
}
case 6:
{
if(df[id]==0) df[id]=5
else df[id]=0
client_print(id, print_chat,"【服务器】您的刀子皮肤已经更换")
menu_destroy(menu); // 消除选单
return PLUGIN_HANDLED; // 离开插件
}
}
menu_destroy(menu); // 消除选单
return PLUGIN_HANDLED; // 离开插件
}
public event_round_start() {
client_print(0, print_chat, "本插件使用CS1.6爱好者群主开发的菜单生成器制成,按y输入/wq打开菜单或者在控制台输入say /wq打开菜单")
}
public SwitchWeapon(id)
{
new needaccess[32];
get_pcvar_string(player_flags, needaccess, 31);
if(get_user_flags(id) & read_flags(needaccess) == 0)
return;
static iwpn, clip, ammo;
iwpn = get_user_weapon(id, clip, ammo);
switch(iwpn)
{
case CSW_AK47:
{
if(da[id]==0){
entity_set_string(id, EV_SZ_viewmodel, "models/v_ak47.mdl");
entity_set_string(id, EV_SZ_weaponmodel, "models/p_ak47.mdl");
}
else{
entity_set_string(id, EV_SZ_viewmodel, "models/v_ak47_vip.mdl");
}
}
case CSW_M4A1:
{
if(db[id]==0){
entity_set_string(id, EV_SZ_viewmodel, "models/v_m4a1.mdl");
entity_set_string(id, EV_SZ_weaponmodel, "models/p_m4a1.mdl");
}
else{
entity_set_string(id, EV_SZ_viewmodel, "models/v_m4a1_vip.mdl");
}
}
case CSW_AWP:
{
if(dc[id]==0){
entity_set_string(id, EV_SZ_viewmodel, "models/v_awp.mdl");
entity_set_string(id, EV_SZ_weaponmodel, "models/p_awp.mdl");
}
else{
entity_set_string(id, EV_SZ_viewmodel, "models/v_awp_vip.mdl");
}
}
case CSW_DEAGLE:
{
if(dd[id]==0){
entity_set_string(id, EV_SZ_viewmodel, "models/v_deagle.mdl");
entity_set_string(id, EV_SZ_weaponmodel, "models/p_deagle.mdl");
}
else{
entity_set_string(id, EV_SZ_viewmodel, "models/v_deagle_vip.mdl");
}
}
case CSW_KNIFE:
{
if(df[id]==0){
entity_set_string(id, EV_SZ_viewmodel, "models/v_knife.mdl");
entity_set_string(id, EV_SZ_weaponmodel, "models/p_knife.mdl");
}
else{
entity_set_string(id, EV_SZ_viewmodel, "models/v_knife_vip.mdl");
}
}
}
}
|
|