Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // V-Man's add2list - Quickly append something to a list, without add2alias'es ";"
- add2list = [ if (strcmp "" (getalias $arg1)) [ $arg1 = $arg2 ] [ $arg1 = (concat (getalias $arg1) $arg2) ] ]
- // Initialize the list (if it doesn't already exist) using the current gamma as initial values.
- if (! (checkalias ofc_gamma_list)) [
- ofc_gamma_list = [ ]
- loop ogl (listlen $defaultmaps) [
- add2list ofc_gamma_list $gamma
- ]
- ]
- // setgamma - allows clients to set custom gamma values for each official map, disabling/enabling the entire system
- // can be done with the dyngamma variable.
- setgamma = [
- if (&& (<= $arg1 300) (>= $arg1 30)) [
- if (strstr $defaultmaps (curmap 1)) [
- tmp_gamma_list = $ofc_gamma_list
- ofc_gamma_list = [ ]
- cmapp = (findlist $defaultmaps (curmap 1)) // Find the position in the list of the current map
- loop sgl (listlen $defaultmaps) [
- if (= $sgl $cmapp) [ // Add the new gamma at the correct position in the list
- add2list ofc_gamma_list $arg1
- ] [
- add2list ofc_gamma_list (at $tmp_gamma_list $sgl)
- ]
- ]
- echo (c 1)Note: (c 5) $arg1 has been set as your default gamma for (c 2) (curmap 1)
- ] [
- echo (c 3)Error: (c 5)You are not on a official map!
- ]
- ] [
- echo (c 3)Error: (c 5)gamma has a minimum value of 30 and maximum value of 300!
- ]
- ]
- // Plugin to mapstartalways on every run if it doesn't already exist.
- if (! (checkalias dyngamma)) [ dyngamma = 0 ]
- if (! (checkalias mapstartalways)) [ mapstartalways = [ ] ]
- if (! (strstr $mapstartalways dyngamma)) [
- add2alias mapstartalways [
- if $dyngamma [ gamma (at $ofc_gamma_list (findlist $defaultmaps (curmap 1))) ]
- ]
- ]
Advertisement
Add Comment
Please, Sign In to add comment