Author Topic: [Filterscript] Stormeus' Votekick FS  (Read 7325 times)

0 Members and 1 Guest are viewing this topic.

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
[Filterscript] Stormeus' Votekick FS
« 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 (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

Screenshots







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]
Do not PM me for support.




Offline Mansoor ali

  • Street Thug
  • *
  • Posts: 25
  • I'm Back my old account Works! :D
    • View Profile
Re: [Filterscript] Stormeus' Votekick FS
« Reply #1 on: August 12, 2013, 09:16:29 am »
Good Job...

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: [Filterscript] Stormeus' Votekick FS
« Reply #2 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

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline Fire_Head

  • Street Thug
  • *
  • Posts: 35
    • View Profile
Re: [Filterscript] Stormeus' Votekick FS
« Reply #3 on: August 12, 2013, 02:25:54 pm »
Nice :D

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: [Filterscript] Stormeus' Votekick FS
« Reply #4 on: August 12, 2013, 05:12:05 pm »
+1
I'm beginning to feel like a Lag God, Lag God

Offline T3rroR

  • Street Thug
  • *
  • Posts: 4
    • View Profile
Re: [Filterscript] Stormeus' Votekick FS
« Reply #5 on: August 13, 2013, 12:54:43 am »
Great  ;)

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: [Filterscript] Stormeus' Votekick FS
« Reply #6 on: August 13, 2013, 02:40:56 am »
better than aledark's thing.













hhhhhhhhhhhhhhhhh
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline Doom

  • Made Man
  • ***
  • Posts: 105
    • View Profile
Re: [Filterscript] Stormeus' Votekick FS
« Reply #7 on: August 13, 2013, 09:29:25 am »
Just Clean and amazing

Offline MatheuS

  • Made Man
  • ***
  • Posts: 207
  • Pawn And Squirrel Scripter
    • View Profile
    • Brazillian Community
Re: [Filterscript] Stormeus' Votekick FS
« Reply #8 on: August 13, 2013, 03:34:36 pm »
Nice man.

Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Re: [Filterscript] Stormeus' Votekick FS
« Reply #9 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
I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: [Filterscript] Stormeus' Votekick FS
« Reply #10 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.
I'm beginning to feel like a Lag God, Lag God