Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: SneS on February 27, 2016, 11:42:01 am

Title: !join and !spec script
Post by: SneS on February 27, 2016, 11:42:01 am
I am looking for a simple script with two commands:

!join and !spec. Sameone help?
Title: Re: !join and !spec script
Post by: soldat-game on February 27, 2016, 12:15:14 pm
http://forums.soldat.pl/index.php?topic=39941.msg519807#msg519807

Or me newer update in attach or code:
fast write
Code: [Select]
procedure OnPlayerSpeak(ID: byte; Text: string);
var a,b:integer;
begin
if regExpMatch('^!(a|alpha|red|1|joina|join a)$',lowercase(Text)) then begin
if (GetPlayerStat(ID, 'Team')<>1) then begin
Command('/setteam1 '+inttostr(ID));
end;
end;
if regExpMatch('^!(b|bravo|blue|2|joinb|join b)$',lowercase(Text)) then begin
if (GetPlayerStat(ID,'Team')<>2) then begin
Command('/setteam2 '+inttostr(ID));
end;
end;
if regExpMatch('^!(join)$',lowercase(Text)) then begin
if (GetPlayerStat(ID,'Team')=5) then begin
a:=alphaplayers;
b:=bravoplayers;
if (a<=b) then Command('/setteam1 '+inttostr(ID)) else Command('/setteam2 '+inttostr(ID));
end else WriteConsole(ID,'You are is in game.', $CC0000);
end;
end;
Title: Re: !join and !spec script
Post by: SneS on February 27, 2016, 12:18:49 pm
Thanks you so much  ;D