Amx UnConstant Cvar v1.1 (2 - 20 - 05)

Post Reply
greenie
Full Member
Full Member
Posts: 1815
Joined: Sun Nov 21, 2021 4:55 pm
Jucator SA:MP ?: Nu
Nick:: greenie
Jucator CS ?: Nu

Amx UnConstant Cvar v1.1 (2 - 20 - 05)

Post by greenie »

Amx UnConstant Cvar - v1.1, by Suicid3

Description:
Amx UnConstant is used to have a cvar switch between different values. With a certain amount of time between each value. Ability to hold any number of values. (But must be set-up in .sma before compile)

Commands: (Look below at example commands)
amx_unconstant <Cvar> <Value 1> <Value 2> [<Value 3> ...]
Must have atleast two values to switch between or it defeats the purpose.
amx_constant <Cvar> <Value>
Stops changing values and sets the cvar to the value supplied.

Cvars:
amx_unconst_rate 2.0
The time between unconstant cvar changes.(Don't set too low)
amx_unconst_allow_multiples 0
Allows/Disallows the same unconstant cvar to be used simlutaniously

Required Modules:
None

More to Know:
//The max number of unconstant cvars
#define MAX_UNCONSTANTS 26

//The max number of values for each unconstant cvar
#define MAX_VALUES 6

Change log:

v1.0 -- Initial Release
v1.1 -- Added functionality for using quotes inside of quotes.
-- Fixed bug while adding the optional quotes.

Example Commands:
Originally Posted by Badly formatted command line
]amx_unconstant sv_password"Here I am"I LikeThis
[UnConst] Successfully initiated unconstant values for cvar sv_password
[UnConst] 1. Here I am
[UnConst] 2. I
[UnConst] 3. LikeThis
Originally Posted by Well formatted command line
] amx_unconstant sv_password "Here I am" I LikeThis
[UnConst] Successfully initiated unconstant values for cvar sv_password
[UnConst] 1. Here I am
[UnConst] 2. I
[UnConst] 3. LikeThis
Originally Posted by Badly formatted command line
] amx_unconstant sv_password "Using ^"quotes^""again here"I am"
[UnConst] Successfully initiated unconstant values for cvar sv_password
[UnConst] 1. Using "quotes"
[UnConst] 2. again
[UnConst] 3. here
[UnConst] 4. I am
Originally Posted by Well formatted command line
] amx_unconstant sv_password "Using ^"quotes^"" again here "I am"
[UnConst] Successfully initiated unconstant values for cvar sv_password
[UnConst] 1. Using "quotes"
[UnConst] 2. again
[UnConst] 3. here
[UnConst] 4. I am

Using the Commands:

Using amx_unconstant:
- You may use quotes within quotes with the ^ (carrot) infront of the quote (Example above)
- The cvar (first argument) can either be in or out of a quote.
- Must have atleast two cvar values to switch between.
- Values can NOT be blank they will not be read.
Using amx_constant:
- The cvar comes first. Then the constant value for it comes next.
- No value after and it is set as blank.(possibly screw some plugins up be careful)


Still don't get it?
Let's use for instance sv_gravity. We set the different values at 250 550 300 600 and it will loop through these values. So you're running and you happen to jump (at this second gravity is at 300) so you get up a decent height and then BOOM! it's back up to 600 and you start to fall faster than you thought and miss your platform :D.
Or you could set it up to change the hostname to different things everyfew seconds so people can see different things. (This sadly will help the guy who wanted a scrolling hostname)
Or you could screw around with hook cvars (making it hook faster then slower and pull you faster and slower and other little things like this).
This is only limitless to the amount of plugins you have controlled by cvars.

plugin
source
Post Reply

Return to “General Purpose”