radzik3211
Wiek: 32 Na forum: 3811 dni Posty: 1
Witam pobra?em paczke NewWorld wszysto dzia?a ale gdy wsiadam do auta to w konsoli pojawiaj? si? b?edy
Kod: [2016-09-17 14] ERROR: ogrpg-db/s_db.lua:96: attempt to call global 'mysql_query' (a nil value)
[2016-09-17 14] ERROR: ogrpg-core/vehicles.lua:81: call: failed to call 'ogrpg-db:pobierzWyniki' [string "?"]
[2016-09-17 14] ERROR: ogrpg-db/s_db.lua:96: attempt to call global 'mysql_query' (a nil value)
[2016-09-17 14] ERROR: ogrpg-vehicles/s_vehbuy.lua:430: call: failed to call 'ogrpg-db:pobierzWyniki' [string "?"]
[2016-09-17 14] ERROR: ogrpg-db/s_db.lua:96: attempt to call global 'mysql_query' (a nil value)
[2016-09-17 14] ERROR: ogrpg-core/vehicles.lua:94: call: failed to call 'ogrpg-db:pobierzWyniki' [string "?"]
[2016-09-17 14] ERROR: ogrpg-db/s_db.lua:96: attempt to call global 'mysql_query' (a nil value)
[2016-09-17 14] ERROR: ogrpg-vehicles/s_vehbuy.lua:478: call: failed to call 'ogrpg-db:pobierzWyniki' [string "?"]
Prosz? o pomoc a tu s? te linijki gdzie wyskakuj? b?edy
Kod: 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
Kod: 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)
Kod: 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)
Kod: addEventHandler("onVehicleEnter", getRootElement(), function(plr,seat,jacked)
if seat ~= 0 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","A", getPlayerSerial(plr))
local resultA=exports["ogrpg-db"]:pobierzWyniki(queryA)
if (resultA) then
setControlState ( plr, "enter_exit", true )
setTimer(toggleControl, 3000, 1, plr,"enter_exit", true)
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=?", "A", getPlayerSerial(plr))
end