Hej! Mam o to taki skrypcik (kod ni?ej) i potrzebuje do niego tabeli SQL. Pr?bowa?em sam zrobi? ale totalnie mi nie wychodzi
KOD:
mysql = exports.mysql
local karnet = createMarker(1162.0380859375, -1372.5537109375, 26.046875-1, "cylinder", 2, 255, 0, 0, 100)
local trening = createMarker(1163.41796875, -1373.6650390625, 26.046875-1, "cylinder", 2, 255, 255, 255, 100)
function kupkarnet(hitElement)
exports.hud:sendBottomNotification(hitElement, "SI?OWNIA", "Aby zacz?? trening musisz zakupi? karnet aby to zrobi? wpisz /kupkarnet (Koszt $200)")
end
addEventHandler("onMarkerHit", karnet, kupkarnet)
function karnetkupiony(playerSource)
local id = getElementData(playerSource, "dbid")
local check = mysql:query_fetch_assoc("SELECT * FROM `silownia` WHERE `id` = '"..id.."'")
if check then
exports.hud:sendBottomNotification(playerSource, "SI?OWNIA", "Ju? posiadasz karnet!")
else
if isElementWithinMarker(playerSource, karnet) then
if exports.global:hasMoney(playerSource, 200) then
exports.hud:sendBottomNotification(playerSource, "SI?OWNIA", "Gratulacje! Zakupi?e? karnet na si?ownie!")
exports.global:takeMoney(playerSource, 200)
mysql:query_free("INSERT INTO `silownia` SET `id` = '"..id.."'")
mysql:query_free("... |