vip武器皮肤随意换】别人不开源,我写来开源!!!!
不废话。为了照顾广大无权限初学者。直接贴出来了#include <amxmodx>
#include <amxmisc>
#include <engine>
new player_flags;
new da,db,dc,dd,de,df
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==0) menu_additem(menu, "\y 黄金圣器AK", "1", 0);
else menu_additem(menu, "\d 换回原AK", "1", 0);
if(db==0) menu_additem(menu, "\y 夺命红魔M4", "2", 0);
else menu_additem(menu, "\d 换回原M4", "2", 0);
if(dc==0) menu_additem(menu, "\y 地狱神狙AWP", "3", 0);
else menu_additem(menu, "\d 换回原AWP", "3", 0);
if(dd==0) menu_additem(menu, "\y 水晶连喷XM1014", "4", 0);
else menu_additem(menu, "\d 换回原XM1014", "4", 0);
if(de==0) menu_additem(menu, "\y 混世魔枪M249", "5", 0);
else menu_additem(menu, "\d 换回原M249", "5", 0);
if(df==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, iName;
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==0) da=1
else da=0
menu_destroy(menu); // 消除选单
return PLUGIN_HANDLED; // 离开插件
}
case 2:
{
//夺命红魔M4;
if(db==0) db=1
else db=0
menu_destroy(menu); // 消除选单
return PLUGIN_HANDLED; // 离开插件
}
case 3:
{
//地狱神狙AWP;
if(dc==0) dc=1
else dc=0
menu_destroy(menu); // 消除选单
return PLUGIN_HANDLED; // 离开插件
}
case 4:
{
//水晶连喷XM1014;
if(dd==0) dd=1
else dd=0
menu_destroy(menu); // 消除选单
return PLUGIN_HANDLED; // 离开插件
}
case 5:
{
//混世魔枪M249;
if(de==0) de=1
else de=0
menu_destroy(menu); // 消除选单
return PLUGIN_HANDLED; // 离开插件
}
case 6:
{
//杀猪刀;
if(df==0) df=1
else df=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;
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==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==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==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==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==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==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");
}
}
}
}皮肤文件应该懂得吧。自己放武器皮肤文件吧 :lol顶~~~~ 好帖就顶吧 顶,我顶,我再顶,我继续顶!! 本帖最后由 liyang2008 于 2012-2-28 16:56 编辑
啊哈。终于有人写了个
但是还不是一样的
个人认为中国人写插件不会把退出菜单写成Exit
呵呵,懒人写插件嘛
果然是懒人..
居然发现一个地方跟你发的东西一样 .....
不知道为何..... liyang2008 发表于 2012-2-29 15:22 static/image/common/back.gif
果然是懒人..
居然发现一个地方跟你发的东西一样 .....
也是我发的mod同盟社 源码是个好东西,拿回来好好学习 我从没去过MOD。
在别的地方。FIL里面