0 Members and 3 Guests are viewing this topic.
now if only avarax will use this for his eC hexer server.....
const Color = $FFFFFFFF; VotePerc = 50; VoteTime = 30;var Go: boolean; VFor,Time: byte; Voted: array[1..32] of boolean;procedure AppOnIdle(Ticks: integer);var i: byte;begin if Time > 0 then Time := Time - 1 else if Go then begin Go := false; for i := 1 to 32 do Voted[i] := false; VFor := 50; Time := 30; WriteConsole(0,'Map vote failed.',Color); end;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin Voted[ID] := false;end;procedure OnPlayerSpeak(ID: byte; Text: string);var i: byte;begin if Text = '!vote-m1' then if Voted[ID] = false then begin Go := true; Voted[ID] := true; VFor := VFor + 1; if VFor / NumPlayers * 100 >= VotePerc then begin Go := false; for i := 1 to 32 do Voted[i] := false; VFor := 0; Time := 30; WriteConsole(0,'Map vote passed.',Color); Command('/loadwep ?'); //HERE YOU REPLACE THE ? WITH THE NAME OF THE WEP.INI FILE THAT YOU WANT THE VOTE TO LOAD end else WriteConsole(0,'Voting percentage of needed people: ' + FloattoStr(RoundTo(VFor / NumPlayers * 100,2)) + '% / ' + InttoStr(VotePerc) + '%.',Color); end else WriteConsole(ID,'You have already voted.',Color); end;
My new password is secure as shit Mate, I am not sure Shit is even secured nowadays.
procedure OnPlayerSpeak(ID: byte; Text: string);var i: byte;begin if Text = '!nextmap' then if Voted[ID] = false then begin Go := true; Voted[ID] := true; VFor := VFor + 1; if VFor = 1 then Time:=VoteTime; if VFor / NumPlayers * 100 >= VotePerc then begin Go := false; for i := 1 to 32 do Voted := false; VFor := 0; Time := 0; WriteConsole(0,'Map vote passed.',Color); Command('/nextmap'); end else WriteConsole(0,'Voting percentage of needed people: ' + FloattoStr(RoundTo(VFor / NumPlayers * 100,2)) + '% / ' + InttoStr(VotePerc) + '%.',Color); end else WriteConsole(ID,'You have already voted.',Color);end;
if Go = false then Time := VoteTime;
procedure OnMapChange(NewMap: String);var i: byte;begin Go := false; for i := 1 to 32 do Voted[i] := false; VFor := 0; Time := 0;end;