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
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) .....
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...
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("...
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...
[code]local polaczenie = dbConnect ( "sqlite", "db.db" )
if polaczenie then
outputDebugString("Wczytano pojazdy z przechowywalni")
else
outputDebugString("Nie wczytano pojazd?w z przechowywalni")
end
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 = {}
...