First Join

  • 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!

Podlt

Member
Jun 5, 2020
2
0
1
25
Category: Join Date

Suggested name: Join Date

Spigot/Skript Version:
Skript 2.4
Spigot: 1.15


What I want:
I want that when a player first joins it sets their join date to that day (Ex. my friend logs in the server and his first join date is set to the day he first joined and I can see that date from a /firstjoin %player%) and if it could be possible even a last join

Ideas for commands:
/firstjoin <player>
/resetjoins
/lastjoin <player>


Ideas for permissions:
SrMod.*


When I'd like it by: A reasonable time
 
It works for me
Code:
command /firstjoin [<offlineplayer>] [<text>]:
    permission message: &cYou have no permissions to perform this command.
    usage: /firstjsoin <player>
    permission: admin.*
    trigger:
        if arg-1 is set:
            if arg-2 is not set:
                if {first-join.%arg-1's uuid%} is set:
                    send "&6%arg-1%&e's first join was &f%{first-join.%arg-1's uuid%}%&e."
                else:
                    send "&cThis player hasn't played on this server."
            else:
                send "Unknown command."
        else:
            send "&cUsage: /firstjoin <player>"

command /lastjoin [<offlineplayer>] [<text>]:
    permission message: &cYou have no permissions to perform this command.
    usage: /lastjoin <player>
    permission: srmod.*
    trigger:
        if arg-1 is set:
            if arg-2 is not set:
                if {last-join.%arg-1's uuid%} is set:
                    send "&6%arg-1%&e's last join was &f%{last-join.%arg-1's uuid%}% &7(%difference between {last-join.%arg-1's uuid%} and now% ago)&e."
                else:
                    send "&cThis player hasn't played on this server."
            else:
                send "Unknown command."
        else:
            send "&cUsage: /firstjoin <player>"

command /resetjoins [<text>]:
    permission message: &cYou have no permissions to perform this command.
    usage: /resetjoins
    permission: srmod.*
    trigger:
        if arg-1 is not set:
            if (size of {playerdata::*}) > 0:
                loop {playerdata::*}:
                    delete {first-join.%loop-value's uuid%}
                    delete {last-join.%loop-value's uuid%}
                delete {playerdata::*}
                send "&eCompleted."
            else:
                send "&cNothing to delete."
        else:
            send "Unknown command."
I recomment you to change the date format in your config.sk, line 88
Code:
date format: dd/MM/yyyy hh:mm