【求助】爆炸光坏的代码怎么写?
其实也不是什么新鲜玩意,就是想在手雷拖尾插件的基础上再增加点东西,即手雷爆炸的时候,附带产生一个红色的光坏(如图示)。插件的代码写完了,但是没能编译成功,希望能有高人帮忙修改一下。#include <amxmodx>
#include <engine>
#include <csx>
#define TE_BEAMFOLLOW 22
new g_trail
new ExSpr
public plugin_init()
{
register_plugin("Grenade Trail","1.0","X-man")
register_cvar("amx_grentrail","1")
}
public plugin_precache() {
g_trail = precache_model("sprites/smoke.spr")
ExSpr = precache_model("sprites/shockwave.spr")
}
public grenade_throw(id,greindex,wpn)
{
if(!get_cvar_num("amx_grentrail"))
return PLUGIN_HANDLED
if(wpn == CSW_HEGRENADE)
Create_TE_BEAMFOLLOW(greindex, g_trail, 10, 10, 255, 0, 0, 200)
return PLUGIN_CONTINUE
}
stock Create_TE_BEAMFOLLOW(id, g_trail, life, width, r, g, b, brightness)
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMFOLLOW)
write_short(id)
write_short(g_trail)
write_byte(life)
write_byte(width)
write_byte(r)
write_byte(g)
write_byte(b)
write_byte(brightness)
message_end()
}
public HE_explode(ent)
{
if(!pev_valid(ent))
return;
new origin, Float:originG
pev(ent, pev_origin, originG)
fm_FVecIVec(originG,origin)
HE_Explosion(origin)
}
public HE_Explosion(origin)
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(21)
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_coord(origin + 385)
write_short(ExSpr)
write_byte(0)
write_byte(0)
write_byte(5)
write_byte(80)
write_byte(0)
write_byte(225)
write_byte(0)
write_byte(0)
write_byte(192)
write_byte(0)
message_end()
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(21)
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_coord(origin + 470)
write_short(ExSpr)
write_byte(0)
write_byte(0)
write_byte(5)
write_byte(80)
write_byte(0)
write_byte(225)
write_byte(0)
write_byte(0)
write_byte(192)
write_byte(0)
message_end()
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(21)
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_coord(origin + 555)
write_short(ExSpr)
write_byte(0)
write_byte(0)
write_byte(5)
write_byte(80)
write_byte(0)
write_byte(225)
write_byte(0)
write_byte(0)
write_byte(192)
write_byte(0)
message_end()
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(27);
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_byte(60)
write_byte(225)
write_byte(0)
write_byte(0)
write_byte(8)
write_byte(60)
message_end()
}
刚好手头上有一个发俭给你吧...大哥最近去那了很久不见你上线哦 本帖最后由 点通粉丝 于 2011-7-23 15:34 编辑
**** Hidden Message ***** 2# 点通粉丝 本帖最后由 点通粉丝 于 2011-7-23 15:38 编辑
我这个好像也有点问题的..不能同步显示的
望Osker Lee 大哥修正一下吧..
另外帮手加多一个spr特效上去...就是在光环爆炸中间加多一个spr爆炸效果上去吧..谢了 本帖最后由 Osker Lee 于 2011-7-23 16:44 编辑
工作了,没办法,为了生计得到处奔波劳碌啊...... {:3_65:} 至于怎么加SPR图标,参考这个插件的源代码应该对你有所帮助:
死亡光环插件+鬼魂插件(修正版):
http://www.dt-club.net/forum/viewthread.php?tid=36984&highlight= 工作了,没办法,为了生计得到处奔波劳碌啊...... {:3_65:} 至于怎么加SPR图标,参考这个插件的源代码应该对你有所帮助:
死亡光环插件+鬼魂插件(修正版):
http://www.dt-club.net/forum/viewthread.php?tid=36984 ...
Osker Lee 发表于 2011-7-23 16:35 http://www.dt-club.net/forum/images/common/back.gif
我的代码有没效果????????? 本帖最后由 Osker Lee 于 2011-7-23 17:47 编辑
另外,你的源码貌似有问题,我编译成amxx后放游戏里使用,结果一扔手雷马上就当机了,游戏会被弹出。(我的是CS1.6 Ver.4554版本,AMXX1.8.1 + Metamod1.19) 本帖最后由 点通粉丝 于 2011-7-23 17:48 编辑
没可能..我是CS1.5+amxx1.76c上使用的
要不用我的试一下吧 看一下还有问题没有 问题依旧,这个CS1.5可能没问题,CS1.6就不行了,估计得重写一下代码。
页:
[1]
2