- Initiateur de la discussion
Heaven_Kittenxs
Nouveau né
- Messages
- 7
- Score réaction
- 1
- Points
- 20
bonjour
Je souhaiterais savoir comment utiliser la commande dans la console de mtx pour Reload tout mes perma prop
j'ai trouver une le script lua mais comment savoir quelle est la commande
Je souhaiterais savoir comment utiliser la commande dans la console de mtx pour Reload tout mes perma prop
j'ai trouver une le script lua mais comment savoir quelle est la commande
function TOOL:Reload(trace)
if CLIENT then return true end
if not PermaProps then self:GetOwner():ChatPrint( "ERROR: Lib not found" ) return end
if (not trace.Entity:IsValid() and PermaProps.HasPermission( self:GetOwner(), "Update")) then self:GetOwner():ChatPrint( "You have reload all PermaProps !" ) PermaProps.ReloadPermaProps() return false end
if trace.Entity.PermaProps then
local ent = trace.Entity
local ply = self:GetOwner()
if !PermaProps.HasPermission( ply, "Update") then return end
if ent:IsPlayer() then ply:ChatPrint( "That is a player !" ) return end
local content = PermaProps.PPGetEntTable(ent)
if not content then return end
PermaProps.SQL.Query("UPDATE permaprops set content = ".. sql.SQLStr(util.TableToJSON(content)) .." WHERE id = ".. ent.PermaProps_ID .." AND map = ".. sql.SQLStr(game.GetMap()) .. ";")
local new_ent = PermaProps.PPEntityFromTable(content, ent.PermaProps_ID)
if !new_ent or !new_ent:IsValid() then return end
PermaProps.SparksEffect( ent )
ply:ChatPrint("You updated the " .. ent:GetClass() .. " in the database.")
ent:Remove()
else
return false
end
return true
end
if CLIENT then return true end
if not PermaProps then self:GetOwner():ChatPrint( "ERROR: Lib not found" ) return end
if (not trace.Entity:IsValid() and PermaProps.HasPermission( self:GetOwner(), "Update")) then self:GetOwner():ChatPrint( "You have reload all PermaProps !" ) PermaProps.ReloadPermaProps() return false end
if trace.Entity.PermaProps then
local ent = trace.Entity
local ply = self:GetOwner()
if !PermaProps.HasPermission( ply, "Update") then return end
if ent:IsPlayer() then ply:ChatPrint( "That is a player !" ) return end
local content = PermaProps.PPGetEntTable(ent)
if not content then return end
PermaProps.SQL.Query("UPDATE permaprops set content = ".. sql.SQLStr(util.TableToJSON(content)) .." WHERE id = ".. ent.PermaProps_ID .." AND map = ".. sql.SQLStr(game.GetMap()) .. ";")
local new_ent = PermaProps.PPEntityFromTable(content, ent.PermaProps_ID)
if !new_ent or !new_ent:IsValid() then return end
PermaProps.SparksEffect( ent )
ply:ChatPrint("You updated the " .. ent:GetClass() .. " in the database.")
ent:Remove()
else
return false
end
return true
end