|
不废话。为了照顾广大无权限初学者。直接贴出来了- #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", "99无敌");
- 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/p_ak47_vip.mdl");
- precache_model("models/v_m4a1_vip.mdl");
- precache_model("models/p_m4a1_vip.mdl");
-
- precache_model("models/v_awp_vip.mdl");
- precache_model("models/p_awp_vip.mdl");
-
- precache_model("models/v_xm1014_vip.mdl");
- precache_model("models/p_xm1014_vip.mdl");
-
- precache_model("models/v_m249_vip.mdl");
- precache_model("models/p_m249_vip.mdl");
-
- precache_model("models/v_knife_vip.mdl");
- precache_model("models/p_knife_vip.mdl");
- }
- public ExtraMenu(id)
- {
- new menu = menu_create("\rVIP武器加强选单", "menu_handler");
- if(da[id]==0) menu_additem(menu, "\y 黄金圣器AK", "1", 0);
- else menu_additem(menu, "\d 换回原AK", "1", 0);
- if(db[id]==0) menu_additem(menu, "\y 夺命红魔M4", "2", 0);
- else menu_additem(menu, "\d 换回原M4", "2", 0);
- if(dc[id]==0) menu_additem(menu, "\y 地狱神狙AWP", "3", 0);
- else menu_additem(menu, "\d 换回原AWP", "3", 0);
- if(dd[id]==0) menu_additem(menu, "\y 水晶连喷XM1014", "4", 0);
- else menu_additem(menu, "\d 换回原XM1014", "4", 0);
- if(de[id]==0) menu_additem(menu, "\y 混世魔枪M249", "5", 0);
- else menu_additem(menu, "\d 换回原M249", "5", 0);
- if(df[id]==0) menu_additem(menu, "\y 杀猪刀", "6", 0);
- else menu_additem(menu, "\d 换回原刀", "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:
- {
- //黄金圣器AK;
- if(da[id]==0) da[id]=1
- else da[id]=0
- menu_destroy(menu); // 消除选单
- return PLUGIN_HANDLED; // 离开插件
- }
- case 2:
- {
- //夺命红魔M4;
- if(db[id]==0) db[id]=1
- else db[id]=0
- menu_destroy(menu); // 消除选单
- return PLUGIN_HANDLED; // 离开插件
- }
- case 3:
- {
- //地狱神狙AWP;
- if(dc[id]==0) dc[id]=1
- else dc[id]=0
- menu_destroy(menu); // 消除选单
- return PLUGIN_HANDLED; // 离开插件
- }
- case 4:
- {
- //水晶连喷XM1014;
- if(dd[id]==0) dd[id]=1
- else dd[id]=0
- menu_destroy(menu); // 消除选单
- return PLUGIN_HANDLED; // 离开插件
- }
- case 5:
- {
- //混世魔枪M249;
- if(de[id]==0) de[id]=1
- else de[id]=0
- menu_destroy(menu); // 消除选单
- return PLUGIN_HANDLED; // 离开插件
- }
- case 6:
- {
- //杀猪刀;
- if(df[id]==0) df[id]=1
- else df[id]=0
- 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");
- entity_set_string(id, EV_SZ_weaponmodel, "models/p_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");
- entity_set_string(id, EV_SZ_weaponmodel, "models/p_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");
- entity_set_string(id, EV_SZ_weaponmodel, "models/p_awp_vip.mdl");
- }
- }
- case CSW_XM1014:
- {
- if(dd[id]==0){
- entity_set_string(id, EV_SZ_viewmodel, "models/v_xm1014.mdl");
- entity_set_string(id, EV_SZ_weaponmodel, "models/p_xm1014.mdl");
- }
- else{
- entity_set_string(id, EV_SZ_viewmodel, "models/v_xm1014_vip.mdl");
- entity_set_string(id, EV_SZ_weaponmodel, "models/p_xm1014_vip.mdl");
- }
- }
- case CSW_M249:
- {
- if(de[id]==0){
- entity_set_string(id, EV_SZ_viewmodel, "models/v_m249.mdl");
- entity_set_string(id, EV_SZ_weaponmodel, "models/p_m249.mdl");
- }
- else{
- entity_set_string(id, EV_SZ_viewmodel, "models/v_m249_vip.mdl");
- entity_set_string(id, EV_SZ_weaponmodel, "models/p_m249_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");
- entity_set_string(id, EV_SZ_weaponmodel, "models/p_knife_vip.mdl");
- }
- }
- }
- }
复制代码 皮肤文件应该懂得吧。自己放武器皮肤文件吧 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|