=SCC= SBX community Clan
Würden Sie gerne auf diese Nachricht reagieren? Erstellen Sie einen Account in wenigen Klicks oder loggen Sie sich ein, um fortzufahren.

Das offizielle Forum vom =SCC= Clan, Bewerbungen werden hier gepostet, viel Spaß bei uns!

Server and Clan are comming back online! By questions report to Kadesh

Sie sind nicht verbunden. Loggen Sie sich ein oder registrieren Sie sich

[ADDON] Votes

Nach unten  Nachricht [Seite 1 von 1]

1[ADDON] Votes Empty [ADDON] Votes Di Apr 19, 2011 9:10 am

amagos10

amagos10

Code:
NAME    = "votes"
VERSION = "1.0"
AUTHOR    = "amagos10"
WEBSITE = "http://sandboxcomunityclan.forumieren.de"
DESCRIPTION = "This addon can cancel and enable the votes of the game"
COMMANDS = {
   "vote on": ["Enable the votes"],
   "vote off": ["Disables the votes."],
   "vote": ["Toggle"]
}
PERMISSIONS = {
   "chat": {
      "vote on": 19,
      "vote off": 19,
                "vote": 19
   }
}

import host

class Addon:
   def __init__(self, core):
      self.core = core

            chat_vote(self, p, params):
    cmd = "sv.votingEnabled"
    if params[0] == "on": host.rcon_invoke(cmd + " 1")
    elif params[0] == "off": host.rcon_invoke(cmd + " 0")
    else:
          state = [1, 0][host.rcon_invoke(cmd)]
          host.rcon_invoke(cmd + " " + str(state))
          p.sendMsg("Done")

Addon made by ME and with this you can enable and disable votes.

Commands:
@vote on - on
@vote off - off
@vote - toggle

I think that should work. I didn't try it cause i can't do vots in local. Please try this on server and tell me if it works.
To download: amagos10@amagos10.bplaced.net/votes.py
(without http or ftp),(just copy and paste)

Nach oben  Nachricht [Seite 1 von 1]

Befugnisse in diesem Forum
Sie können in diesem Forum nicht antworten