求教斑竹
请教斑竹#define MAXPLAYERS 32
new iUserLastWeaponID
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"
new const sModel_usp_w[] = "models/w_usp.mdl"这里是我添加的usp手枪
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 = 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_usp_w还有这里)/* && !equal(sModel, sModel_FlashBang_w)*/ ) )
return FMRES_IGNORED
为什么添加了 在游戏中不能实现仍usp换刀呢
请斑竹帮帮忙指点一下 谢谢了
可以在1.76c编译
回复: 求教斑竹
条件2是WeaponID,其值可以查看amxconst.inc文件以CSW_开头的预定义常量。回复: 求教斑竹
可以说的明白点吗我不明白回复: 求教斑竹
/* Id of weapons in CS */#define CSW_P228 1
#define CSW_SCOUT 3
#define CSW_HEGRENADE 4
#define CSW_XM1014 5
#define CSW_C4 6
#define CSW_MAC10 7
#define CSW_AUG 8
#define CSW_SMOKEGRENADE 9
#define CSW_ELITE 10
#define CSW_FIVESEVEN 11
#define CSW_UMP45 12
#define CSW_SG550 13
#define CSW_GALI 14
#define CSW_GALIL 14
#define CSW_FAMAS 15
#define CSW_USP 16
#define CSW_GLOCK18 17
#define CSW_AWP 18
#define CSW_MP5NAVY 19
#define CSW_M249 20
#define CSW_M3 21
#define CSW_M4A1 22
#define CSW_TMP 23
#define CSW_G3SG1 24
#define CSW_FLASHBANG 25
#define CSW_DEAGLE 26
#define CSW_SG552 27
#define CSW_AK47 28
#define CSW_KNIFE 29
#define CSW_P90 30
#define CSW_VEST 31
#define CSW_VESTHELM 32
是否需要把上面的编号加在这里面register_event("CurWeapon", "event_CurWeapon_CheckWeapon", "be", "1>0", "2!4", "2!9", "2!29"/*, "2!25"*/是否需要把上面的编号加在这里面)
如果我加了个掉usp扔手枪换刀的new const sModel_usp_w[] = "models/w_usp.mdl"
|| ( !equal(sModel, sModel_HeGrenade_w) && !equal(sModel, sModel_SmokeGrenade_w) && !equal(sModel, sModel_usp_w还有这里)/* && !equal(sModel, sModel_FlashBang_w)*/ ) )
return FMRES_IGNORED
是否还要在这里添加#define CSW_USP 16这里的编号16
回复: 求教斑竹
该怎么使用,你自己思考,我只说条件的使用方法:条件一般有如下几种:
! 不等于
= 等于
> 大于
< 小于
& 包含
如:
"2=c4" - 此消息的第二个参数必须是字符串"c4".
"3>10" - 第三个参数必须大于10.
"3!4" - 第三个参数不能是 4.
"2&Buy" - 第二个参数必须包含子串"Buy".
"2!Buy" - 第二个参数不能有"Buy"子串.
页:
[1]