Official Soldat Forums
Server Talk => Scripting Discussions and Help => Topic started by: 1221995 on November 09, 2007, 11:13:59 am
-
I searched, and looked through the script releases and couldnt find it. I hav a feeling its already been done, and if it has, the please post a link. What i want it to do is make it so if you type in something like '/bot' then it adds a random bot to the server. Also (if its possible) it wouldnt only use the default bots (admiral, boogie man, etc.), it would use ANY bots that are in the C:/soldat/bots or server/bots etc. What i mean is i could add like... 500 (thats alot ;p lol) bots to the folder and want to see random ones. I wouldnt need to edit the script, i would just type /bot and it would add a bot, and it mite be one of the new ones. I phrased that weird... Basicly, it takes ANY bot in your soldat/bots folder and adds it to the game on /bot.
help?
1221995
-
http://www.enesce.com/help/index.html?Functions/RandomBot.html
It says it will do any bot file in the bots folder.
Just a small admin command:
function OnCommand(ID: Byte; Text: string): boolean;
begin
try
if (LowerCase(Copy(Text,1,4)) = '/bot') and (Length(Text) <= 5) then Command('/addbot' + InttoStr(Text[5]) + ' ' + RandomBot);
except
end;
end;
The try could be better placed, but i was a bit lazy :) just threw this together.. You can do Text[5] to get the 5th character of Text, right?
-
Also, RandomBot ignores Boogie Man and Dummy bot files.
-
Mmmmm... Thats pretty cool ;p im getting rite now :D ...
Ok thx :) it works ;D