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: podpiecie
1. Lua - podpiecie bazy pod logowanie MTA
Witam, czy znalazlaby sie osoba ktora by miala chwile czasu i pomoc mi w podpieciu bazy pod logowanie? Niestety probowalem wielu metod lecz niestety nic z tego. Bede bardzo wdzieczny za pomoc

Pozdrawiam
2. Podpięcie drugi raz dobrej bazy danych
Potrzebuje pomocy bo chce wgra? drugi raz baze danych a mi wyskakuje taki b??d jak na
ss: https://imgur.com/4AvPsxq
3. Podpięcie logowania do bazy danych do bazy danych
Mam problem mam baz? danych i logowanie ale nie wiem jak pod??czy? logowanie do bazy danych ?eby dzia?a?o
4. podpięcie bazy danych
Witam, podpinaj?c baz? danych natrafi?em na problem.
nie wiem jak go narpawi?.
SS:
5. Podpiecie skryptu
Witajcie drodzy uzytkownicy gtao przychodze do was z prosba o to abyscie wspomogli w podpieci skryptu pod frakcje. Za dzialace stawiam stawiam browara :piwo:


addCommandHandler('test'function(source,cmd)
        
local save getElementData(source,'player:save') or {}
    
        
local x,y,getElementPosition(source)            
        
local utrudnienie createBlip(x,y,z19,2,0,0,0,0,0,275)
            --
outputChatBox('Postawiles Znak ostrzegawczy')
            
table.insert(save,utrudnienie)
            
setElementData(source,'player:save',save)
         
end)

    
addCommandHandler('test2',function(source,cmd)
local save getElementData(source,'player:save') or {}
for 
keysource in ipairs(getElementData(source,'player:save')) do
if 
isElement(sourcethen
destroyElement
(source)
end
end
--outputChatBox('Usuneles Znak ostrzegawczy')
removeElementData(source,'player:save')
end)
6. Nie działa podpiecie bazy OWL
Zastosowa?em si? do poradnika gravgora lecz po wyjscu z deatchmatch nie mam zadnego x86.
Baza zosta?a podpi?ta i to nic nie zmienia, nadal jest sending.
[code]-- connection settings
local hostname = "94.23.90.14"
local username ="db_45775"
local password = "GjadushgGuadyDSGaijd"
local database = "db_45775"
local port = 3306

-- global things.
local MySQLConnection = nil
local resultPool = { }
local sqllog = false
local countqueries = 0
a
-- connectToDatabase - Internal function, to spawn a DB connection
function connectToDatabase(res)
MySQLConnection = mysql_connect(hostname, username, password, database, port)

if (not MySQLConnection) then
if (res == getThisResource()) then
cancelEvent(true, "Cannot connect to the database.")
end
return nil
end

return nil
end
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), connectToDatabase, false)

-- destroyDatabaseConnection - Internal function, kill the connection if theres one.
function destroyDatabaseConnection()
if (not MySQLConnection) then
return nil
end
mysql_close(MySQLConnection)
return nil
end
addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), destroyDatabaseConnection, false)

-- do something usefull here
function logSQLError(str)
local message = str or 'N/A'
outputDebugString("MYSQL ERROR "..mysql_errno(MySQLConnection) .....
7. Podpiecie logowania/rejestracji
Cze??,
podpinam panel z Yad 3.1 do ogrpg i nie wiem co robi? ?le prosze o pomoc tu jest kod

po stronie serwera :

[lua]
--[[
Panel Logowania by Kurianusz @2016 .
Regulamin /Licencja
Korzystanie z tego kodu tylko je?eli posiadasz tzw. copyrights. Zakaz usuwania tej notatki!
Pami?taj ?e nielegalne korzystanie z kodu podpada pod kodeks karny :> Tak samo jak usuni?cie tej notatki!
]]

addEvent("logging:checkAccount", true)
addEventHandler("logging:checkAccount", resourceRoot, function(login,pass,save)
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?", login)
if result and #result > 0 then
serial=getPlayerSerial(client)
if result[1].register_serial~=serial then
tak=true
for i,v in ipairs(split(result[1].seriale,",")) do
if v==serial then tak=false end
end
if tak then
return triggerClientEvent(client, "logging:result", resourceRoot, false, "Error: Wykryto inny serial logowania konta. Napisz na forum","nope")
end
end
if result[1].login == login and result[1].pass == md5(pass) then
local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka321321"),login)
triggerClientEvent(client, "logging:result", resourceRoot, false, "Trwa logowanie do konta...","git")
return
end
if re...
8. Pro¶ba o podpięcie
Witam, prosz? podpi?cie tego skryptu pod baz? danych

[code]
typy={
[837]=-.5,
[835]=1,
[847]=1,
[684]=-.6,
}
typy2={837,835,847,684}

function zniszczDrzewo(drzewo)
if isElement(drzewo) then
destroyElement(drzewo)
givePlayerMoney(client,500)
outputChatBox("Drzewo ?ci?te! Otrzymujesz 500PLN",client,0,255,0)
end
end
addEvent("PSP:Zniszczdrzewo",true)
addEventHandler("PSP:Zniszczdrzewo",resourceRoot,zniszczDrzewo)

function dodajNoweMiejsce(plr,cmd,ilosc)
local accName=getAccountName(getPlayerAccount(plr))
if isObjectInACLGroup("user."..accName,aclGetGroup("Admin")) then
if ilosc then
ilosc=tonumber(ilosc)
if ilosc then
if math.floor(ilosc)==ilosc then
if ilosc>0 then
if ilosc<=100 then
x,y,z=getElementPosition(plr)
exports["ogrpg-db"]:dbSet("insert into PSP_drzewa values(null,?,?,?,?)",x,y,z,ilosc)
outputChatBox("Nowe miejsce na drzewo dla PSP dodano pomy?lnie!",plr,0,255,0)
else
outputChatBox("Limit drzewa to 100!",plr,255,0,0)
end
else
outputChatBox("Ilo?? drzewa wi?ksza od zera!",plr,255,0,0)
end
else
outputChatBox("Ilo?? drzewa musi by? liczb? ca?kowit?!",plr,255,0,0)
end
else
outputChatBox("B??d, popraw na: /"..cmd.." [ilo?? drzewa]",plr,255,0,0)
end
else
outputChatBox("...
9. Podpięcie skryptu pod mysql + funckcje
Witam mam taki skrypt na taxi i chcia?bym go podpi?? pod mysql i dodac funkcje typu sprawdza czy gracz jest zapisany w tabeli

kod :
[lua]local allow_vehs={
[420]=true,
}

local vehs={
{-1987.56555, 160.60571, 27.17412},
}

taxi={}

for k,v in ipairs(vehs)do
taxi[k]=createVehicle(420,v[1],v[2],v[3])
setElementData(taxi[k],"vehicle:taxi",true)
end

addEventHandler("onPlayerVehicleEnter",root,function(veh,seat)
if seat==0 then
if allow_vehs[getElementModel(veh)] then
if getElementData(veh,"vehicle:taxi") then
outputChatBox("*Zosta?e?(a?) taks?wkarzem. Dostaniesz informacj? o po?o?eniu klienta po wezwaniu us?ugi.",source,255,255,255)
setElementData(source,"player:taxi",true)
end
end
end
if allow_vehs[getElementModel(veh)] then
if getElementData(veh,"vehicle:taxi") then
setElementData(source,"taxi",false)
end
end
end)

addEventHandler("onPlayerVehicleExit",root,function(veh,seat)
if seat==0 then
if allow_vehs[getElementModel(veh)] then
if getElementData(veh,"vehicle:taxi") then
respawnVehicle(veh)
setElementData(source,"player:taxi",false)
end
end
end
end)



addCommandHandler("taxi",function(plr)
if getElementData(plr,"taxi") then
return outputChatBox("*Zam?wi?e?(a?) ju? us?ug?. Poczekaj cierpliwie na taks?wk?",plr,255,255,0)
end
count={}
f...
10. Pro¶ba o przerobienie skryptu podpięcie do bazy
[code]local polaczenie = dbConnect ( "sqlite", "db.db" )
if polaczenie then
outputDebugString("Wczytano pojazdy z przechowywalni")
else
outputDebugString("Nie wczytano pojazd?w z przechowywalni")
end

dbExec ( polaczenie, "CREATE TABLE IF NOT EXISTS Zapis ( Calyy INTEGER, Drzwii INTEGER, PP1 INTEGER, PL1 INTEGER, TP1 INTEGER, TL1 INTEGER, hpauta INTEGER, RS INTEGER, GS INTEGER, BS INTEGER, Tuning INTEGER, Przebieg INTEGER, ID INTEGER, Model INTEGER, Paintjob INTEGER, Paliwo INTEGER, Owner VARCHAR, color1 INTEGER, color2 INTEGER, color3 INTEGER, color4 INTEGER)" )

marker=createMarker(-1756.36,951.36,23.74,"cylinder",6,68,212,4,100)
odb=createMarker(-1748,960,24,"cylinder",1,255,0,0,100)

function oddajAutodoprzecho(e)
if source==marker then
if getElementType(e)=="vehicle" then
local idd=getElementData(e, "id")
local paliwo=getElementData(e, "pojazdy_paliwo")
if idd then
local owner=getElementData(e, "wlasciciel")
local model=getElementModel(e)
local paint=getVehiclePaintjob(e)
local przeb = getElementData ( e, "pojazd_przebieg" )
local upgrade = getVehicleTuning (e)
local c1,c2,c3,c4 = getVehicleColor ( e )
local rs,gs,bs = getVehicleHeadLightColor(e)
local autohp = getElementHealth(e)
local pp1,pl1,tp1,tl1 = getVehicleWheelStates(e)
local caly = {}
...
11. [DM] Podpięcie mapy pod Mysql
Siemanko Podpinam map? pod baz? mysql
w mysql_connect wszystkie dane poprawnie wpisywane..
Pomo?e kto? ?
Oczywi?cie za pomoc :piwo:
[code]
[15]

[15] ---------------------------

[15] MySQL Debugging activated (01/25/12)

[15] ---------------------------

[15]

[15] >> mysql_connect( )

[15] CMySQLHandler::CMySQLHandler() - constructor called.

[15] CMySQLHandler::CMySQLHandler() - Connecting to "s2.servhost.pl" | DB: "****" | Username: "****" ...

[15] CMySQLHandler::Connect() - Connection was successful.

[15] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.

[15] >> mysql_query( Connection handle: 1 )

[15] CMySQLHandler::Query(SELECT `nick`, `czas`, `data`, `powod`, `admin` FROM `BanyGraczy` WHERE `ip` = 'IP' OR `nick` = 'Jaroo') - An error has occured. (Error ID: 1146, Table 'samp723.BanyGraczy' doesn't exist)

[15] >> mysql_store_result( Connection handle: 1 )

[15] CMySQLHandler::StoreResult() - No data to store.

[15] >> mysql_num_rows( Connection handle: 1 )

[15] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection)

[15] >> mysql_fetch_row_format( Connection handle: 1 )

[15] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)

[15] >> mysql_free_result( Connection handle: 1 )

[15] CMySQLHandler::FreeResult() - The result is already empty.

[15] >> mysql_query( Co...