Hello, I need some 'help' on my plugin and need someone to fix it for me please?
This is susposed to change a CVAR, but it's not. What I'm trying to do is create a command in this case "amx_npckill" and make it so it will change a allready built-in cvar, in this case "killnpc".
amx_npckill - The created command.
killnpc - Allready built-in command
(svencoop had it).
Do you get me? amx_npckill 0 should change killnpc to 0, and vise versa.
But theres just one little problem.. It won't work it compiles but just doesn't work. Can someone get it too work please?
PHP Code:
#include <amxmodx>
#define PLUGIN "NPC Protector"
#define VERSION "1.0"
#define AUTHOR "Dark Kingdom"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("amx_npckill","1")
register_concmd("killnpc","killnpc")
}
public killnpc() {
if ( get_cvar_num( "amx_npckill" ) >= 1 ) set_cvar_num( "killnpc" , 1 ) //off
client_print(0,print_chat, "[NPC Protector] ADMIN has turned the plugin off, NPC's can be killed.")
if ( get_cvar_num( "amx_npckill" ) <= 0 ) set_cvar_num( "killnpc" , 0 ) //on
client_print(0,print_chat,"[NPC Protector] ADMIN has turned the plugin on, NPC's can't be killed.")
}
Thanks.