Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2017-12-01, 14:05


SereG







Wiek: 27
Na forum: 3489 dni
Posty: 6
Nick w MP: SekreTny



Respekt: 50

Ostrzeżeń: 40%
Witam mam taki problem ?e nie dzia?a tuner Jak montuje Swiat?a np to zabiera kase a nie daje swiate?, i tak samo z tune ....

b?ad:

ERROR:[skrypty_g??wne]/ogrpg-core/vehicles.lua94:call failed to call 'ogrpg-db'PobierzWyniki[string"?"]
a tu 2

ERROR:[skrypty_g??wne]/s_db.lua96:96:attempt to call global 'mysql_query' (a nil value)

kto? mo?e wys?a? mi gotowe pliki lub pom?c w naprawi? ?? nie znam si? zbytnio na lua

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-01, 14:09


PreQ

Halo admin






Wiek: 29
Na forum: 3111 dni
Posty: 34
Nick w MP: Shikomaru

Piwa: 80

Respekt: 60

Podaj kod z vehicles.lua i s_db.lua bez tego nie jestem w stanie Ci pom?c

Podpis
Mapper & Lua

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-01, 14:18


SereG







Wiek: 27
Na forum: 3489 dni
Posty: 6
Nick w MP: SekreTny



Respekt: 50

Ostrzeżeń: 40%
Cytat:

DBHandler=dbConnect("mysql", "dbname="nazwa";host=" "", DBUser, DBPass, "share=1;autoreconnect=1")
if DBHandler then
outputDebugString("* Connect to server MYSQL...")
dbSet("SET NAMES utf8")
else
outputDebugString("* No Connecting to server MYSQL..")
end
end)


local SQL_LOGIN="tulogn"
local SQL_PASSWD="tuhaslo"
local SQL_DB="tudb"
local SQL_HOST="tuhost"
local SQL_PORT=tuport

local root = getRootElement()

local SQL

local function connect()
SQL = mysql_connect(SQL_HOST, SQL_LOGIN, SQL_PASSWD, SQL_DB, SQL_PORT)
if (not SQL) then
outputServerLog("BRAK POLACZENIA Z BAZA DANYCH!")
else
--mysql_query(SQL,"SET NAMES utf8")
--outputServerLog("Modul mysql polaczony!")
end

end


local function keepAlive()
if (not mysql_ping(SQL)) then
outputServerLog("Zerwane polaczenie z baza danych, nawiazywanie...")
connect()
end
end
addEventHandler("onResourceStart",getResourceRootElement(),function()
connect()
setTimer(keepAlive, 30000, 0)
end)

function esc(value)
return mysql_escape_string(SQL,value)
end

function pobierzTabeleWynikow(query)
local result=mysql_query(SQL,query)
if (not result) then
outputDebugString("mysql_query failed: (" .. mysql_errno(SQL) .. ") " .. mysql_error(SQL))
outputServerLog("mysql_query failed: (" .. mysql_errno(SQL) .. ") " .. mysql_error(SQL))
return nil
end
local tabela={}
for result,row in mysql_rows_assoc(result) do
table.insert(tabela,row)
end
mysql_free_result(result)
return tabela
end

function pobierzWyniki(query)
local result=mysql_query(SQL,query)
if (not result) then return nil end
row = mysql_fetch_assoc(result)
mysql_free_result(result)
return row
end


function zapytanie(query)
local result=mysql_query(SQL,query)
if (result) then mysql_free_result(result) return true end
return
end

function insertID()
return mysql_insert_id(SQL)
end

function affectedRows()
return mysql_affected_rows(SQL)
end


function fetchRows(query)
local result=mysql_query(SQL,query)
if (not result) then return nil end
local tabela={}

while true do
local row = mysql_fetch_row(result)
if (not row) then break end
table.insert(tabela,row)
end
mysql_free_result(result)
return tabela
end


function getSQLLink()
return SQL
end



a je?eli chodzi o vehicels.lua to nie ma go w folderze ogrpg-vehicles

[ Dodano: 2017-12-01, 14:21 ]
Cytat:

--[[
Resource: OURGame v2
Developers: Split <[email protected]>
You have no right to use this code without my permission.
(c) 2015 <[email protected]>. All rights reserved.
]]


addCommandHandler("syrenki", function(plr,cmd)
local vehicle=getPedOccupiedVehicle(plr)
if not vehicle then return end
if not getElementData(plr,"player:admin") then return end
removeVehicleSirens(vehicle)
addVehicleSirens(vehicle, 2, 2, true, false, true, false )
setVehicleSirens(vehicle, 1, -0.600, -2.100, 0.400, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 2, 0.600, -2.100, 0.400, 0, 0, 255, 255, 255 )
end)


-- Get vehicle keys
function getVehicleKey(plr,veh)
if plr and veh then
local uid=getElementData(plr,"player:uid")
if not uid then return end
if getElementData(plr,"player:admin") or uid == getElementData(veh,"vehicle:ownedPlayer") then
return true
else
return false
end
end
end
local categoryL={[592] = true,[553] = true,[577] = true,[488] = true,[511] = true,[497] = true,[548] = true,[563] = true,[512] = true,[476] = true,[593] = true,[447] = true,[425] = true,[519] = true,[520] = true,[460] = true,[417] = true,[469] = true,[487] = true,[513] = true}
addEventHandler("onVehicleStartEnter", root, function(plr,seat,jacked)
if getElementHealth(source) < 302 then
setElementHealth(source,302)
end
end)
function jestwtabeli(***,truj)
for k,v in pairs(***) do
if v == truj then
return true
end
end
return false
end
addCommandHandler("vdodaj",function(plr,cmd,target)
local veh = getPedOccupiedVehicle(plr)
if not veh then outputChatBox("* Nie siedzisz w aucie!",plr,255,0,0) return end
if getElementData(veh,"vehicle:ownedPlayer") ~= getElementData(plr,"player:uid") then outputChatBox("* Ten pojazd nie nale?y od ciebie!",plr,255,0,0) return end
if not target then
outputChatBox("* Zabrano dostep wszystkim gracz?!",plr,255,0,0)
setElementData(veh,"vehicle:rent",0)
else
local target=findPlayer(plr, target)
if not target then
outputChatBox("* Nie znaleziono gracza online!",plr,255,0,0)
return
end
local rent = getElementData(veh,"vehicle:rent")
if (type(rent) ~= "table") then
local tabelka = {}
table.insert(tabelka,getElementData(target,"player:uid"))
setElementData(veh,"vehicle:rent",tabelka)
outputChatBox(string.format("*Dodano gracza "..getPlayerName(target).."(UID :"..getElementData(target,"player:uid")..") do wypo?ycze?"),plr)
else
local tabelka = rent
if jestwtabeli(tabelka,getElementData(target,"player:uid")) then outputChatBox("* Ten gracz aktualnie posiada kluczyki do twojego pojazdu!",plr) return end
if #tabelka > 5 then outputChatBox("Mo?esz wypo?yczy? maksymalnie 5 gracz?!",plr) return end
table.insert(tabelka,getElementData(target,"player:uid"))
setElementData(veh,"vehicle:rent",tabelka)
outputChatBox(string.format("*Dodano gracza "..getPlayerName(target).."(UID :"..getElementData(target,"player:uid")..") do wypo?ycze?"),plr)
end
end
end)

-- Tutaj dalsza cze?c kodu
addEventHandler("onVehicleStartEnter", root, function(plr,seat,jacked)
if seat ~= 0 then return end
if categoryL[getElementModel(source)] then return end
local query=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","prawko", getPlayerSerial(plr))
local result=exports["ogrpg-db"]:pobierzWyniki(query)
if (result) then
outputChatBox(" Posiadasz zawieszone prawo jazdy do "..result["time"]..", za: "..result["reason"], plr, 255, 0, 0)
cancelEvent()
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "prawko", getPlayerSerial(plr))
end
end)

addEventHandler("onVehicleEnter", root, function(plr,seat,jacked)
if seat ~= 0 then return end
if categoryL[getElementModel(source)] then return end
local queryA=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","prawko", getPlayerSerial(plr))
local resultA=exports["ogrpg-db"]:pobierzWyniki(queryA)
if (resultA) then
--setControlState ( plr, "enter_exit", true )
setTimer(setControlState, 800, 1, plr,"enter_exit", true)
setTimer(setControlState, 1800, 1, plr,"enter_exit", false)
outputChatBox("* Posiadasz zawieszone prawo jazdy do "..resultA["time"]..", za: "..resultA["reason"], plr, 255, 0, 0)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "prawko", getPlayerSerial(plr))
end
end)

addEventHandler("onVehicleStartEnter", root, function(plr,seat,jacked)
if seat ~= 0 then return end
if not categoryL[getElementModel(source)] then return end
local query=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","L", getPlayerSerial(plr))
local result=exports["ogrpg-db"]:pobierzWyniki(query)
if (result) then
outputChatBox(" Posiadasz zawieszona licencje do "..result["time"]..", za: "..result["reason"], plr, 255, 0, 0)
cancelEvent()
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "L", getPlayerSerial(plr))
end
end)

addEventHandler("onVehicleEnter", root, function(plr,seat,jacked)
if seat ~= 0 then return end
if not categoryL[getElementModel(source)] then return end
local queryA=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","L", getPlayerSerial(plr))
local resultA=exports["ogrpg-db"]:pobierzWyniki(queryA)
if (resultA) then
--setControlState ( plr, "enter_exit", true )
setTimer(setControlState, 800, 1, plr,"enter_exit", true)
setTimer(setControlState, 1800, 1, plr,"enter_exit", false)
outputChatBox("* Posiadasz zawieszona licencje do "..resultA["time"]..", za: "..resultA["reason"], plr, 255, 0, 0)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "L", getPlayerSerial(plr))
end
end)

addCommandHandler("vopis", function(plr,cmd,...)
if not getElementData(plr, "player:admin") then outputChatBox("*Brak uprawnien", plr) return end
local desc=table.concat(arg, " ")
local veh=getPedOccupiedVehicle(plr)
if not veh then
outputChatBox("* Musisz siedzie? w poje?dzie kt?rego opis chcesz zmieni?.", plr, 255, 0, 0)
return
end
if getElementData(veh, "vehicle:desc") then
setElementData(veh, "vehicle:desc", false)
return end
if string.len(desc) < 2 then
outputChatBox("* U?ycie: /vopis <opis min 2 znaki>", plr)
return
end

descc=string.format("%s", desc)
setElementData(veh,"vehicle:desc",descc)
end)

addEventHandler ( "onVehicleEnter", getRootElement(), function(thePlayer, seat, jacked)
if seat==0 then
-- setVehicleDoorOpenRatio(source, 2, 0, 500)
if (getVehicleDoorState(source,2)==0) then
setVehicleDoorState(source,2,1)
setVehicleDoorState(source,2,0)
end
elseif seat==1 then
if (getVehicleDoorState(source,3)==0) then
setVehicleDoorState(source,3,1)
setVehicleDoorState(source,3,0)
end
else
-- if (getVehicleDoorState(source,4)==0) then
setVehicleDoorState(source,4,1)
setVehicleDoorState(source,4,0)
-- end
-- if (getVehicleDoorState(source,5)==0) then
setVehicleDoorState(source,5,1)
setVehicleDoorState(source,5,0)
-- end

end
end)

addEventHandler("onPlayerQuit", root, function()
if not getElementData(source,"player:job") then return end
local veh=getPedOccupiedVehicle(source)
if not veh then return end
local id=getElementData(veh,"vehicle:id")
if not id then
if getElementData(source,"player:job") == "Sweepers" then return end
triggerEvent("destroyVehicle", root, veh)
end
end)


--[[
function streamIn( element, forpl )
element = element or source
if ( not getVehicleOccupant(element, 0) and not getVehicleOccupant( element, 1 ) and not getVehicleOccupant( element, 2 ) and not getVehicleOccupant( element, 3 ) and not getVehicleOccupant( element, 4 ) ) then
local towed = getVehicleTowedByVehicle(element)
if towed then
triggerClientEvent( forpl, "setElementPosForPl", forpl, element, towed )
else
triggerClientEvent( forpl, "setElementPosForPl", forpl, element, false )
end
else
local tower = getVehicleTowingVehicle(element)
if tower then
triggerClientEvent( forpl, "setElementPosForPl", forpl, tower, element )
else
triggerClientEvent( forpl, "setElementPosForPl", forpl, element, false )
end
end
end
addEvent( "streamIn", true )

addEventHandler( "streamIn", getRootElement(), streamIn )

]]--



Znalaz?em Vehicles.lua by? w ogrpg-core nie znam si? a? tak xd

Ostatnio zmieniony przez SereG 2017-12-01, 14:21, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-01, 14:21


PreQ

Halo admin






Wiek: 29
Na forum: 3111 dni
Posty: 34
Nick w MP: Shikomaru

Piwa: 80

Respekt: 60

"SereG" napisał/a:

Cytat:

DBHandler=dbConnect("mysql", "dbname="nazwa";host=" "", DBUser, DBPass, "share=1;autoreconnect=1")
if DBHandler then
outputDebugString("* Connect to server MYSQL...")
dbSet("SET NAMES utf8")
else
outputDebugString("* No Connecting to server MYSQL..")
end
end)


local SQL_LOGIN="tulogn"
local SQL_PASSWD="tuhaslo"
local SQL_DB="tudb"
local SQL_HOST="tuhost"
local SQL_PORT=tuport

local root = getRootElement()

local SQL

local function connect()
SQL = mysql_connect(SQL_HOST, SQL_LOGIN, SQL_PASSWD, SQL_DB, SQL_PORT)
if (not SQL) then
outputServerLog("BRAK POLACZENIA Z BAZA DANYCH!")
else
--mysql_query(SQL,"SET NAMES utf8")
--outputServerLog("Modul mysql polaczony!")
end

end


local function keepAlive()
if (not mysql_ping(SQL)) then
outputServerLog("Zerwane polaczenie z baza danych, nawiazywanie...")
connect()
end
end
addEventHandler("onResourceStart",getResourceRootElement(),function()
connect()
setTimer(keepAlive, 30000, 0)
end)

function esc(value)
return mysql_escape_string(SQL,value)
end

function pobierzTabeleWynikow(query)
local result=mysql_query(SQL,query)
if (not result) then
outputDebugString("mysql_query failed: (" .. mysql_errno(SQL) .. ") " .. mysql_error(SQL))
outputServerLog("mysql_query failed: (" .. mysql_errno(SQL) .. ") " .. mysql_error(SQL))
return nil
end
local tabela={}
for result,row in mysql_rows_assoc(result) do
table.insert(tabela,row)
end
mysql_free_result(result)
return tabela
end

function pobierzWyniki(query)
local result=mysql_query(SQL,query)
if (not result) then return nil end
row = mysql_fetch_assoc(result)
mysql_free_result(result)
return row
end


function zapytanie(query)
local result=mysql_query(SQL,query)
if (result) then mysql_free_result(result) return true end
return
end

function insertID()
return mysql_insert_id(SQL)
end

function affectedRows()
return mysql_affected_rows(SQL)
end


function fetchRows(query)
local result=mysql_query(SQL,query)
if (not result) then return nil end
local tabela={}

while true do
local row = mysql_fetch_row(result)
if (not row) then break end
table.insert(tabela,row)
end
mysql_free_result(result)
return tabela
end


function getSQLLink()
return SQL
end



a je?eli chodzi o vehicels.lua to nie ma go w folderze ogrpg-vehicles



Nie pod??czy?e? SQL, we? dane z hostingu ( z bazy mysql) i wstaw w odpowiednie miejsce w kodzie ;)

Podpis
Mapper & Lua

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-01, 14:28


SereG







Wiek: 27
Na forum: 3489 dni
Posty: 6
Nick w MP: SekreTny



Respekt: 50

Ostrzeżeń: 40%
"PreQ" napisał/a:

DBHandler=dbConnect("mysql", "dbname="db_28475";host="94.23.90.14"," db_28874, tutajhas?o "share=1;autoreconnect=1")


o to chodzi ?? , a i czy musze teraz restartowa? serwer ?

[ Dodano: 2017-12-01, 14:38 ]
bo je?eli chodzi o to tu login tu has?o to tam mam pasy xd

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-01, 15:14


PreQ

Halo admin






Wiek: 29
Na forum: 3111 dni
Posty: 34
Nick w MP: Shikomaru

Piwa: 80

Respekt: 60

Musisz wype?ni? wszystkie pola w kodzie dt. mysql
Np tutaj:

 local SQL_LOGIN="tulogn"
local SQL_PASSWD="tuhaslo"
local SQL_DB="tudb"
local SQL_HOST="tuhost"
local SQL_PORT=tuport 


Podpis
Mapper & Lua

Postaw piwo autorowi tego posta
 

 
Tagi: tuner :: nie :: działa
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku