23 Nov 11, 12:23AM
Take the challenge, script it yourself.
here's some tips:
1- Make a list of names.
[cubescript]alias dont_kick_list [unarmed armed unarmored unskilled xxXXXXXX_I_SNIPE_U_DEAD_XXXXXxx][/cubescript]
2- You need something to check your kick (it isn't possible through /kick), like /ckick (bind it to a key if you like: /saycommand "ckick ", or simply make a menu)
[cubescript]alias ckick [...][/cubescript]
3- you will need a loop to match and check if your argument with the names on the list.
[cubescript]alias ckick [
loop i (listlen $dont_kick_list) [if (strcmp (findpl $arg1) (at $dont_kick_list $i)) [] []]
][/cubescript]"loop" restarts to check the "body", adding +1 to "i" (starts on 0) in every loop until "i" = the number of names
"listlen" counts the number of names on your list
"findpl" returns the name of the client number
"strcmp" matches the exact name from the client number with one name from the list
"at" returns the name in the "i" position
"if" executes the first order if the names match, if not execute the second
"arg1" is the first argument given
4- now you need a way to know if the name you are trying to kick was found on the list after the loops. (created "dont_kick")
[cubescript]alias ckick [
dont_kick = 0;
loop i (listlen $dont_kick_list) [if (strcmp $arg1 (at $dont_kick_list $i)) [dont_kick = 1] [
if (= $dont_kick 1) [echo "Cannot kick, name on the dont_kick_list!"] [kick $arg1]
][/cubescript]"dont_kick" is checked on every loop, if the result is 0 we are free to kick.
5- I always rename and save $arg1 in this situations because it might change when you execute another command giving another argument (renamed it "someone").
[cubescript]alias ckick [
someone = $arg1;
dont_kick = 0;
loop i (listlen $dont_kick_list) [if (strcmp $someone (at $dont_kick_list $i)) [dont_kick = 1] []];
if (= $dont_kick 1) [echo "Cannot kick, name on the dont_kick_list!"] [kick $someone]
][/cubescript]
I did not test it, i'm not sure if it'll work. Test it youself, fix it if necessary. :D
here's some tips:
1- Make a list of names.
[cubescript]alias dont_kick_list [unarmed armed unarmored unskilled xxXXXXXX_I_SNIPE_U_DEAD_XXXXXxx][/cubescript]
2- You need something to check your kick (it isn't possible through /kick), like /ckick (bind it to a key if you like: /saycommand "ckick ", or simply make a menu)
[cubescript]alias ckick [...][/cubescript]
3- you will need a loop to match and check if your argument with the names on the list.
[cubescript]alias ckick [
loop i (listlen $dont_kick_list) [if (strcmp (findpl $arg1) (at $dont_kick_list $i)) [] []]
][/cubescript]"loop" restarts to check the "body", adding +1 to "i" (starts on 0) in every loop until "i" = the number of names
"listlen" counts the number of names on your list
"findpl" returns the name of the client number
"strcmp" matches the exact name from the client number with one name from the list
"at" returns the name in the "i" position
"if" executes the first order if the names match, if not execute the second
"arg1" is the first argument given
4- now you need a way to know if the name you are trying to kick was found on the list after the loops. (created "dont_kick")
[cubescript]alias ckick [
dont_kick = 0;
loop i (listlen $dont_kick_list) [if (strcmp $arg1 (at $dont_kick_list $i)) [dont_kick = 1] [
if (= $dont_kick 1) [echo "Cannot kick, name on the dont_kick_list!"] [kick $arg1]
][/cubescript]"dont_kick" is checked on every loop, if the result is 0 we are free to kick.
5- I always rename and save $arg1 in this situations because it might change when you execute another command giving another argument (renamed it "someone").
[cubescript]alias ckick [
someone = $arg1;
dont_kick = 0;
loop i (listlen $dont_kick_list) [if (strcmp $someone (at $dont_kick_list $i)) [dont_kick = 1] []];
if (= $dont_kick 1) [echo "Cannot kick, name on the dont_kick_list!"] [kick $someone]
][/cubescript]
I did not test it, i'm not sure if it'll work. Test it youself, fix it if necessary. :D