Location in MySQL

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

    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.

SniperFox

Member
May 31, 2017
29
0
1
Skript Version: Skript 2.2-dev36
Skript Author: Bensku
Minecraft Version: 1.12 Spigot
---
Full Code:

So, i need to save location of the spawn to the MySQL database, and then i need
to use it to teleport player to it (On Join Event). So, how do i need to save this variable
to my database, and how do i need to use it?

Okay, so, here is some piece of code, where i need to take location of spawn:

code_language.skript:
set {_spawn-node-0} to "server.location.\%{_server}%::spawn\"
execute "SELECT value FROM `ONE_DATA` WHERE name = %{_spawn-node-0}%" in {_sql} and store the result in {_spawn-result-0::*}
if last database error is set:
  API_SendError(player, last database error, "f7ufj")
else:
  # ○ Continue
  set {_spawn.loc} to {_spawn-result-0::value::1}
  if {_spawn.loc} is not set:
    VisualDialogSend(player, " ")
    VisualDialogSend(player, "&b○ Дух &7Ой-ой! Кажется, что точка спавна не была установлена!")
    VisualDialogSend(player, "  &7Какая досада!")
    VisualDialogSend(player, " ")
  else:
    broadcast "%{_spawn.loc}%"
    teleport player to {_spawn.loc}
    delete {_spawn.loc}

Errors on Reload:
None

Addons using (including versions):
A lot of addons. But, for the MySQL i use skript-db (latest)

Troubleshooting:

Have you tried searching the docs? Hmmm... No
Have you tried searching the forums? No
What other methods have you tried to fix it? ???
 
Status
Not open for further replies.