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:
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? ???
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? ???