Author Topic: Any Voter  (Read 1881 times)

0 Members and 1 Guest are viewing this topic.

Offline iDante

  • Veteran
  • *****
  • Posts: 1966
Any Voter
« 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...
Code: [Select]
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.
« Last Edit: August 07, 2008, 04:33:38 pm by iDante »

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1907
    • TransHuman Design
Re: Any Voter
« Reply #1 on: August 07, 2008, 04:53:33 am »
Very useful script when no admin's on. Gratz. ^^'
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline Leo

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1011
Re: Any Voter
« Reply #2 on: August 07, 2008, 05:36:12 am »
Democracy is maybe good for states. For game servers it can only cause chaos ;)

Offline Railor

  • Major(1)
  • Posts: 16
Re: Any Voter
« Reply #3 on: August 07, 2008, 06:07:22 am »
Nice script, but you should disallow some commands, like /password etc.

Offline Leo

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1011
Re: Any Voter
« Reply #4 on: August 07, 2008, 06:46:12 am »
/newvote /shutdown
*bye bye server

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: Any Voter
« Reply #5 on: August 07, 2008, 06:56:18 am »
/newvote /shutdown
*bye bye server
Yah, you should disable voting commands like shutdown or restart or any thing harmfull to the server

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1907
    • TransHuman Design
Re: Any Voter
« Reply #6 on: August 07, 2008, 07:13:27 am »
Hmm. For private servers it will do. But for publics some commands really should be excluded. Especially those harmfull.
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline zop

  • Major
  • *
  • Posts: 81
Re: Any Voter
« Reply #7 on: August 07, 2008, 07:40:08 am »
I can change something from it.
Then ppl can vote ban cheater without admin online.
Thx

http://122.116.167.31:23238:23238/galavela/?inc=player&name=%5BTomato+Bird%5D+Cibo[/size=1]

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Any Voter
« Reply #8 on: August 07, 2008, 09:08:25 am »
Nice idea. I was going to create a voting system for any vote, but I guess not anymore. :P GJ

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: Any Voter
« Reply #9 on: August 07, 2008, 11:51:11 am »
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)
Also Known As REIMA


Lol Happles (happy apples)

Offline iDante

  • Veteran
  • *****
  • Posts: 1966
Re: Any Voter
« Reply #10 on: August 07, 2008, 04:34:26 pm »
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.
« Last Edit: August 07, 2008, 04:36:56 pm by iDante »

Offline zop

  • Major
  • *
  • Posts: 81
Re: Any Voter
« Reply #11 on: August 08, 2008, 12:23:58 am »
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. :)

http://122.116.167.31:23238:23238/galavela/?inc=player&name=%5BTomato+Bird%5D+Cibo[/size=1]

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: Any Voter
« Reply #12 on: August 08, 2008, 02:40:56 am »
You can already do that, !newvote /ban <ID or name>
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline zop

  • Major
  • *
  • Posts: 81
Re: Any Voter
« Reply #13 on: August 08, 2008, 06:07:10 am »
yes I know I can do !newvote /ban

But I just wanna let players vote ban cheater or any bad guy.

:)

http://122.116.167.31:23238:23238/galavela/?inc=player&name=%5BTomato+Bird%5D+Cibo[/size=1]