guoxiangwei 发表于 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
        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
        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

lxyzmxcssa 发表于 2004-8-14 17:42:38

拽。。。。。。。。。

guoxiangwei 发表于 2004-8-14 17:50:49

不用了,已经可以运行了!谢谢!
页: [1]
查看完整版本: 我想做个爆头插件,为什么没有效果?哪位指点一下