AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Cvar Plugin CFG (https://forums.alliedmods.net/showthread.php?t=135618)

totalcsscripting 08-17-2010 20:33

Cvar Plugin CFG
 
I want to be able to modify my plugin with a cvar. So, if the cvar is in 1, the plugin will still run with amx_off. If the cvar is 0, it won't.

I already tried this, but didn't worked

PHP Code:

mix register_cvar("totalcs_mix","0")

public 
plugin_cfg() {
    if(
get_pcvar_num(mix)==1){
        if(
is_plugin_loaded("Pause Plugins") != -1)
        
server_cmd("amx_pausecfg add ^"%s^""PLUGIN)
    }



platzpatrone 08-17-2010 20:57

Re: Cvar Plugin CFG
 
u know that if amx is off then no plugin for amxx can run ? :shock:

totalcsscripting 08-17-2010 21:35

Re: Cvar Plugin CFG
 
Quote:

Originally Posted by platzpatrone (Post 1274054)
u know that if amx is off then no plugin for amxx can run ? :shock:


You are wrong.

Alucard^ 08-17-2010 22:57

Re: Cvar Plugin CFG
 
Quote:

Originally Posted by platzpatrone (Post 1274054)
u know that if amx is off then no plugin for amxx can run ? :shock:

You know that admin commands (from amxx default) are plugin? then why amx_on work when amx is off? :3

#8 SickneSS 08-17-2010 23:11

Re: Cvar Plugin CFG
 
Quote:

Originally Posted by totalcsscripting (Post 1274032)
I want to be able to modify my plugin with a cvar. So, if the cvar is in 1, the plugin will still run with amx_off. If the cvar is 0, it won't.

I already tried this, but didn't worked

PHP Code:

mix register_cvar("totalcs_mix","0")

public 
plugin_cfg() {
    if(
get_pcvar_num(mix)==1){
        if(
is_plugin_loaded("Pause Plugins") != -1)
        
server_cmd("amx_pausecfg add ^"%s^""PLUGIN)
    }



Thats write the plugin.cfg,you must delete it.

totalcsscripting 08-17-2010 23:15

Re: Cvar Plugin CFG
 
Quote:

Originally Posted by #8 SickneSS (Post 1274159)
Thats write the plugin.cfg,you must delete it.

I ndon't understand what did you said.

I want that my plugin can run with amx_off just like mixmaker:wink: but i want to gave the admin the posibility of choosing.

fysiks 08-17-2010 23:20

Re: Cvar Plugin CFG
 
Quote:

Originally Posted by platzpatrone (Post 1274054)
u know that if amx is off then no plugin for amxx can run ? :shock:

That is incorrect.
Quote:

Originally Posted by totalcsscripting (Post 1274086)
You are wrong.

That is correct.
Quote:

Originally Posted by #8 SickneSS (Post 1274159)
Thats write the plugin.cfg,you must delete it.

That is incorrect. You don't know what you are talking about.
Quote:

Originally Posted by totalcsscripting (Post 1274161)
I ndon't understand what did you said.

He does not know what he is talking about.

So, probably the best solution is to remake the amx_off command to exclude certain plugins from the pausing process. Or, make an alternative to amx_off.

totalcsscripting 08-17-2010 23:27

Re: Cvar Plugin CFG
 
Quote:

Originally Posted by fysiks (Post 1274165)
That is incorrect.

That is correct.

That is incorrect. You don't know what you are talking about.

He does not know what he is talking about.

So, probably the best solution is to remake the amx_off command to exclude certain plugins from the pausing process. Or, make an alternative to amx_off.

PHP Code:

public plugin_cfg() {
    if(
is_plugin_loaded("Pause Plugins") != -1){
            
server_cmd("amx_pausecfg add ^"%s^""PLUGIN)
    }
        


I think we all now that adding this to my plugin, it wont stop with amx_off.

Well, i want to be able to set the posibility of execute this function with a cvar.

If the cvar is 1, it wont stop. if it is 0 it will stop

#8 SickneSS 08-17-2010 23:34

Re: Cvar Plugin CFG
 
Quote:

Originally Posted by fysiks (Post 1274165)
That is incorrect. You don't know what you are talking about.

Thats doesn't edit the pauseplugins.cfg ? :P Sorry

platzpatrone 08-17-2010 23:36

Re: Cvar Plugin CFG
 
damn, my fault i read it wrong, i read it that he mean amxx off -> comment them in metamods plugin.ini so it is totally deactivated, damn, sorry. :oops:


All times are GMT -4. The time now is 21:56.

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