Raised This Month: $ Target: $400
 0% 

Plugin Optimize


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Dark Kingdom
BANNED
Join Date: Apr 2007
Location: VT
Old 04-09-2007 , 23:02   Plugin Optimize
Reply With Quote #1

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(PLUGINVERSIONAUTHOR)
    
    
register_cvar("amx_npckill","1")
    
register_concmd("killnpc","killnpc")
    
}

public 
killnpc() {
    if ( 
get_cvar_num"amx_npckill" ) >= set_cvar_num"killnpc" //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" ) <= set_cvar_num"killnpc" //on
    
client_print(0,print_chat,"[NPC Protector] ADMIN has turned the plugin on, NPC's can't be killed.")
    

Thanks.
Dark Kingdom is offline
 



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 06:42.


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