|
发表于 2010-4-9 05:17:06
|
显示全部楼层
来自 中国–陕西–渭南
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define PLUGIN "New weapon model for VIP"
#define VERSION "1.0"
#define AUTHOR "KzFun.wUgu1"
#define LOADING "^n^t%s v%s, Copyright (C) 2009 by %s^n"
new player_flags;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
server_print(LOADING,PLUGIN,VERSION,AUTHOR);
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/w_ak47_vip.mdl");
precache_model("models/v_m4a1_vip.mdl");
precache_model("models/w_m4a1_vip.mdl");
}
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:
{
entity_set_string(id, EV_SZ_viewmodel, "models/v_ak47_vip.mdl");
entity_set_string(id, EV_SZ_weaponmodel, "models/w_ak47_vip.mdl");
}
case CSW_M4A1:
{
entity_set_string(id, EV_SZ_viewmodel, "models/v_m4a1_vip.mdl");
entity_set_string(id, EV_SZ_weaponmodel, "models/w_m4a1_vip.mdl");
}
}
} |
|