Solved DONATOR VİP HOME DELAY

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
Which datastore table should I check?

Sent From My Samsung Galaxy S4
Replace DonatorRankCheck() with:
Python:
    def DonatorRankCheck(self, type, id):
        if type == "MaxHomes":
            if DataStore.Get("DonatorRank-MaxHomes", id) is not None:
                maxh = DataStore.Get("DonatorRank-MaxHomes", id)
                return maxh
            else:
                config = self.HomeConfig()
                maxh = config.GetSetting("Settings", "Maxhomes")
                return maxh
        elif type == "CoolDown":
            if DataStore.Get("DonatorRank-Cooldown", id) is not None:
                CoolDown = DataStore.Get("DonatorRank-Cooldown", id)
                return CoolDown
            else:
                config = self.HomeConfig()
                CoolDown = int(config.GetSetting("Settings", "Cooldown"))
                return CoolDown
        elif type == "TpDelay":
            if DataStore.Get("DonatorRank-TpDelay", id) is not None:
                TpDelay = DataStore.Get("DonatorRank-TpDelay", id)
                return TpDelay
            else:
                config = self.HomeConfig()
                TpDelay = int(config.GetSetting("Settings", "tpdelay"))
                return TpDelay
Line #449, Replace with:
Python:
cooldown = self.DonatorRankCheck("CoolDown", id)
Line #454, Replace with:
Python:
tpdelay = self.DonatorRankCheck("TpDelay", id)
Line #490, Replace with:
Python:
maxh = self.DonatorRankCheck("MaxHomes", id)
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
Also your Random module is not being imported, Plus the waitime is always 0.0/0.0
For waittime i recommend importing datetime and replaceing Line #484 - 486, With:
Python:
Player.Message("Time remaining: " + str(datetime.timedelta(0, (cooldown / 1000) - (calc / 1000))))
which will Print SEVRERNAME: HH:MM:SS
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Also your Random module is not being imported, Plus the waitime is always 0.0/0.0
For waittime i recommend importing datetime and replaceing Line #484 - 486, With:
Python:
Player.Message("Time remaining: " + str(datetime.timedelta(0, (cooldown / 1000) - (calc / 1000))))
which will Print SEVRERNAME: HH:MM:SS
What do you mean by random not getting imported?
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
What do you mean by random not getting imported?
import random isn't being loaded, I didn't try without a Try/Catch.
I added Util.Log("hdsbf4t") just before the pass in the except to see if datetime loaded.

EDIT:
[IPModule] HomeSystem plugin could not be loaded.
ImportException: No module named random
 
Last edited:

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
import random isn't being loaded, I didn't try without a Try/Catch.
I added Util.Log("hdsbf4t") just before the pass in the except to see if datetime loaded.

EDIT:
[IPModule] HomeSystem plugin could not be loaded.
ImportException: No module named random
I could import It. Do you have the extralibs?

Sent From My Samsung Galaxy S4