Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: database
1. Database struktura
Cześć, mam pytanko. Wie ktoś jak wstawić nową strukture np. kursy_busy w pystories_users ??
2. database a serwerem . nie widzi kolumny?
Doda?em do user zeton i zetony kod zrodlowy to:

[lua]setTimer(function()
local players=getElementsByType('player')
for _, p in pairs(players) do
if getElementData(p, "player:online") and tonumber(getElementData(p, "player:online")) > 1 then
if getElementData(p, "player:online") == 1 then
local hour = getElementData(localPlayer,"player:hours") or 0
setElementData(localPlayer,"player:hours",hour+0.5)
end
setElementData(p, "player:online", 0)
if getElementData(p, "player:premium") then
givePlayerMoney(p, 250000)
rp = getElementData(p, "player:srp")
setElementData(p, "player:srp", rp+10)
triggerClientEvent(p, "createNotif",p,"Otrzymujesz 250,000$ oraz 10 RP za przegranie 30 minut",3,"success")
outputChatBox("#00ff00✔ #ffffff- Otrzymujesz 250,000$ oraz 10 RP za przegranie 30 minut!",p,255,255,255,true)
end
if getElementData(p, "player:premiumplus") then
givePlayerMoney(p, 400000)
rp = getElementData(p, "player:srp")
zeton = getElementData(p, "player:zetony")
setElementData(p, "player:srp", rp+20)
setElementData(p, "player:zetony", zeton+1)
triggerClientEvent(p,"[GOLD] Otrzymujesz 400,000$ oraz 20 RP za przegranie 30 minut oraz 1 zeton",3,"success")
outputChatBox(&...
3. database
poni?szy skrypt zamiast dodawa? pieni?dze na podstawie danych w bazie danych to daje b??d.

b??d:

Kod:

WARNING: [moje-skrypty]zapisserver.lua:26: Bad argument @ 'setPlayerMoney' [Expected number at argument 2, got table]


skrypt: ( setPlayerMoney(source,wynikglowny[1],Portfel) to jest 26 linijka jak co?)
Kod:

addEventHandler("onPlayerJoin",root,function()
local wynik=dbQuery(db,"SELECT * FROM Gracze WHERE Nick=?",getPlayerName(source))
local wynikglowny=dbPoll(wynik, -1)
setPlayerMoney(source,wynikglowny[1],Portfel)
end)




db: https://imgur.com/a/Mb2U4W6

Stawiam piwko za pomoc
4. Zapisywanie w database
Mam ma?y problem bo jak mam t? linijke to nie zapisuje nic w databasie
kod:
function zbieracz(el, md)
if el ~= localPlayer or not md then return end
if getPedOccupiedVehicle(localPlayer) then
triggerEvent('onClientAddNotification', localPlayer, 'Nie mozesz zbierac w pojezdzie!', 'error')
return end
triggerEvent('onClientAddNotification', localPlayer, 'Zbierasz topy....', 'info')
setElementFrozen(el, true)
setPedAnimation(localPlayer, "COP_AMBIENT", "Copbrowse_nod", -1, true, false )
setTimer(function()
local topy = math.random(1,3)
setElementFrozen(el, false)
setPedAnimation(localPlayer, false)
t? tutaj--> exports["pystories-db"]:dbSet("UPDATE pystories_users SET jablka=jablka+"..topy.." WHERE id=?", getElementData(el, "player:sid"))
triggerEvent('onClientAddNotification', localPlayer, 'Zebrales '..topy..' topa(y)', 'success')
end, 4000, 1)
showMarker()
playSoundFrontEnd(12)
end
5. Database
[20-01-22 15] WARNING: sarp_interiors/sourceS.lua:125: dbPoll failed; You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM interiors ORDER BY interiorId DESC LIMIT 1' at line 1

[20-01-22 15] ERROR: sarp_interiors/sourceS.lua:125: attempt to index a boolean value

Prosi?bym o pomoc, nie dzia?a stworzenie interioru.

Dorzucam kod linijki 125: https://pastebin.com/Af0VbtnA
6. Database XyzzyRP
Kod:

[2018-06-28 13] ERROR: [XyzzyRP]/lss-core/server_stats.lua:27: bad argument #2 to 'format' (string expected, got boolean)
[2018-06-28 13] ERROR: [XyzzyRP]/lss-core/server_stats.lua:26: call: failed to call 'DB:esc' [string "?"]
[2018-06-28 13] ERROR: [XyzzyRP]/DB/sql.lua:43: bad argument #1 to 'mysql_escape_string' (mysqlHandler expected, got nil)
[2018-06-28 13] ERROR: [XyzzyRP]/DB/sql.lua:31: bad argument #1 to 'mysql_ping' (mysqlHandler expected, got nil)
[2018-06-28 13] ERROR: [XyzzyRP]/lss-core/server_stats.lua:14: call: failed to call 'DB:zapytanie' [string "?"]
[2018-06-28 13] ERROR: [XyzzyRP]/DB/sql.lua:70: bad argument #1 to 'mysql_query' (mysqlHandler expected, got nil)
[2018-06-28 13] WARNING: [XyzzyRP]/DB2/sql.lua:37: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got boolean]

Co mam zrobi? z takim b??dem?
7. MySql database
Please help me, I have got 1 script where is everything from gamemode ( It is database :D ) and how to connect it with my database online ( dbadmin.sk I can give you password and you can do it please ) But when I click to IMPORT and take this file ERROR and when I click to database and copy this text there ERROR