Stormeus' Votekick FilterscriptLast Updated: 11 Aug 2013, 8:57pm GMT -4
OverviewI recently saw aledark's votekick command release, which I thought was a nice script, but could be improved in various ways. For one, it's more difficult to set up than if it were a filterscript. It's also difficult to follow code-wise, and is not as efficient as it could be, using 256-cell arrays and requiring INI files for something that could be set up easily in-memory.
For those reasons, I decided to create this filterscript to give a more proper example of how a script like vote-kicking could be implemented.
Download LinksMirror #1 (Mega.co.nz)
Mirror #2 (Mediafire)
Installation- If you have not already done so, create a folder in the same directory as your server named "filterscripts"
- Unzip rtv.amx (and optionally, rtv.pwn) to the filterscripts folder
- Add the following line to server.cfg: filterscripts rtv
ScreenshotsDetailsThe script is
highly customizable. You can change everything from the amount of time a vote lasts to the messages sent during voting, allowing you to tweak it to your liking and even translate it easily.
To edit it, you will need Pawno or a similar Pawn script editor. At the top of rtv.pwn (included in the download), you can edit the lines at the top:
[pawn]
/**
* Strings used by this filterscript. You may translate them however you like.
*/
#define VOTE_PREMATURE_PART "%s quit while a vote to kick them was active."
#define VOTE_NONCONNECTED "Error: That player is not connected."
#define VOTE_ALREADYACTIVE "Error: There is already a votekick on %s in progress."
#define VOTE_WAITTIME "Error: You must wait %d seconds before starting a new vote."
#define VOTE_STARTEDTARGET "%s has started a vote to kick %s."
#define VOTE_STARTINSTRUCT "Type /c votey to vote in favor. Type /c voten to vote against kicking."
#define VOTE_ALREADYVOTED "Error: You have already voted."
#define VOTE_KICKING "You have voted to kick %s."
#define VOTE_KEEPING "You have voted to keep %s."
#define VOTE_INACTIVE "Error: There are no votes in progress."
#define VOTE_FAILED_LOWTHRESH "Vote failed: Not enough players voted."
#define VOTE_FAILED_LOWVOTE "Vote failed: Yes votes must exceed no votes."
#define VOTE_PASSED "Vote passed. %s will be kicked."
/**
* Determines whether or not to show the number of votes when a vote ends.
*/
const VOTE_VERBOSE = 1;
/**
* Determines whether or not to allow players to change their vote.
*/
const VOTE_ALLOW_REVOTING = 1;
/**
* The amount of players needed to successfully calculate a vote, expressed
* as a fraction. The default is 0.5, meaning that 50% of players on the
* server need to have voted in order for a vote to be calculated.
*/
const Float:VOTE_THRESHOLD = 0.5;
/**
* The amount of time a vote should be held for, in seconds. Changing this
* value changes the amount of time players will have to vote. Larger values
* allow more time. The default is 15s.
*/
const VOTE_DURATION = 15;
/**
* The amount of time a player must wait in between any vote, in seconds. The
* default is 10s.
*/
const VOTE_TIMEOUT = 10;
/**
* The amount of time a player must wait before initiating another vote, if the
* last vote they held passed (the majority of players agreed with it). The
* default is 30s.
*/
const VOTE_PASS_TIMEOUT = 30;
/**
* The amount of time a player must wait before initiating another vote, if the
* last vote they held failed. The default is 180s.
*/
const VOTE_FAIL_TIMEOUT = 180;
/**
* Color to use for an info message.
*/
const VOTE_INFO = 0x057d9fff;
/**
* Color to use for an error message.
*/
const VOTE_ERROR = 0xa60400ff;
[/pawn]