搜索
查看: 3727|回复: 5

高手来看一下这个插件

[复制链接]
发表于 2011-10-15 01:14:55 | 显示全部楼层 |阅读模式 来自 中国–云南–临沧
名称:人类灵气
不知道什么原因无法转AMXX文件
高手看看哪里不对


代码:

/*================================================================================

-----------------------------------
-*- [ZP] Extra Item : Player Aura -*-
-----------------------------------

~~~~~~~~~~~~~~~
- Description -
~~~~~~~~~~~~~~~

This is just an extra item which gives the player a player aura. The player
aura helps players to navigate and find zombies throughout the map.

~~~~~~~~~~~~~~~
- CVARS -
~~~~~~~~~~~~~~~
("zp_aura_radius", "20.0")
This is the radius of the aura.
("zp_aura_red", "255")
This is the red colour of the aura.
("zp_aura_green", "255")
This is the green colour of the aura.
("zp_aura_blue", "255")
This is the blue colour of the aura.
("zp_glow_on", "1")
This is to have a glow or not.
("zp_aura_round", "1")
This is whether or not to remove aura every round.

~~~~~~~~~~~~~~~
- Change Logs -
~~~~~~~~~~~~~~~
Version : 1.0
First Release.

Version : 1.1
Added some codes, removed hamsandwich module which wasnt required.

Version : 1.2
Changed almost all of the codes, thanks to alan_el_more for his help.

Version : 1.3
Fixed bug with some codes where player doesnt get aura after buying it.
(Had to change most of the codes back to the old ones. Sorry alan_el_more)

Version : 1.4
Added a CVAR for players to have a glow or not.
Also updated codes so that you lose the aura on every respawn.

Version : 1.5
Want to have the aura every round? Added a CVAR for that.
Check the CVARs section above for the information.

Version : 1.6
Fixed a minor misplacement of a code. Glow color should be okay now.

================================================================================*/

#include <amxmodx>
#include <fakemeta>
#include <fakemeta_util>
#include <zombieplague>

/*================================================================================
[Plugin Customization]
=================================================================================*/

new const g_item_name[] = { "Player Aura" }
const g_item_cost = 10
new const g_sound_buyaura[] = { "items/nvg_on.wav" }

/*============================================================================*/

new g_itemid_playeraura, g_extra_glow, g_aura_round

public plugin_precache()
{
        precache_sound(g_sound_buyaura)
}

public plugin_init()
{
        register_plugin("[ZP] Extra Item: Player Aura", "1.6", "Zombie Lurker")
       
        g_itemid_playeraura = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)
        g_extra_glow = register_cvar("zp_glow_on", "1")
        g_aura_round = register_cvar("zp_aura_round", "1")
       
        register_cvar("zp_aura_radius", "20.0")
        register_cvar("zp_aura_red", "255")
        register_cvar("zp_aura_green", "255")
        register_cvar("zp_aura_blue", "255")
}

public zp_extra_item_selected(player, itemid)
{
if (itemid == g_itemid_playeraura)
{
set_task(0.1, "BUYAURA", player, _, _, "b")
set_task(0.2, "BUYGLOW", player, _, _, "b")
engfunc(EngFunc_EmitSound, player, CHAN_BODY, g_sound_buyaura, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
}

public BUYAURA(player)
{
if ((!zp_get_user_zombie(player)) && (is_user_alive(player)))
{
        static Float:originF[3]
        pev(player, pev_origin, originF)
       
        engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
        write_byte(TE_DLIGHT)
        engfunc(EngFunc_WriteCoord, originF[0]) // x
        engfunc(EngFunc_WriteCoord, originF[1]) // y
        engfunc(EngFunc_WriteCoord, originF[2]) // z
        write_byte(get_cvar_num("zp_aura_radius")) // radius
        write_byte(get_cvar_num("zp_aura_red")) // red
        write_byte(get_cvar_num("zp_aura_green")) // green
        write_byte(get_cvar_num("zp_aura_blue")) // blue
        write_byte(2) // life
        write_byte(0) // decay rate
        message_end()
        }
        else
        {
        if (get_pcvar_num(g_aura_round))
                remove_task(player)
        }
return PLUGIN_CONTINUE
}

public BUYGLOW(player)
{
if ((!zp_get_user_zombie(player)) && (is_user_alive(player)) && (get_pcvar_num(g_extra_glow)))
{
        fm_set_rendering(player, kRenderFxGlowShell, (get_cvar_num("zp_aura_red")), (get_cvar_num("zp_aura_green")), (get_cvar_num("zp_aura_blue")), kRenderNormal, 16);
        }
return PLUGIN_CONTINUE
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
发表于 2011-10-17 15:23:33 | 显示全部楼层 来自 中国–广东–深圳–福田区
可以啊,你没有加zombieplague的头文件吧.?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

 楼主| 发表于 2011-10-18 06:30:09 | 显示全部楼层 来自 中国–云南–临沧
什么意思 不明白 !
回复

使用道具 举报

 楼主| 发表于 2011-10-26 07:26:19 | 显示全部楼层 来自 中国–云南–临沧
OK谢谢 已经决绝了
回复

使用道具 举报

发表于 2011-10-26 17:30:19 | 显示全部楼层 来自 中国–广东–梅州
这个没见过,帮顶。。
回复

使用道具 举报

发表于 2011-12-13 11:20:26 | 显示全部楼层 来自 中国–江苏–淮安
顶,顶,顶你下 啊啊
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表