30 Dec 12, 08:29PM
(30 Dec 12, 06:05PM)Bukz Wrote: Such scripts will be easier to write in the next version of assaultcube. (coming soon)
It will be very easy to get a client's current number of teamkills.
[cubescript]echo (player CN tks)[/cubescript]
That will be essential for creating the script of course. The only way I can think to count teamkills in the current version is to use a recursive alias that constantly scans $conline for text indicating a teamkill. (e.g. unarmed fragged/gibbed/headshot/etc. teammate blah) Problem is this is quite an unreliable method. The script will miss teamkills its only a matter of time. Not to mention the many problems you run into when 2 or more people have the same name on the server.
Solution: Wait until the next version where it will be much easier to write such scripts as well as having them be more reliable. Heres an example of what the script might look like in the upcoming version:
[cubescript]const MAX_TEAMKILLS_PER_ROUND 6 // if a player has more than this number of teamkills they should be autokicked by the script
const MILLIS_BETWEEN_TK_CHECKS 5000 // run the script once every 5 seconds
const MILLIS_BETWEEN_AUTOKICKS 2000 // if multiple people are to be autokicked, wait this many milliseconds before kicking the next player
checkinit mapstartalways [ if (&& $connected (curmodeattr team)) CHECK_TEAMKILLS ] // plug the script into mapstartalways for full automation
CHECK_TEAMKILLS = [
if (currole) [ // you must have admin status on the server for the script to work properly
clients_to_kick = ""
loop i 21 [
if (!= $i (player1 cn)) [ // you (the admin) are exempt from teamkill checks
if (isclient $i) [
if (> (player $i tks) $MAX_TEAMKILLS_PER_ROUND) [
add2list clients_to_kick $i
]
]
]
]
if (listlen $clients_to_kick) [
kick_ctr = -1
loop i (listlen $clients_to_kick) [
sleep (* $i $MILLIS_BETWEEN_AUTOKICKS) [
+= kick_ctr 1
kick (at $clients_to_kick $kick_ctr) "Excessive teamkilling."
]
]
]
]
sleep $MILLIS_BETWEEN_TK_CHECKS CHECK_TEAMKILLS
][/cubescript]
Thanks friend,at this time, just my server has the bot is version 1.0.1 .....I think when you leave the AC version 1.2.0.0. I'll upload my ADMIN BOT 1.0.2 ~ By ~ BiD # A.D.M
Thank you.