Besoin de vous

  • Initiateur de la discussion
A

Anonymedu02

Têtard
Messages
19
Score réaction
1
Points
5
Bonjour bonsoir j'ai des erreur lua que j'arrive pas a regler pouvez vous m'aidez svp
les erreur:
Lua Error: [sh_accessory_system] Couldn't include file 'includes/modules/mysqloo.lua' - File not found (@addons/sh_accessory_system/lua/accessory/sv_database.lua (line 13))
1. unknown - addons/sh_accessory_system/lua/accessory/sv_database.lua:13
2. pcall - [C]:-1
3. unknown - addons/sh_accessory_system/lua/accessory/sv_database.lua:12
4. include - [C]:-1
5. unknown - addons/sh_accessory_system/lua/autorun/autorun_accessory.lua:21
[sh_accessory_system] Couldn't include file 'includes/modules/mysqloo.lua' - File not found (@addons/sh_accessory_system/lua/accessory/sv_database.lua (line 13))
1. unknown - addons/sh_accessory_system/lua/accessory/sv_database.lua:13
2. pcall - [C]:-1
3. unknown - addons/sh_accessory_system/lua/accessory/sv_database.lua:12
4. include - [C]:-1
5. unknown - addons/sh_accessory_system/lua/autorun/autorun_accessory.lua:21
code Addon/sh_accessory_systeme/lua/accessory/sv_database.lua:
Code:
-- Configure your MySQL database here
SH_ACC.MySQLConfig = { host = "localhost", username = "root", password = "", database = "default", port = 3306,
}
-----------------
pcall(function() require("mysqloo") require("tmysql4")
end)
SH_ACC.TableName = "sh_accessory"
local DB_DEFAULT = 0
local DB_MYSQLOO = 1
local DB_TMYSQL4 = 2
local function db_mode() return SH_ACC.DatabaseMode
end
function SH_ACC:InitializeDB() local mode = db_mode() self:ConnectToDB(function(ok, err) if (mode == DB_MYSQLOO or mode == DB_TMYSQL4) then if (!ok) then MsgC(Color(52, 152, 219), "SH Accessories", Color(255, 0, 0), ": Failed to connect to MySQL database! (" .. err .. ")\n") return end MsgC(Color(52, 152, 219), "SH Accessories", Color(0, 255, 0), ": Connected to MySQL database!\n") else MsgC(Color(52, 152, 219), "SH Accessories", Color(0, 255, 0), ": Using sv.db for data.\n") end self:TableExists(self.TableName, function(exists) if (exists) then return end if (mode == DB_MYSQLOO or mode == DB_TMYSQL4) then self:Query("CREATE TABLE " .. self.TableName .. " ( id VARCHAR(50) PRIMARY KEY, inventory TEXT, equipped TEXT )") else self:Query("CREATE TABLE " .. self.TableName .. " ( id string, inventory string, equipped string )") end MsgC(Color(52, 152, 219), "SH Accessories", Color(0, 255, 0), ": Created " .. self.TableName .. " table.\n") end) end)
end
function SH_ACC:ConnectToDB(callback) local cfg = self.MySQLConfig callback = callback or function(ok, err) end local mode = db_mode() if (mode == DB_MYSQLOO) then local db = mysqloo.connect(cfg.host, cfg.username, cfg.password, cfg.database, cfg.port) db:setAutoReconnect(true) db:setMultiStatements(true) db.onConnected = function() callback(true) end db.onConnectionFailed = function(me, err) callback(false, err) end db:connect() _SH_ACC_DATABASE = db elseif (mode == DB_TMYSQL4) then local db, err = tmysql.initialize(cfg.host, cfg.username, cfg.password, cfg.database, 3306, nil, CLIENT_MULTI_STATEMENTS) if (db) then _SH_ACC_DATABASE = db callback(true) else callback(false, err) end else callback(true) end
end
function SH_ACC:Query(q, args, callback) callback = callback or function() end for k, v in pairs (args or {}) do if (type(v) == "Player" and IsValid(v)) then -- cast player into formatted steamid v = v:SteamID():Replace(":", "_"):sub(7) end q = q:Replace(":" .. k, self:EscapeString(v)) end q = q:Replace(":db", self.TableName) self:ExecuteQuery(q, callback)
end
-- override me
function SH_ACC:TableExists(s, callback) local mode = db_mode() if (mode == DB_MYSQLOO or mode == DB_TMYSQL4) then self:Query("DESCRIBE " .. s, {}, function(data, ok) callback(ok) return true end) else callback(sql.TableExists(s)) end
end
function SH_ACC:ExecuteQuery(query, callback) local mode = db_mode() if (mode == DB_MYSQLOO) then local q = _SH_ACC_DATABASE:query(query) q.onSuccess = function(me, data) callback(data, true) end q.onError = function(me, err, fq) local mute = callback(data, false) if (mute ~= true) then error("failed to run query '" .. query .. "' (" .. err .. ")") end end q:start() elseif (mode == DB_TMYSQL4) then _SH_ACC_DATABASE:Query(query, function(result) if (result[1]["status"]) then callback(result[1].data, true) else local mute = callback(result[1].data, false) if (mute ~= true) then error("failed to run query '" .. query .. "' (" .. result[1]["error"] .. ")") end end end, QUERY_FLAG_ASSOC) else local olderr = sql.m_strError local res = sql.Query(query) local err = sql.m_strError if (err and err ~= olderr) then error("failed to run query '" .. query .. "' (" .. err .. ")") return end if (callback) then callback(res) end end
end
function SH_ACC:EscapeString(s) local mode = db_mode() if (mode == DB_MYSQLOO) then return "\"" .. _SH_ACC_DATABASE:escape(s) .. "\"" elseif (mode == DB_TMYSQL4) then return "\"" .. _SH_ACC_DATABASE:Escape(s) .. "\"" else return sql.SQLStr(s) end
end
function SH_ACC:BeginCommit() local mode = db_mode() if (mode == DB_MYSQLOO or mode == DB_TMYSQL) then self:Query("BEGIN") else sql.Begin() end
end
function SH_ACC:FinishCommit() local mode = db_mode() if (mode == DB_MYSQLOO or mode == DB_TMYSQL) then self:Query("COMMIT") else sql.Commit() end
end
 
  • Initiateur de la discussion
A

Anonymedu02

Têtard
Messages
19
Score réaction
1
Points
5
code addons/sh_accessory_system/lua/autorun/autorun_accessory.lua :
Code:
SH_ACC = {}
-- Don't modify this.
-- The script won't explode if you do but it's better for everyone if you don't mislead players.
_SH_ACC_VERSION = "1.0.5"
if (SERVER) then AddCSLuaFile("autorun/autorun_accessory.lua") AddCSLuaFile("accessory/cl_accessory.lua") AddCSLuaFile("accessory/cl_interface.lua") AddCSLuaFile("accessory/cl_notify.lua") AddCSLuaFile("accessory/cl_editor.lua") AddCSLuaFile("accessory/cl_obj_player_extend.lua") AddCSLuaFile("accessory/sh_obj_player_extend.lua") AddCSLuaFile("accessory_addons.lua") AddCSLuaFile("accessory_list.lua") AddCSLuaFile("accessory_offsets.lua") AddCSLuaFile("accessory_config.lua") include("accessory/sv_accessory.lua") include("accessory/sv_database.lua") include("accessory/sv_obj_player_extend.lua")
else include("accessory/cl_accessory.lua") include("accessory/cl_interface.lua") include("accessory/cl_notify.lua") include("accessory/cl_editor.lua") include("accessory/cl_obj_player_extend.lua") include("accessory_offsets.lua")
end
include("accessory_addons.lua")
include("accessory_list.lua")
include("accessory_config.lua")
include("accessory/sh_obj_player_extend.lua")
if (SERVER) then if (SH_ACC.UseWorkshop) then resource.AddWorkshop("881305303") else resource.AddFile("materials/shenesis/accessory/backpack.png") resource.AddFile("materials/shenesis/accessory/close.png") resource.AddFile("materials/shenesis/accessory/hat.png") resource.AddFile("materials/shenesis/accessory/info.png") resource.AddFile("materials/shenesis/accessory/list.png") resource.AddFile("materials/shenesis/accessory/mask.png") resource.AddFile("materials/shenesis/accessory/previous.png") resource.AddFile("materials/shenesis/accessory/scarf.png") resource.AddFile("materials/shenesis/accessory/search.png") resource.AddFile("materials/shenesis/accessory/stop.png") resource.AddFile("materials/shenesis/accessory/sunglasses.png") resource.AddFile("materials/shenesis/accessory/user.png") resource.AddFile("resource/fonts/circular.ttf") resource.AddFile("resource/fonts/circular_bold.ttf") for i = 1, 16 do resource.AddFile("sound/shenesis/generic_cloth_movement" .. i .. ".ogg") end end
end
 
Yoh Sambre ♪

Yoh Sambre ♪

Shaman Fou
Messages
16 273
Score réaction
9 685
Points
1 845
" mysqloo.lua' - File not found "

tu doit installer mysqloo
 
  • Initiateur de la discussion
A

Anonymedu02

Têtard
Messages
19
Score réaction
1
Points
5
Yoh Sambre ♪ à dit:
" mysqloo.lua' - File not found "

tu doit installer mysqloo
juste ça et tous sera régler?
 
Yoh Sambre ♪

Yoh Sambre ♪

Shaman Fou
Messages
16 273
Score réaction
9 685
Points
1 845
  • Initiateur de la discussion
A

Anonymedu02

Têtard
Messages
19
Score réaction
1
Points
5
Discord d'entraide
Rejoignz-nous sur Discord