搜索
查看: 2396|回复: 2

我想做个爆头插件,为什么没有效果?哪位指点一下

[复制链接]
发表于 2004-8-14 09:55:07 | 显示全部楼层 |阅读模式 来自 中国–河南–洛阳
这是第一个
#include <amxmod>
#include <amxmodx>
#include <amxmisc>


public plugin_init()
{
        register_plugin("headshot", "0.1", "逍遥游");
        register_cvar("sv_headshot", "1")
        register_concmd("amx_headshot", "headshot",ADMIN_RCON," 0,1")                            
            return PLUGIN_CONTINUE
}

public headshot()
{
        new arg[3]
        read_argv(1,arg,2)
        new inum = str_to_num(arg)
       
             if ( !get_cvar_num("sv_headshot") )
             return PLUGIN_CONTINUE
             else
             {                         
        if (inum == 1)
        {
        set_user_hitzones(0, 0, 2)
        client_print(0,print_center,"现在是爆头模式!!!")
        }
        else if(inum == 0)
        {       
        set_user_hitzones(0, 0, 255)
        client_print(0,print_center,"爆头模式已经关闭!!!")
       
        }
             }
        return PLUGIN_HANDLED
}

这是第二个:
#include <amxmod>
#include <amxmodx>
#include <amxmisc>


public plugin_init()
{
        register_plugin("headshot", "0.1", ".逍遥游");
        register_cvar("sv_headshot", "1")
        register_concmd("amx_headshot", "headshot",ADMIN_RCON," 0,1")                            
            return PLUGIN_CONTINUE
}

public headshot()
{
        new arg[3]
        read_argv(1,arg,2)
        new inum = str_to_num(arg)
        new players = get_maxplayers ( )

        if ( !get_cvar_num("sv_headshot") )
        return PLUGIN_CONTINUE
        else
        {         
        new n
        for (n=1;n <= players;n++)
          {
        if (inum == 1)
        {
        set_user_hitzones(0, n, 2)
        client_print(0,print_center,"现在是爆头模式!!!")
        }
        else if(inum == 0)
        {       
        set_user_hitzones(0, n, 255)
        client_print(0,print_center,"爆头模式已经关闭!!!")
        }
        }
        }
        return PLUGIN_HANDLED
}

这个函数执行后,效果看不到
set_user_hitzones()
谁告诉我怎么使用这个函数!
官方:
set_user_hitzones
[ Main ] [ Fun ] [ fun.inc ]
[ comments ]

set_user_hitzones - Sets hit zones for player.

Syntax:
     set_user_hitzones ( index = 0, target = 0, body = 255 )
Type:
    Native
Notes:
Sets hit zones for player.
Parts of body are as bits:
1 - generic
2 - head
4 - chest
8 - stomach
16 - left arm
32 - right arm
64 - left leg
128 - right leg
Set index to a player's index and leave target at 0 to define what bodyparts this player can hit when he is firing.
Set index to 0 and target to a player's index to define what bodyparts on player other players can hit when they are firing.

Set both index and target to 0 to define globally what bodyparts people can hit and what bodyparts can be hit when firing.
Example: ( Make a singel player fire blanks )

set_user_hitzones(index, 0, 0)


Remember, that this funtion does NOT affect grendades & knifes

User Contributed Notes
Add Comment
storm at stormwc3 dot com
Jul-21-04 02:55:46  
there seems to be a bug with the set_user_hitzones in the amxmodx.
i have a blanks plugin, but instead of giving the player blanks, it sets them to godmode (giving everyone blanks when shooting at that player).

code:

new player = cmd_target(id, arg, 5)
if(!player) return PLUGIN_HANDLED
set_user_hitzones(player, 0, 0)

seems to be looking at the code like
set_user_hitzones(0, player, 0)

this plugin worked perfect under amx mod
发表于 2004-8-14 17:42:38 | 显示全部楼层 来自 中国–云南–昆明
拽。。。。。。。。。
回复

使用道具 举报

 楼主| 发表于 2004-8-14 17:50:49 | 显示全部楼层 来自 中国–河南–洛阳
不用了,已经可以运行了!谢谢!
回复

使用道具 举报

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

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