|
AMXX源码有了,怎么用呢?
这是我在点通论坛找到的,关于1.5服务器,扔完雷后自动换刀的插件源码
有了源码,怎么做成插件呢。
我是个新人不太懂。
现在手雷炸服太厉害了。
请大家帮助下,谢谢了。
[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] |
|