Raised This Month: $90 Target: $400
 22% 

Headshot Only just for who write


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
roniold
New Member
Join Date: Mar 2019
Old 03-15-2019 , 03:10   Headshot Only just for who write
Reply With Quote #1

Hello. I want help with a plugin for headshot only.

It's possible to make the plugin:
Code:
#include <amxmodx>
#include <fun>

public aim_prac(id)
{
	if (id && !((get_user_flags(id) & ADMIN_LEVEL_A)))
	{
		client_print(id, print_console, "[AMXX] You do not have access to this command")
		return PLUGIN_CONTINUE
	}
	new arg[8]
	read_argv(1, arg, 7)

	if((equali(arg, "on"))||(equali(arg, "1")))
	{
		set_user_hitzones(0 ,0, 2)
		client_print(id, print_console, "[AMXX] ENABLED Headshot only mode")
		client_print(0, print_chat, "[AMXX] ENABLED Headshot only mode")
	}
	else
	{
		set_user_hitzones(0, 0, 255)
		client_print(id, print_console, "[AMXX] DISABLED Headshot only mode")
		client_print(0, print_chat, "[AMXX] DISABLED Headshot only mode")
	}
	return PLUGIN_HANDLED
}

public plugin_init()
{
	register_plugin("Aim Practice","1.0","James Romeril")
	register_concmd("aim_prac", "aim_prac", ADMIN_LEVEL_A, "aim_prac <on|off> or <1|0>")
}
to activate just for who write /hsonly 1?

Example:
When I write /hsonly 1, the server will activate Headshot Only just for me, not for all. Can you make this, please?
Thank you very much!
roniold is offline
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 03-15-2019 , 04:31   Re: Headshot Only just for who write
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <fun>


public plugin_init()
{
    
register_plugin("Aim Practice","1.0","James Romeril")
    
register_clcmd("say""aim_prac"ADMIN_ALL)
}

public 
aim_prac(id)
{
    new 
said[32]
    
read_args(said,charsmax(said))
    
remove_quotes(said)
    
    new 
arg1[8], arg2[8]
    
parse(saidarg17arg27)

    
    if(
equali(arg1"/hsonly")){
        
        
        if((
equali(arg2"on"))||(equali(arg2"1")))
        {
            
set_user_hitzones(id ,02)
            
client_print(idprint_console"[AMXX] You ENABLED Headshot only mode")
            
client_print(idprint_chat"[AMXX] You ENABLED Headshot only mode")
        }
        else
        {
            
set_user_hitzones(id0255)
            
client_print(idprint_console"[AMXX] You DISABLED Headshot only mode")
            
client_print(idprint_chat"[AMXX] You DISABLED Headshot only mode")
        }
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE


Last edited by Moody92; 03-15-2019 at 05:24.
Moody92 is offline
roniold
New Member
Join Date: Mar 2019
Old 03-15-2019 , 04:55   Re: Headshot Only just for who write
Reply With Quote #3

Hi, Moody!

It's working.

Thank you very much for your time!
roniold is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:36.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode