panneau du maire despawn ?

  • Initiateur de la discussion
GamesCrackFR

GamesCrackFR

Geek suprême
Messages
192
Score réaction
3
Points
115
Bonjour je voudrais s'avoir comment faire pour que quand le maire meurt le panneau des lois disparais
 
AtoX611

AtoX611

Geek
Messages
53
Score réaction
5
Points
65
Bonsoir,
Va dans darkrp/gamemode/Init.lua
Remplace le par ceci :
GM.Version = "2.5.0"
GM.Name = "DarkRP"
GM.Author = "By Rickster, Updated: Pcwizdan, Sibre, philxyz, [GNC] Matt, Chrome Bolt, FPtje Falco, Eusion, Drakehawke"


DeriveGamemode("sandbox")

AddCSLuaFile("libraries/interfaceloader.lua")
AddCSLuaFile("libraries/modificationloader.lua")
AddCSLuaFile("libraries/fn.lua")

AddCSLuaFile("config/config.lua")
AddCSLuaFile("config/addentities.lua")
AddCSLuaFile("config/jobrelated.lua")
AddCSLuaFile("config/ammotypes.lua")

AddCSLuaFile("cl_init.lua")

GM.Config = GM.Config or {}
GM.NoLicense = GM.NoLicense or {}

include("libraries/interfaceloader.lua")

include("config/_MySQL.lua")
include("config/config.lua")
include("config/licenseweapons.lua")

include("libraries/modificationloader.lua")
include("libraries/fn.lua")
include("libraries/database.lua")


local fol = GM.FolderName.."/gamemode/modules/"
local files, folders = file.Find(fol .. "*", "LUA")
for k,v in pairs(files) do
if DarkRP.disabledDefaults["modules"][k] then continue end

include(fol .. v)
end

for _, folder in SortedPairs(folders, true) do
if folder == "." or folder == ".." or DarkRP.disabledDefaults["modules"][folder] then continue end

for _, File in SortedPairs(file.Find(fol .. folder .."/sh_*.lua", "LUA"), true) do
AddCSLuaFile(fol..folder .. "/" ..File)

if File == "sh_interface.lua" then continue end
include(fol.. folder .. "/" ..File)
end

for _, File in SortedPairs(file.Find(fol .. folder .."/sv_*.lua", "LUA"), true) do
if File == "sv_interface.lua" then continue end
include(fol.. folder .. "/" ..File)
end

for _, File in SortedPairs(file.Find(fol .. folder .."/cl_*.lua", "LUA"), true) do
if File == "cl_interface.lua" then continue end
AddCSLuaFile(fol.. folder .. "/" ..File)
end
end

MySQLite.initialize()

DarkRP.DARKRP_LOADING = true
include("config/jobrelated.lua")
include("config/addentities.lua")
include("config/ammotypes.lua")
DarkRP.DARKRP_LOADING = nil

DarkRP.finish()

--// Give players armor on spawn //--
-- jobs.lua add SpawnArmor = xxx,

hook.Add("PlayerSpawn","Job Armor",function(ply)
local TeamK = ply:Team()
for k,v in pairs(RPExtraTeams or {}) do
if k == TeamK then
if v.SpawnArmor then
timer.Simple(0.1,function()
ply:SetArmor(v.SpawnArmor)
end)
return
end
end
end
end)

--// LAWS HUD //--
--// LAWS HUD //--
AddCSLuaFile("cl_init.lua")

-- These are the default laws, they're unchangeable in-game.
-- Change in DarkRP Config too!
local Laws = {
}

local FixedLaws = table.Copy( Laws )

local function AddLaw( ply, args )

if ply:Team() ~= TEAM_MAYOR then

GAMEMODE:Notify( ply, 1, 4, "You must be the mayor to set laws!")
return ""
end

if string.len( args ) < 3 then

GAMEMODE:Notify( ply, 1, 4, "Law too short.")
return ""
end

if #Laws >= 12 then

GAMEMODE:Notify( ply, 1, 4, "The laws are full.")
return ""
end

table.insert( Laws, args )

umsg.Start("DRP_AddLaw")

umsg.String( args )

umsg.End()

return ""
end
AddChatCommand("/addlaw", AddLaw )

local function RemoveLaw( ply, args )

if ply:Team() ~= TEAM_MAYOR then

GAMEMODE:Notify( ply, 1, 4, "You must be the mayor to remove laws!")
return ""
end

if not tonumber( args ) then

GAMEMODE:Notify( ply, 1, 4, "Invalid arguments.")
return ""
end

if not Laws[ tonumber( args ) ] then

GAMEMODE:Notify( ply, 1, 4, "Invalid law.")
return ""
end

if FixedLaws[ tonumber( args ) ] then

GAMEMODE:Notify( ply, 1, 4, "You are not allowed to change the default laws.")
return ""
end

table.remove( Laws, tonumber( args ) )

umsg.Start("DRP_RemoveLaw")

umsg.Char( tonumber( args ) )

umsg.End()

return ""
end
AddChatCommand("/removelaw", RemoveLaw )


hook.Add("PlayerInitialSpawn", "SendLaws", function( ply )

for i, law in pairs( Laws ) do

if FixedLaws[ i ] then continue end

umsg.Start("DRP_AddLaw", ply )

umsg.String( law )

umsg.End()

end

end )
Maintenant dans dans darkrp/gamemode/cl_init.lua
Et remplace par ceci :
GM.Version = "2.5.0"
GM.Name = "DarkRP"
GM.Author = "By Rickster, Updated: Pcwizdan, Sibre, philxyz, [GNC] Matt, Chrome Bolt, FPtje Falco, Eusion, Drakehawke"

DeriveGamemode("sandbox")
local function LoadModules()
local root = GM.FolderName.."/gamemode/modules/"

local _, folders = file.Find(root.."*", "LUA")

for _, folder in SortedPairs(folders, true) do
if DarkRP.disabledDefaults["modules"][folder] then continue end

for _, File in SortedPairs(file.Find(root .. folder .."/sh_*.lua", "LUA"), true) do
if File == "sh_interface.lua" then continue end
include(root.. folder .. "/" ..File)
end
for _, File in SortedPairs(file.Find(root .. folder .."/cl_*.lua", "LUA"), true) do
if File == "cl_interface.lua" then continue end
include(root.. folder .. "/" ..File)
end
end
end

GM.Config = {} -- config table
GM.NoLicense = GM.NoLicense or {}

include("config/config.lua")
include("libraries/fn.lua")
include("libraries/interfaceloader.lua")

include("libraries/modificationloader.lua")
LoadModules()

DarkRP.DARKRP_LOADING = true
include("config/jobrelated.lua")
include("config/addentities.lua")
include("config/ammotypes.lua")
DarkRP.DARKRP_LOADING = nil

DarkRP.finish()

--// DarkRP Laws //--
--// DarkRP Laws //--

-- These are the default laws, they're unchangeable in-game.
-- Change in DarkRP Config too!
local Laws = {
}

function DrawLaws()

local X = ScrW()-500
local Y = 0
local W = 500
local H = 290

surface.SetDrawColor( 0, 0, 0, 200 )
surface.DrawRect( X, Y, W, 35+(#Laws*20) )

draw.RoundedBox( 4, X, Y, W, 30, Color( 0, 0, 0, 200 ) )
draw.DrawText("LAWS OF THE LAND", "TargetID", X+W/2, Y+7, Color( 100, 185, 255, 200 ), TEXT_ALIGN_CENTER )

local y = 35
for i, law in pairs( Laws ) do

draw.DrawText( i .. ": " .. law, "TargetID", X+5, y, Color( 100, 185, 200, 200 ) )

y = y + 20

end

end
hook.Add("HUDPaint", "DrawLaws", DrawLaws)


local function AddLaw( um )

print("Catched by Lawshud")
table.insert( Laws, um:ReadString() )

end
usermessage.Hook("DRP_AddLaw", AddLaw )

local function RemoveLaw( um )

table.remove( Laws, um:ReadChar() )

end
usermessage.Hook("DRP_RemoveLaw", RemoveLaw )
Je n'ai pas téster donc a toi de tester ;)
 
Dernière édition:
  • Initiateur de la discussion
GamesCrackFR

GamesCrackFR

Geek suprême
Messages
192
Score réaction
3
Points
115
j'ai essaye en local et ca ma fait plein d'erreur
 
AtoX611

AtoX611

Geek
Messages
53
Score réaction
5
Points
65
Dommage :(
 
AtoX611

AtoX611

Geek
Messages
53
Score réaction
5
Points
65
Hey,
Sinon quand le maire meurt, tu mes une condition qu'il se mette en citoyen, ensuite dès que un nouveau maire arrive le tableau reset.
1. Va dans darkrpmodification/lua/darkrp_config/settings.lua.
Cherche: GM.Config.shouldResetLaws.
Met le en True.

Ensuite,
2. Va dans darkrp_customthings/jobs.lua
Cherche la team_mayor et a la fin rajoute la condition que quand il meurt il devient citoyen, comme la vidéo ici.
 
  • Initiateur de la discussion
GamesCrackFR

GamesCrackFR

Geek suprême
Messages
192
Score réaction
3
Points
115
salut j'ai deja fait ca mais le panneau disparaît pas
 
Discord d'entraide
Rejoignz-nous sur Discord