|
楼主 |
发表于 2007-3-23 12:37:57
|
显示全部楼层
来自 中国–江苏–苏州
回复: 求扔完O4后,自动切换刀的插件,不然有游戏代码BUG可以炸服!
[PHP]/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fakemeta>
#define PLUGIN_NAME "knife_after_throw_nade"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "CZ*Ryu"
#define MAXPLAYERS 32
new iUserLastWeaponID[MAXPLAYERS + 1]
new const sWeaponBox[] = "weaponbox"
new const sNamedEnt_ArmouryEntity[] = "armoury_entity"
new const sWeaponKnife[] = "weapon_knife"
new const sModel_Weaponbox_w[] = "models/w_weaponbox.mdl"
//new const sModel_FlashBang_w[] = "models/w_flashbang.mdl"
new const sModel_HeGrenade_w[] = "models/w_hegrenade.mdl"
new const sModel_SmokeGrenade_w[] = "models/w_smokegrenade.mdl"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_event("CurWeapon", "event_CurWeapon_CheckWeapon", "be", "1>0", "2!4", "2!9", "2!29"/*, "2!25"*/)
register_forward(FM_SetModel, "FM_SetModel_SetKnife")
}
public event_CurWeapon_CheckWeapon(id)
{
iUserLastWeaponID[id] = read_data(2)
}
public FM_SetModel_SetKnife(iEnt, sModel[])
{
if ( !pev_valid(iEnt)
|| equal(sModel, sModel_Weaponbox_w)
|| ( !equal(sModel, sModel_HeGrenade_w) && !equal(sModel, sModel_SmokeGrenade_w)/* && !equal(sModel, sModel_FlashBang_w)*/ ) )
return FMRES_IGNORED
new sClass[32]
pev(iEnt, pev_classname, sClass, sizeof sClass - 1 )
if ( equal(sClass, sWeaponBox) || equal(sClass, sNamedEnt_ArmouryEntity) )
return FMRES_IGNORED
new iOwner = pev(iEnt, pev_owner)
new iWeaponID = iUserLastWeaponID[iOwner]
if ( iOwner && is_user_alive(iOwner) && pev(iOwner, pev_weapons) & (1 << iWeaponID) )
{
get_weaponname(iWeaponID, sClass, sizeof sClass - 1 )
client_cmd(iOwner, sClass)
client_cmd(iOwner, sWeaponKnife)
}
return FMRES_IGNORED
}
[/PHP]
谢谢楼上所有人,我找到了。那个群里的我发一下, |
|