Raised This Month: $ Target: $400
 0% 

need to add a cvar to this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BeSt2013
Senior Member
Join Date: Mar 2013
Location: Egypt
Old 11-01-2013 , 15:09   need to add a cvar to this plugin
Reply With Quote #1

i want to add a cvar to this plugin (Aim Practice)
to make it always on
bec i must type in console when map change [aim_prac 1 , aim_prac on] to get work
pls help

PHP Code:
/* AMX Mod X Aim Practice.

I know there is a plugin that already allows only headshots.
I made it because i found it to be very buggy, so if you only
want the headshot mode, use this :)

Version History: -
    First release: 1.0
    Fixed print_chat from id, to all. Now everyone knows when its enabled

Usage: -
    aim_prac <on|off> or  <1|0>
    
Get the latest version at: -
    http://www.amxmodx.org/forums/viewtopic.php?p=31377#31377

 (c) 2003, James "rompom7" Romeril
 This file is provided as is (no warranties).
*/

#include <amxmodx>
#include <fun>

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

    if((
equali(arg"on"))||(equali(arg"1")))
    {
        
set_user_hitzones(,02)
        
client_print(idprint_console"[AMXX] ENABLED Headshot only mode")
        
client_print(0print_chat"[AMXX] ENABLED Headshot only mode")
    }
    else
    {
        
set_user_hitzones(00255)
        
client_print(idprint_console"[AMXX] DISABLED Headshot only mode")
        
client_print(0print_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>")

BeSt2013 is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 11-01-2013 , 16:35   Re: need to add a cvar to this plugin
Reply With Quote #2

Just add the command to your config file.
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
BeSt2013
Senior Member
Join Date: Mar 2013
Location: Egypt
Old 11-01-2013 , 16:53   Re: need to add a cvar to this plugin
Reply With Quote #3

i added the command to amxx.cfg and server.cfg and not working
i must type it in console game
BeSt2013 is offline
AvaStIn
Senior Member
Join Date: Feb 2013
Location: Algeria
Old 11-01-2013 , 17:11   Re: need to add a cvar to this plugin
Reply With Quote #4

does this help??
PHP Code:
#include <amxmodx>
#include <fun>

new g_aimpac;

public 
plugin_init()
{
    
register_plugin("Aim Practice","1.0","James Romeril")
    
g_aimpac register_cvar"amx_aimpac""1" );

}  


public 
client_connectid )
{
    if( 
get_pcvar_numg_aimpac ) != )
    {
        
set_user_hitzones(,02)
        
client_print(idprint_console"[AMXX]THE Headshot only mode is ENABLED")
        
client_print(idprint_chat"[AMXX] THE Headshot only mode is ENABLED")
    }
    else
    {
        
set_user_hitzones(00255)
        
client_print(idprint_console"[AMXX] THE Headshot only mode is DISABLED")
        
client_print(idprint_chat"[AMXX] THE Headshot only mode is DISABLED")
    }
    return 
PLUGIN_HANDLED

__________________
Project : Speedrun / Fastrun / CrazySpeed & [FPS CATEGORY]

o [
||||||||||||||||||||] - 95%

Project : Upgraded Drshop To V6.0

o [||||||||||||||||||||]- 100%

Last edited by AvaStIn; 11-01-2013 at 17:15.
AvaStIn is offline
BeSt2013
Senior Member
Join Date: Mar 2013
Location: Egypt
Old 11-03-2013 , 17:50   Re: need to add a cvar to this plugin
Reply With Quote #5

Quote:
Originally Posted by AvaStIn View Post
does this help??
PHP Code:
#include <amxmodx>
#include <fun>

new g_aimpac;

public 
plugin_init()
{
    
register_plugin("Aim Practice","1.0","James Romeril")
    
g_aimpac register_cvar"amx_aimpac""1" );

}  


public 
client_connectid )
{
    if( 
get_pcvar_numg_aimpac ) != )
    {
        
set_user_hitzones(,02)
        
client_print(idprint_console"[AMXX]THE Headshot only mode is ENABLED")
        
client_print(idprint_chat"[AMXX] THE Headshot only mode is ENABLED")
    }
    else
    {
        
set_user_hitzones(00255)
        
client_print(idprint_console"[AMXX] THE Headshot only mode is DISABLED")
        
client_print(idprint_chat"[AMXX] THE Headshot only mode is DISABLED")
    }
    return 
PLUGIN_HANDLED

great , it's works
ty very much
BeSt2013 is offline
Reply



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 00:11.


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