Raised This Month: $ Target: $400
 0% 

how to set a permanent command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SPT1
Senior Member
Join Date: Aug 2012
Old 08-23-2015 , 11:14   how to set a permanent command
Reply With Quote #1

how can i make this mode permanent?
i want to keep it turned on always even if the admin leaves or map changes
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>")

__________________
AMXMODX
SPT1 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-23-2015 , 11:19   Re: how to set a permanent command
Reply With Quote #2

Just put the command in amxx.cfg.
__________________
fysiks is offline
SPT1
Senior Member
Join Date: Aug 2012
Old 08-23-2015 , 12:22   Re: how to set a permanent command
Reply With Quote #3


this is how my amxx.cfg looks like
how to fix this?
http://pasteboard.co/66ExcN5.jpg
__________________
AMXMODX

Last edited by SPT1; 08-23-2015 at 12:23.
SPT1 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-23-2015 , 12:35   Re: how to set a permanent command
Reply With Quote #4

Use a source code editor like Notepad++ (never use Windows Notepad).
__________________
fysiks is offline
SPT1
Senior Member
Join Date: Aug 2012
Old 08-23-2015 , 12:42   Re: how to set a permanent command
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
Use a source code editor like Notepad++ (never use Windows Notepad).
thanks, Worked
__________________
AMXMODX
SPT1 is offline
SPT1
Senior Member
Join Date: Aug 2012
Old 08-23-2015 , 12:58   Re: how to set a permanent command
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
Just put the command in amxx.cfg.
it didn't work
it only enables wen i type that command in console and if i disconnect it disables again
__________________
AMXMODX
SPT1 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-23-2015 , 17:02   Re: how to set a permanent command
Reply With Quote #7

Oh, I didn't read closely enough. It's a command for a player to use. So, the way that it's written, you can't set it permanently.
__________________
fysiks is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 08-23-2015 , 17:37   Re: how to set a permanent command
Reply With Quote #8

I fixed it for your, now its always working.

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 client_putinserver id )
{
    
set_user_hitzones(,02)
}

public 
plugin_init() 

    
register_plugin("Aim Practice","1.0","James Romeril"

Attached Files
File Type: sma Get Plugin or Get Source (aim_prac.sma - 542 views - 765 Bytes)
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 08-23-2015 , 18:09   Re: how to set a permanent command
Reply With Quote #9

I made i new version, that by default came with it active, to deactivate, use "aim_prac 0 0" on game console. It worked for your?

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.
    v1.1
    * Added switch between on and off.

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> 

new isActive

public client_putinserver id )
{
    if( !
isActive )
    {
        
set_user_hitzones(,02)
    }
}

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"))) 
    { 
        
isActive 0
        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)
        
isActive 1
        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 1|off 1> or <1 1|0 0>"
    
isActive 0

Attached Files
File Type: sma Get Plugin or Get Source (aim_prac.sma - 584 views - 1.8 KB)
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 08-23-2015 at 18:09.
addons_zz 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 03:00.


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