Scripts
Is there any way to get the player name giving the client number?
Is there any way to get the Client Number giving the player name?
Thnks
Edit: Founded, /findcn and /findpn
Thanks given by:
findcn is a marvelous function. You can create kick aliases like /k playername with it.
Thanks given by:
alias gg [say "gg"]
Thanks given by:
i made this script to practise with all weapons, it will randomize my main weapon everytime i die.
//made by macm
alias on_death [
if (= $connected 1) [
if (= (alive) 1) [ded = 0; stp = 1] [
if (= $stp 1) [
if (= $ded 1) [] [rndwep1;    //you can add anything you like in this line, it will be executed when you die (exp. me "died")
ded = 1] ]
[] ] ] [];
sleep 1 [on_death]
]

add2alias mapstartalways [stp = 0; on_death]

rndwep0 = 0
rndwep = [if (= $rndwep0 1) [rndwep0 = 0; echo "rndwep is now off"] [rndwep0 = 1; echo "rndwep is now on"]]

//this is the random weapon alias
alias rndwep1 [
if (= $rndwep0 1) [
rndwep2 = (rnd 4);
nextprimary (+ $rndwep2 2)
] []
]

type /rndwep ingame to set it on/off.

Thanks given by:
I had experimented with those random weapon scripts before and I also used a bunch of ifs. Then someone told me that this wouldn't be completely random because it could check the value of rndwep2 several times before something matches. With each if (= rndwep2 x), the value of rndwep2 is being randomized. The solution is
rndwep2 = (rnd 4)
nextprimary (+ $rndwep2 2)
Thanks given by:
Updated, thanks Gibstick :)
Thanks given by:
For mappers:

Automatic map backup system with configurable intervals...

Ty V-Man for the updated autosaveinitdelay fix! :D

The available commands are:

/autosavemap
/showmenu autosave

When enabled (/autosavemap 1), by default it will save your map the first time 30 seconds (30,000 milliseconds) after launching the map, you must be in editmode (or in coop mode) for it to save. After that it will save your map in intervals of 150,000 milliseconds, or once every 2 and 1/2 minutes. These values can be tweaked via /showmenu autosave. /autosavemap 0 to disable.

Feedback welcomed. Enjoy!
Thanks given by:
DES|Bukz, your a genius.
Thanks given by:
hehe, I'm flattered, there is a noob problem that I'm sure V-Man will point out. It doesn't cripple the backup system, but it does kinda ruin autosaveinitdelay... :p

It was a quick write during a break from the stats script... D:

Fixes are welcomed too. :)
Thanks given by:
Hmm, can't see it...
If you can see it, maybe you should just fix it! :-P
Thanks given by:
Admin Warning Script
Thanks given by:
Using add2alias mapstartalways to set the initial delay won't work, if they want to modify it from the default value via the menu. Not quite sure how to go about fixing actually xD.
Thanks given by:
Remember if you need cubescript help, #cubescript on gamesurge.
Edit: no, this wasn't directed to Bukz, who happens to own the channel.
Thanks given by:
Bukz, I found the problem. Saving the whole line into mapstartalways causes the sleep value to only be evaluated once, while putting it into an alias, then putting the alias into mapstartalways will allow it to be determined each time mapstartalways is executed.
Updated automatic map backup

Mod edit:
Updating url with a minor fix in the strstr check for mapstartalways... :P
Thanks given by:
Link to the raw version so colors are not forked upon copypasta! nub :P

j/k ♥

ty for fixing :D
Thanks given by:
http://pastebin.com/raw.php?i=ZWjSkQ08

Automatic gamma changing script for all official maps. Use:
/autogamma
to bring up the gamma customization menu. Find the value that you prefer for that map, set it, and forget it! That gamma will be automatically set for that map everytime you play. :)
Thanks given by:
or
bind MINUS [ gamma (- $gamma 10); echo Gamma ($gamma) ]
bind EQUALS [ gamma (+ $gamma 10); echo Gamma ($gamma) ]
Thanks given by:
GD (and everyone else), what do you use for scrolling through the text console? Just curious.
Thanks given by:
//Console-scroller
//by grenadier
alias gn_console 0
bind "F11" [
        toggleconsole
        if (= $altconsize 0)[
                if (= $gn_console 0) [
                alias gn_console 2
                ][
                alias gn_console 0
                conskip -1000
                ]
        ][
                if (= $gn_console 0) [
                alias gn_console 1
                ][
                        if (= $gn_console 1)[
                        alias gn_console 2
                        ][
                        alias gn_console 0
                        conskip -1000
                        ]
                ]              
        ]
]
bind "MOUSE4" [ if (< $gn_console 2) [universaldelta 1] [conskip 5] ] //conskip 5 and -5 sets how much the console will scroll.
bind "MOUSE5" [ if (< $gn_console 2) [universaldelta -1] [conskip -5] ] //end of console scroller
Thanks given by:
Scroll wheel, thanks to grenadier.
edit: Gickstib beat me by seconds
Thanks given by:
OOOOHHHAAAHHHH
Putting it in a domodifier bind would complete my life!
Great!
Thanks for the idea! :D
Thanks given by:
While we're all here, what's the use of && when it's used in:
bind "F1" [ && (vote 1) [ echo "you voted yes"] ]
Isn't cubescript executed all at once, or does this ensure that it's done at the same time?
Thanks given by:
The most usefull script in the world.

bind "G" "gg"
alias gg [say "gg"]

____________________________

Epic GG :P

bind "H" "epicgg"
alias myname [sleep 500 [name PutYourNameHere]]
alias epicgg [sleep 200 [name Good]; sleep 400 [me "Game !!"]; sleep 600 [myname]]

*I'm learning how to make scripts so be tolerant :)*
Thanks given by:
You can use ($curname).
Thanks given by:
@Gibstick:
Somehow the (vote 1) statement is only evaluated as "true" (1) if a vote is successfully cast; if you've already voted, or there is no vote pending, the statement evaluates as false. I've also been a bit intrigued by that.
Thanks given by:
(27 Nov 10, 05:31PM).ExodusS* Wrote: The most usefull script in the world.

bind "G" "gg"
alias gg [say "gg"]

You can simplify that to:

bind G "say gg"
Thanks given by:
You know what'd be funny?

bind "G" "gg"
alias gg [gg]
Thanks given by:
lawl.
Put that in this thread.
Thanks given by:
For those of you who crash frequently...

/bind w "writecfg; writecfg"

I'm hoping that's a functional workaround for saving your settings in event of a crash. I won't know until I induce one I suppose.
Thanks given by:
It wouldn't hurt to put it at the end of autoexec.cfg; at least then you aren't writing all the time.
Thanks given by: