Raised This Month: $ Target: $400
 0% 

How/what code to add to turn a plugin on/off?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 05-03-2006 , 23:14   How/what code to add to turn a plugin on/off?
Reply With Quote #1

I have tried using
Code:
register_concmd(amx_nng 1, check_noobguns)
thats not exact, but what is the right way to do it? or does it depend?
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
Smokey485
Senior Member
Join Date: Dec 2004
Location: Newt 'Ellin
Old 05-03-2006 , 23:32  
Reply With Quote #2

Woah woah, that is horrid code, it seems that your new to AMXX


Alright, heres what you would do

Code:
#include <amxmodx> #include <amxmisc> #include <fun> // probably needed for what you want to do. public plugin_init() { register_concmd("amx_nng", "check_noobguns", ADMIN_ALL, "amx_nng name") } public check_noobguns(id) { new arg[33] read_argv(1, arg, 32) // get what the admin typed in for name new target = cmd_target(id, arg, 3) // whatever your purpose was }
__________________
+karma if I am helpful to you.
I am one in a few million.
Smokey485 is offline
Send a message via AIM to Smokey485 Send a message via MSN to Smokey485
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 05-03-2006 , 23:42  
Reply With Quote #3

and that would turn a plugin on and off?

"amx_nng name" <---- ?
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 05-03-2006 , 23:43  
Reply With Quote #4

It depends on the plugin. You would have to code into the plugin a way to turn it on and off. What plugin are you trying to add that to?
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 05-03-2006 , 23:43  
Reply With Quote #5

the one i have been making, nonoobguns
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 05-04-2006 , 01:33  
Reply With Quote #6

Code:
#include <amxmodx>       #include <amxmisc>     #include <cstrike> #include <fun>       public plugin_init()       {           register_plugin("Nonoobguns", "1.4", "Allenwr")           register_concmd("amx_nng", "check_noobguns", ADMIN_ADMIN, "amx_nng name") // Need help here     register_event("WeapPickup", "check_noobguns", "b")           register_cvar("amx_nonoobguns", "1")       } public check_noobguns(id)       {           if(get_cvar_num("amx_nonoobguns") != 1 || !is_user_alive(id))               return PLUGIN_CONTINUE

this is only a portion, but im not sure on how to finish it right, so it is amx_nng 1 for on and amx_nng 0 for off
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 05-04-2006 , 12:04  
Reply With Quote #7

bump.
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
VEN
Veteran Member
Join Date: Jan 2005
Old 05-04-2006 , 12:39  
Reply With Quote #8

Here is simple example just to show you the idea:
[edit: hm, i think you wanted not that...]

Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("Nonoobguns", "1.4", "Allenwr")     register_concmd("amx_nng", "check_noobguns", ADMIN_ADMIN, "[0|1]")     register_cvar("amx_nonoobguns", "1") } public check_noobguns(id, level, cid) {     if (!cmd_access(id, level, cid, 1))         return PLUGIN_HANDLED     if (read_argc() == 1) { // if no arguments supplied we show current plugin's state         console_print(id, "^"amx_nng^" is ^"%d^"", get_cvar_num("amx_nonoobguns") ? 1 : 0)         return PLUGIN_HANDLED     }     // if argument specified we set new plugin's state (1 is on, 0 is off)     new arg[2]     read_argv(1, arg, 1)     set_cvar_num("amx_nonoobguns", str_to_num(arg) ? 1 : 0)     return PLUGIN_HANDLED }
VEN is offline
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 05-04-2006 , 12:50  
Reply With Quote #9

i think i understand, but im not too sure, can we talk on pm to figure/help me finish this part of my project?
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
VEN
Veteran Member
Join Date: Jan 2005
Old 05-04-2006 , 12:56  
Reply With Quote #10

Better ask here but ok, you can.
VEN 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 05:10.


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