1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

GeoIP Time & Day

Discussion in 'Requests' started by BrettPlayMC, Jul 12, 2017.

  1. BrettPlayMC

    Supporter

    Joined:
    Jan 26, 2017
    Messages:
    715
    Likes Received:
    53
    Note: I previously requested Snow-Pyon to do this but they were unable to due to the complexity and their limited schedule.
    Category: Time

    Suggested name: PlayerTime

    What I want:
    I know there is a Skript variable called %now% that gets the server's real time and day. Though, this is what I want, I want to do this for the player. Basically what Hypixel has on their SkyWars scoreboard. Example:
    7/12/17.

    Ideas for commands:
    None needed
    Ideas for permissions:
    None needed
    When I'd like it by: 1 week
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Code (Skript):
    1. function geoIp(p: player) :: texts:
    2.   set {_url} to "http://freegeoip.net/json/%{_p}'s ip%"
    3.   set {_ut::*} to content of json value's "country_code", "region_code", "country_name", "region_name", "city" and "time_zone" from text "%line 1 from url {_url}%"
    4.   return {_ut::*}
    5.  
    6. command /geoip <player = %player%>:
    7.   permission: geoip.admin
    8.   trigger:
    9.     set {_ut::*} to geoIp(player)
    10.     send "Country Code: %{_ut::1}%"
    11.     send "Region Code: %{_ut::2}%"
    12.     send "Country Name: %{_ut::3}%"
    13.     send "Region Name: %{_ut::4}%"
    14.     send "City: %{_ut::5}%"
    15.     send "TimeZone: %{_ut::6}%"
     
    • Like Like x 1
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    So, how will I get the player's current date?
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Just use the command and you will see.
    Timezone is the last value.
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    ok...
    --- Double Post Merged, Jul 13, 2017, Original Post Date: Jul 13, 2017 ---
    I don't need the timezone. I need the players date based on the timezone.
    --- Double Post Merged, Jul 14, 2017 ---
    bump
    --- Double Post Merged, Jul 18, 2017 ---
    bump.
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    What in gods christ all mighty mother of jesus on a slice of toast marinated in nandos medium sauce on the fucking floor are you on about, the players date based on the timezone? he just gave you the fucking timezone. work it out.
     
    • Funny Funny x 1
    • Winner Winner x 1
    • Friendly Friendly x 1
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    You can always get the player's timezone, get the server time, then do the math to get the player's time. (Assuming you know the server's time zone)
     

Share This Page

Loading...