0 Members and 1 Guest are viewing this topic.
function OnPlayerCommand(ID: Byte; Text: string): boolean;varalpha_tag: string;bravo_tag: string;begin //NOTE: This function will be called when [_ANY_] player types a / command. Result := false; //Return true if you want disable the command typed. if(GetPiece(Text,' ',0)='!scrim') then begin Command('/say -=Scrim started!=-'); Command('/say Scrim script by Gradius wuvz you'); alpha_tag=GetPiece(Text,' ',1) bravo_tag=GetPiece(Text,' ',2) //Clear team scores SetTeamScore(1,0); SetTeamScore(2,0); for i:=1 to NumPlayers do begin if(ContainsString((IDToName(i),alpha_tag)) then begin Command('/SETTEAM1 '+inttostr(i)); end else begin if(ContainsString((IDToName(i),bravo_tag)) then begin Command('/SETTEAM2 '+inttostr(i)); end else begin Command('/SETTEAM5 '+inttostr(i)); end; i+=1; end; end;end;
procedure OnPlayerSpeak(ID: byte; Text: string);var alpha_tag,bravo_tag: string; i: byte;begin if LowerCase(GetPiece(Text,' ',0))='!scrim' then begin alpha_tag:=GetPiece(Text,' ',1); bravo_tag:=GetPiece(Text,' ',2); for i:=1 to 32 do begin if GetPlayerStat(i,'active')=false then continue; if ContainsString(GetPlayerStat(i,'name'),alpha_tag) then Command('/setteam1 '+inttostr(i)) else if ContainsString(GetPlayerStat(i,'name'),bravo_tag) then Command('/setteam2 '+inttostr(i)) else Command('/setteam5 '+inttostr(i)); end; end;end;
Command('/say Scrim Started!');Command('/say '+inttostr(alpha_tag));Command('/say VS');Command('/say '+inttostr(bravo_tag));
procedure OnJoinTeam(ID, Team: byte);beginif (GetPlayerStat(ID,'Name') = 'Major') or (MaskCheck(GetPlayerStat(ID,'Name'), 'Major(?)')) or (MaskCheck(GetPlayerStat(ID,'Name'), 'Major(??)')) then beginWriteConsole(ID,'Please use a unique name',$FF0000);KickPlayer(ID);if Scrim_On=true then begin;command('/setteam5 '+ID);Command('/say The scrim is going, no Abuse'+inttosrt(ID));end;end;
i+=1;
Might be interesing to add the map name as an extra parameter.
And as the lyrics go in the United State's national anthem: "America, f**k YEAH!".