Time Command

Approved Time Command 1.0 Python

No permission to download

h0wHigh

Retired Staff
Retired Staff
Aug 5, 2014
103
9
18
Oh crap. Use Notepad++ to edit the script. Line 23 should have: if not Player.Admin or self.isMod(Player.SteamID):

Now, If you found that replace the or to and. So It will be: if not Player.Admin and not self.isMod(......

Sent from my Samsung Galaxy S4
Yeah sweet, works now :) Cheers.
 

maughanorama

Member
Member
Nov 27, 2014
181
10
18
50
Yeah sweet, works now :) Cheers.
Hi Dretax

this modded version works fine for me but all my moderators get the "you are not an Admin"
they are in the datastore ( at least i think they are) if i do listmoderators i get the list of users. also when they get the "your not an admin" theres no error in the logs just a line saying they executed the command
 

h0wHigh

Retired Staff
Retired Staff
Aug 5, 2014
103
9
18
You need to do the fix that Dretax got me to do in Notepad++ as per above.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
i did ... i can do it but my mods cant
Python:
__author__ = 'BogdanWDK'
__version__ = '1.0'
import clr

clr.AddReferenceByPartialName("Fougerite")
import Fougerite
"""
    Class
"""


class TimeCommand:

    def On_PluginInit(self):
        Util.ConsoleLog("TimeCommand by " + __author__ + " Version: " + __version__ + " loaded.", False)
      
    def isMod(self, id):
        if DataStore.ContainsKey("Moderators", id):
            return True
        return False

    def On_Command(self, Player, cmd, args):
        if not Player.Admin and not self.isMod(Player.SteamID):
            Player.Message("You aren't an admin.")
            return
        if cmd == "time":
            if len(args) != 1:
                Player.MessageFrom("[SetTime]", "============================================")
                Player.MessageFrom("[SetTime]", "In order to set time to a certain moment you must use :")
                Player.MessageFrom("[SetTime]", "/time day | /time night")
                Player.MessageFrom("[SetTime]", "============================================")
            elif len(args) == 1:
                if args[0] == "day":
                    World.Time = 6
                elif args[0] == "night":
                    World.Time = 24
                else:
                    World.Time = int(args[0])
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Python:
__author__ = 'BogdanWDK'
__version__ = '1.0'
import clr

clr.AddReferenceByPartialName("Fougerite")
import Fougerite
"""
    Class
"""


class TimeCommand:

    def On_PluginInit(self):
        Util.ConsoleLog("TimeCommand by " + __author__ + " Version: " + __version__ + " loaded.", False)
     
    def isMod(self, id):
        if DataStore.ContainsKey("Moderators", id):
            return True
        return False

    def On_Command(self, Player, cmd, args):
        if not Player.Admin and not self.isMod(Player.SteamID):
            Player.Message("You aren't an admin.")
            return
        if cmd == "time":
            if len(args) != 1:
                Player.MessageFrom("[SetTime]", "============================================")
                Player.MessageFrom("[SetTime]", "In order to set time to a certain moment you must use :")
                Player.MessageFrom("[SetTime]", "/time day | /time night")
                Player.MessageFrom("[SetTime]", "============================================")
            elif len(args) == 1:
                if args[0] == "day":
                    World.Time = 6
                elif args[0] == "night":
                    World.Time = 24
                else:
                    World.Time = int(args[0])
There was a fail. Fixed.
 
  • Like
Reactions: Robert