AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED]add new cvar for old concmd (https://forums.alliedmods.net/showthread.php?t=106339)

One 10-14-2009 04:53

[SOLVED]add new cvar for old concmd
 
PHP Code:

register_concmd("amx_test","do_it_now",ADMIN_RCON," Between 0 & 30 )"

this is my old concmd which i used in one plug-in. now i can't find my sma anymore & i dont want to remake my plug-in again.now i want to know how can i make a task "0.5" & new cvar which works for example so :


amx_haha <minimum> <maximum> <1 = on , 0 = off>

in my task i want to change the amx_test cvar every 0.5 sec. to the numbers which my admin want. again a example :


Code:

Cvar                Min.            Max.      ON/OFF
amx_haha          2              28              1

in task =

in first 0.5 sec. = amx_test 2
in sec. 0.5 sec. = amx_test 28
in third 0.5 sec. = amx_test 2
& ....

fysiks 10-14-2009 12:41

Re: add new cvar for old concmd
 
Uh? amx_test isn't a cvar.

One 10-14-2009 12:53

Re: add new cvar for old concmd
 
example? i writed 1 year ago a plugin & now i dont have the sma anymore & i dont want to rewrite the plug-in :( when i use this as script like :

amx_EXAMPLE 2;wait;amxEXAMPLE 20;wait...........

is a little bit silly & i cant do anything. i tough i can do it with a plugin to turning the plugin on/off.

fysiks 10-14-2009 13:16

Re: add new cvar for old concmd
 
Quote:

Originally Posted by One (Post 961707)
example? i writed 1 year ago a plugin & now i dont have the sma anymore & i dont want to rewrite the plug-in :( when i use this as script like :

Code:

amx_EXAMPLE 2;wait;amxEXAMPLE 20;wait
is a little bit silly & i cant do anything. i tough i can do it with a plugin to turning the plugin on/off.

I still don't get it. What does your "missing sma" plugin do?

One 10-14-2009 13:34

Re: add new cvar for old concmd
 
hmmm...

ok i say it with an example :Day light

i hope you know this plugin.
here we have a cvar = amx_light 0-28.

so i want to make a plugin which turns amx_light to that what i want in loop.

when i use amx_makelight 2 20 1 then my plugin changes cvar amx_light to 2 and after 0.5 sec. changes to amx_light 20. when i use amx_makelight 0, so is my loop off. :((

i hope you understand. i dont know how to write it with examples :(

minimiller 10-14-2009 13:46

Re: add new cvar for old concmd
 
set a looping task
increment a value
switch the value

One 10-14-2009 14:02

Re: add new cvar for old concmd
 
yay but i dont know how can i get the value :

amx_cvar <first.value> <secund.value> <ON/OFF>

fysiks 10-14-2009 14:35

Re: add new cvar for old concmd
 
I thought you assign the value.

One 10-14-2009 14:38

Re: add new cvar for old concmd
 
all my admins can use this cvar.:(
idk which values they will use.

fysiks 10-14-2009 14:55

Re: add new cvar for old concmd
 
Quote:

Originally Posted by One (Post 961868)
all my admins can use this cvar.:(
idk which values they will use.

From what you've told us, there is no cvar. Only a console command. There is no need to know what they use if it's a command that they input into console. In your new plugin just take them in as arguments then do the task thing.


All times are GMT -4. The time now is 22:42.

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