Solved Cooldown time for argument player

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

kamilleon

Member
Nov 18, 2017
48
0
6
25
I wanted to create a plot rating point system for admins, to rate the players plots, and give them points depending on the rating.

Also I wanted to add an anti-abuse system to it, so a player can be only rated once every hour, globally.


Code:
                    else:
                        set {_szam} to arg 3 parsed as a number
                        set {_jatekos} to arg 2
                        if {_szam} is set:
                            set {_pontvart} to difference between {pontozottjatekos.%arg 2%} and now
                            if {_pontvart} is less than {@pontozottjatekos}:
                                message "&6&lBalker&eCraft &8» &cEhhez még várnod kell %{pontozottjatekos.%arg 2%}% másodpercet!"
                            else:
                                if {_szam} is between 1 and 10:
                                    set {_szam} to {_szam}*10
                                    add {_szam} to {rankpoint.%arg 2%}
                                    add {_szam} to {koltopont.%arg 2%}
                                    message "&6&lBalker&eCraft &8» &eHozzáadva &6%arg 2% &ejátékoshoz &6%{_szam}% &epont!"
                                    set {pontozottjatekos.%arg 2%} to 3600
                                else:
                                    message "&6&lBalker&eCraft &8» &cAdj meg egy pontozást 1-10-ig!"
                        else:
                            message "&6&lBalker&eCraft &8» &cAdj meg egy pontozást 1-10-ig!"

But my current code doesn't work, in any way.
 
code_language.skript:
set {pontozottjatekos.%arg 2%} to 3600
# Above needs to be changed to this:
set {pontozottjatekos.%arg 2%} to now

When you said "difference between {pontozottjatekos.%arg 2%} and now" Its trying to compare two timespans but since {pontozottjatekos.%arg 2%} is not a timespan (a number), it won't work properly.

Also make sure that:
code_language.skript:
options:
    pontozottjatekos = 1 hour
 
code_language.skript:
set {pontozottjatekos.%arg 2%} to 3600
# Above needs to be changed to this:
set {pontozottjatekos.%arg 2%} to now

When you said "difference between {pontozottjatekos.%arg 2%} and now" Its trying to compare two timespans but since {pontozottjatekos.%arg 2%} is not a timespan (a number), it won't work properly.

Also make sure that:
code_language.skript:
options:
    pontozottjatekos = 1 hour
Thank you, it works now :emoji_slight_smile:
 
Status
Not open for further replies.