0 Members and 1 Guest are viewing this topic.
const iTimer = (3*60); {time in seconds that the players have to wait before voting} sRanMap = 'randmaplist.txt'; {text file where the list of maps to choose from is}var aPlayer: array[1..32] of Integer;function OnRequestGame(IP: string; State: integer): integer;begin Result := State;end;procedure OnMapChange(NewMap: string); var iFor: integer;begin for iFor := 1 to 32 do begin aPlayer[iFor] := TimeLeft; end;end;procedure OnJoinTeam(ID, Team: byte);begin aPlayer[ID] := TimeLeft;end;function xSplit(const source: string; const delimiter: string):TStringArray; var i,x,d:integer; s:string; begin d:=length(delimiter); x:=0; i:=1; SetArrayLength(Result,1); while(i<=length(source)) do begin s:=Copy(source,i,d); if(s=delimiter) then begin inc(i,d); inc(x,1); SetArrayLength(result,x+1); end else begin result[x]:= result[x]+Copy(s,1,1); inc(i,1); end; end;end;procedure VoteMap(cText: string; Name: integer); var iList: Integer; iRep: Integer; aList: TStringArray; sMap: String;begin iList := 1; if ((aPlayer[Name]-iTimer) >= TimeLeft) then begin if (FileExists(sRanMap)) then begin aList := xSplit(ReadFile(sRanMap), (chr(13)+chr(10))); iList := ArrayHigh(aList); sMap := aList[random(0, iList)] repeat sMap := aList[random(0, iList)] iRep := iRep+1; until (sMap <> CurrentMap) or (iRep = 10); StartVoteMap(Name, sMap); aPlayer[Name] := TimeLeft; end else begin Command('/say Map list is not found.'); end; end else begin Command('/say You have to wait ' + IntToStr(TimeLeft - (aPlayer[Name]-iTimer)) + ' seconds till next vote.'); end;end;function OnPlayerSpeak(Name: string; Text: string): boolean; var cText: String; begin cText := LowerCase(Text); if (cText = '!ranmap') then begin VoteMap(cText, StrToInt(Name)); end;end;
I don't understand do you mean that there is a /faceplam commmand ?and this command should drop a random item ?
Sorry but that script is not valid at all. Ask the author to create it again, because its as old as the hills and is not compatible with any dedicated server version released after 1.3.1. OnPlayerSpeak does not have "Name: String" anymore and hasn't for a long time.