16 Mar 14, 12:04AM
(This post was last modified: 16 Mar 14, 12:09AM by RandumKiwi.)
(15 Mar 14, 11:25PM)Mousikos Wrote: My script suddenly works and I didn't even change it to strstr. Maybe it's just broken on a server... BRB more testing.
strpos would work too (although strstr saves memory i think) because if it doesn't exist it's -1. So just check for -1 XD
"Returns the position of a substring into another"
How would strpos help? Use this instead:
(15 Mar 14, 11:37PM)RandumKiwi Wrote:[SELECT ALL] Code:SERVERSTRINGS = [ STRING1 STRING2 ]
SERVERPASSES = [ ADMINPASS1 ADMINPASS2 ]
sudo = [ if (= (currole) 0) [ loop i (listlen $SERVERSTRINGS) [ if (strstr (curserver 6) (at $SERVERSTRINGS $i)) [ setadmin 1 (at $SERVERPASSES $i); break ] ] ] [ setadmin 0 ] ]
* Note, that all ports on the same IP, must use the same password!
* Note, that each IP in the list, must be in the same order as each password in the list.
For those that like this take-admin script better, it's been updated in the list: http://ac-akimbo.net/showthread.php?tid=...76#pid2876