Witam, mam problem z mysql w skript mianowicie "the 2nd argument given to the function eat is not of the required
type number" a kod:
script options:
$ db url jdbc:mysql://(ip xd):3306/rank
$ db username x
$ db password x
on script load:
update "CREATE TABLE IF NOT EXISTS `rank` (`uuid` varchar(255),`name` varchar(255), `distance` float(20), `kills` int(20), `eat` int(20))"
#po pierwszym starcie dodaj # przed 2 linie ponizej
update "ALTER table `rank` ADD id int NOT NULL AUTO_INCREMENT primary key FIRST"
update "ALTER table `rank` ADD UNIQUE (id, uuid)"
function eat(target: offline player, a: number, s: integer):
set {_result::*} to objects in column "eat" from result of query "SELECT eat FROM rank WHERE uuid = '%uuid of {_target}%'" and close
if "%{_result::*}%" is "<none>":
update "INSERT INTO cash (`uuid`, `amount`, `name`) VALUES ('%uuid of {_target}%', '0','%name of player%')"
else:
set {_targetamount} to "%{_result::*}%" parsed as number
add {_a} to {_targetamount}
{_s} is 0:
update "UPDATE rank SET `eat` = '%{_targetamount}%' WHERE uuid = '%uuid of {_target}%'"
stop
else:
update "UPDATE rank SET `eat` = '%{_a}%' WHERE uuid = '%uuid of {_target}%'"
stop
on join:
set {eat::%player%} to 0
on first join:
set {eat::%player%} to 0
on eat of golden apple:
add 1 to {eat::%player%}
on quit:
set {_e} to {eat::%player%}
eat(player,"%{_e}%",0)
mam też error "database features are disabled until the script has sql credentials associated with it."
Pytanie
MrPatryk07 45
Witam, mam problem z mysql w skript mianowicie "the 2nd argument given to the function eat is not of the required
type number" a kod:
mam też error "database features are disabled until the script has sql credentials associated with it."
Odnośnik do komentarza
Udostępnij na innych stronach
2 odpowiedzi na to pytanie
Rekomendowane odpowiedzi
Dołącz do dyskusji
Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.