Official Soldat Forums
Server Talk => Scripting Releases => Topic started by: iDante on August 07, 2008, 03:02:11 am
-
Script Name: Any Vote
Script Description:
Democracy at its finest, this script allows ANY player in the game to start a vote that, if enough people support, will carry out ANY command that he wants.
Edit: Now the server-owners can block certain commands (just add commands to the second line of code, pretty simple)
To use:
!newvote COMMAND
COMMAND should start with /, for instance saying !newvote /say Hello will start a vote that if successful will execute the command /say Hello.
To support a vote do !vote yes
If you do this but change your mind do !vote no
For current status of a vote do !status
Admins can turn this on and off by doing /voteon or /voteoff
Original Author(s): Me
Core Version: 2.6.3
Code: 100 lines too long? eh I'll just include a bit...
procedure UpdateVotes;
var
i: Integer;
begin
Count := 0;
for i := 1 to 32 do
if Voted[i] then inc(Count, 1);
if (100*Count)/(NumPlayers - NumBots) >= WIN_PERCENT then begin
for i := 1 to 32 do
Voted[i] := false;
Voting := false;
WriteConsole(0,'Vote Passed: '+VoteString,COLOR);
Command(VoteString);
end;
end;
Thats just my method to check whether it is good or no. DOODARRR in the zip.
-
Very useful script when no admin's on. Gratz. ^^'
-
Democracy is maybe good for states. For game servers it can only cause chaos ;)
-
Nice script, but you should disallow some commands, like /password etc.
-
/newvote /shutdown
*bye bye server
-
/newvote /shutdown
*bye bye server
Yah, you should disable voting commands like shutdown or restart or any thing harmfull to the server
-
Hmm. For private servers it will do. But for publics some commands really should be excluded. Especially those harmfull.
-
I can change something from it.
Then ppl can vote ban cheater without admin online.
Thx
-
Nice idea. I was going to create a voting system for any vote, but I guess not anymore. :P GJ
-
Maybe you should include some .txt file, like forbidden.txt and in that file you write all commands that cannot be voted ::)
(Also the script should check if that vote is in the forbidden file)
-
Fixed it up so that now the serverowners can block commands (with the first const at the top).
Using the default script, !newvote /adm 1 will NOT work. same with !newvote /shutdown.
And also, remember that this is democratic. If someone tries to do !newvote shutdown, then a set percent (you can set it) of people need to agree.
-
I made a VoteBan by change something ~ add something ~
1) Players can say "!voteban PlayerID" to start a ban voting. In game, press F1 then press / , can see a white number at left of player's name. That's PlayerID.
2) Starter can say "!unvote" to stop voting
3) Others say "!vote yes" or "!vote no" to agree or deny it
4) "!Status" can view Voting infomation
5) When "!voteban PlayerID" comes out from someone, that Player's IP will be recorded, so voting still work even he run away
6) Starter can't leave server or voting fail
Thanks iDante.
This is helpful. :)
-
You can already do that, !newvote /ban <ID or name>
-
yes I know I can do !newvote /ban
But I just wanna let players vote ban cheater or any bad guy.
:)