Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => ShowRoom (pawn) => Topic started by: stormeus on August 12, 2013, 04:12:39 am

Title: [Filterscript] Stormeus' Votekick FS
Post by: stormeus on August 12, 2013, 04:12:39 am
Stormeus' Votekick Filterscript
Last Updated: 11 Aug 2013, 8:57pm GMT -4



Overview
I 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 Links
Mirror #1 (https://mega.co.nz/#!FRFjyAIR!FSCzhmS-cYguLlUy2x8zIBpwHOQmNrhHbbnvROtzbcc) (Mega.co.nz)
Mirror #2 (http://www.mediafire.com/download/g1xoap56avdl0pe/rtv.zip) (Mediafire)

Installation

Screenshots

(http://i.imgur.com/hb2mpVG.jpg?1?9753)

(http://i.imgur.com/sRIlP9T.jpg?1)

(http://i.imgur.com/bcbYhJj.png?1)

Details
The 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]
Title: Re: [Filterscript] Stormeus' Votekick FS
Post by: Mansoor ali on August 12, 2013, 09:16:29 am
Good Job...
Title: Re: [Filterscript] Stormeus' Votekick FS
Post by: sseebbyy on August 12, 2013, 10:56:53 am
Great work Stormeus. You explained there everything that you used, so scripters will can learn faster. :P
Title: Re: [Filterscript] Stormeus' Votekick FS
Post by: Fire_Head on August 12, 2013, 02:25:54 pm
Nice :D
Title: Re: [Filterscript] Stormeus' Votekick FS
Post by: Fuzzy168 on August 12, 2013, 05:12:05 pm
+1
Title: Re: [Filterscript] Stormeus' Votekick FS
Post by: T3rroR on August 13, 2013, 12:54:43 am
Great  ;)
Title: Re: [Filterscript] Stormeus' Votekick FS
Post by: heekz.shadow on August 13, 2013, 02:40:56 am
better than aledark's thing.













hhhhhhhhhhhhhhhhh
Title: Re: [Filterscript] Stormeus' Votekick FS
Post by: Doom on August 13, 2013, 09:29:25 am
Just Clean and amazing
Title: Re: [Filterscript] Stormeus' Votekick FS
Post by: MatheuS on August 13, 2013, 03:34:36 pm
Nice man.
Title: Re: [Filterscript] Stormeus' Votekick FS
Post by: aledark24 on August 16, 2013, 08:40:34 pm
better than aledark's thing.














hhhhhhhhhhhhhhhhh


At least I could do ... but in my own way and in different ways .. but we will not discuss how little your contributions to what I bring and try to create it from nothing more than the idea that arises at the time...

Think you would have done ... so far I do not see anything creative in your work
Title: Re: [Filterscript] Stormeus' Votekick FS
Post by: Fuzzy168 on August 17, 2013, 04:10:47 am
better than aledark's thing.


At least I could do ... but in my own way and in different ways .. but we will not discuss how little your contributions to what I bring and try to create it from nothing more than the idea that arises at the time...

Think you would have done ... so far I do not see anything creative in your work
What have shadow done.. Hmmm alot!! You just need to search (http://forum.vicecitymultiplayer.com/index.php?topic=5814.15).