Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: Vyka on September 15, 2008, 02:17:55 pm

Title: TeamChange_1.1 New Commands added!
Post by: Vyka on September 15, 2008, 02:17:55 pm
Script Name: Team Changing
Original Author(s): Vyka
Core Version: 2.6.3

/changing
- turning ON or OFF script   (!red, !alpha, !blue, !bravo, !spec, !spectator, !spectate are AVAILABLE but !yellow, !charlie, !green, !delta are DISABLED!)
/changing2 - turning ON or OFF script   (!red, !alpha, !blue, !bravo, !yellow, !charlie, !green, !delta, !spec, !spectator, !spectate are AVAILABLE)

!red, !alpha, !blue, !bravo, !yellow, !charlie, !green, !delta, !spec, !spectator, !spectate

Code: [Select]
//    Vyka's Team change script ver. 1.1
//    Script can be configurated by admin using commands (described few lines under)
//    Welcome message to player if script active (information about available commands (!red, !blue etc...))
//    Nice colors on team changing. Script can be used in CTF and TM mode :)
//    Hope you like it.  I decided to write it, because i can't found script like this with good configuration :)   
//   
//    in ver. 1.1 I added more commands. (for DorkeyDear ;))  and cleaned code, now, it's shorter.
//    also changed a little bit command, and informations. They're easier to use now.
//    If somebody have to chceck activated commands, type !changing. ( !changing commad is in welcome message )
//
//     /changing - turning ON or OFF script   (!red, !alpha, !blue, !bravo, !spec, !spectator, !spectate AVAILABLE but !yellow, !charlie, !green, !delta DISABLED!)
//     /changing2 - turning ON or OFF script   (!red, !alpha, !blue, !bravo, !yellow, !charlie, !green, !delta, !spec, !spectator, !spectate AVAILABLE)


FULL CODE IN ATTACHED FILE "teams_fixed_1.1"

...
...
procedure OnPlayerSpeak(ID: Byte; Text: string);
begin
if ((Text = '!changing') and (status=true) and (yellowgreen=false)) then begin
WriteConsole(ID,'!red, !alpha, !blue, !bravo', colorgreen);
WriteConsole(ID,'!spec, !spectate, !spectator', colorgreen);
WriteConsole(ID,'!yellow, !charlie, !green, !delta', colorred);
end;
if ((Text = '!changing') and (status=true) and (yellowgreen=true)) then begin
WriteConsole(ID,'!red, !alpha, !blue, !bravo', colorgreen);
WriteConsole(ID,'!spec, !spectate, !spectator', colorgreen);
WriteConsole(ID,'!yellow, !charlie, !green, !delta', colorgreen);
end;
if ((Text ='!red') or (Text='!alpha') and (status=true) and (GetPlayerStat(ID,'Team')<>1)) then begin
Command('/setteam1 '+inttostr(ID));
end;
if ((Text='!blue') or (Text='!bravo') and (status=true) and (GetPlayerStat(ID,'Team')<>2)) then begin
Command('/setteam2 '+inttostr(ID));
end;
if (( Text = '!yellow') or (Text='!charlie') and (status=true) and (yellowgreen=true) and (GetPlayerStat(ID,'Team')<>3)) then begin
Command('/setteam3 '+inttostr(ID));
end;
if ((Text='!green') or (Text='!delta') and (status=true) and (yellowgreen=true) and (GetPlayerStat(ID,'Team')<>4)) then begin
Command('/setteam4 '+inttostr(ID));
end;
if ((Text='!spec') or (Text='!spectate') or (Text='!spectator') and (status=true) and (GetPlayerStat(ID,'Team')<>5)) then begin
Command('/setteam5 '+inttostr(ID));
end;
end;
...
...

Title: Re: TeamChange by !red, !blue (!yellow and !green also if admin want (command))
Post by: xmRipper on September 15, 2008, 02:40:42 pm
availiable
Title: Re: TeamChange by !red, !blue (!yellow and !green also if admin want (command))
Post by: Laser Guy on September 15, 2008, 02:43:39 pm
Should be available >.>
Title: Re: TeamChange by !red, !blue (!yellow and !green also if admin want (command))
Post by: Vyka on September 15, 2008, 02:52:49 pm
I changed that, sorry for my english. Also changed mistakes in attached file. Thanks a lot :)
Title: Re: TeamChange by !red, !blue (!yellow and !green also if admin want (command))
Post by: Laser Guy on September 15, 2008, 03:38:20 pm
If you need any help in translating Polish to English I would gladly help. Just PM me ;) (też jestem Polak, tak jak PaFel i paru innych)
Title: Re: TeamChange by !red, !blue (!yellow and !green also if admin want (command))
Post by: DorkeyDear on September 16, 2008, 05:28:47 am
Support "alpha" "bravo" "charlie" "delta" "spec" "spectate" "spectator" please :)
Title: Re: TeamChange_1.1 New Commands added!
Post by: Vyka on September 16, 2008, 11:04:17 am
I added these commands, now, there is able to use :
!red, !alpha, !blue, !bravo, !yellow, !charlie, !green, !delta, !spec, !spectator, !spectate.
hope you enjoy it ;)

also i cleaned and optimized code ;)
Title: Re: TeamChange_1.1 New Commands added!
Post by: DorkeyDear on September 16, 2008, 08:07:29 pm
its sensitive atm, would be better to make it not (Text := LowerCase(Text) or LowerCase(Text) for every Text, which would be un-noticeably but still slower)