Besoin d'aide ERREUR LUA Jobs

  • Initiateur de la discussion Florian Kenway
  • Date de début
  • Initiateur de la discussion
Florian Kenway

Florian Kenway

Geek
Messages
69
Score réaction
5
Points
95
[ERROR] Lua is unable to understand file "darkrp_customthings/jobs.lua" because its author made a mistake around line number 70.
The best help I can give you is this:

There is an opening '{' bracket at line 21, but this bracket is never closed or not closed in time. It was expected to be closed before the 'TEAM_COMANDPOL' at line 70.

Hints:
- Did you forget a comma?
- All open brackets ({, (, [) must have a matching closing bracket. Are you sure it's there?
- Brackets must be opened and closed in the right order. This will work: ({}), but this won't: ({)}.


Config des jobs:

TEAM_CITIZEN = DarkRP.createJob("Citoyen", {
color = Color(20, 150, 20, 255),
model = {
"models/humans/group02/player/tale_01.mdl",
"models/humans/group02/player/tale_03.mdl",
"models/humans/group02/player/tale_04.mdl",
"models/humans/group02/player/tale_05.mdl",
"models/humans/group02/player/tale_06.mdl",
"models/humans/group02/player/tale_07.mdl",
"models/humans/group02/player/tale_09.mdl",
"models/humans/group02/player/temale_01.mdl",
"models/humans/group02/player/temale_02.mdl",
"models/humans/group02/player/temale_07.mdl",
},
description = [[Citoyen]],
weapons = {},
command = "citizen",
max = 0,
salary = 5,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Citizens",

TEAM_MAYOR = DarkRP.createJob("Maire", {
color = Color(255, 0, 0, 255),
model = {"models/player/breen.mdl"},
description = [[TEST]],
weapons = {},
command = "maire",
max = 1,
salary = 180,
admin = 0,
vote = true,
hasLicense = true,
candemote = false,
mayor = true,
PlayerSpawn = function(ply)
ply:SetHealth(101)
ply:SetArmor(50)
end,
PlayerDeath = function(ply, weapon, killer)
ply:teamBan()
ply:changeTeam(GAMEMODE.DefaultTeam, true)
DarkRP.notifyAll(0, 4, "Le maire est mort")
end,
})

TEAM_COMANDPOL = DarkRP.createJob("[VIP+] Police Nationale | Commissaire", {
color = Color(0, 41, 255, 255),
model = {"models/bloocobalt/science/navy_09.mdl"},
description = [[TEST]],
weapons = {},
command = "comandpol",
max = 1,
salary = 350,
admin = 0,
vote = true,
hasLicense = true,
candemote = false,
chief = true,
PlayerSpawn = function(ply)
ply:SetHealth(120)
ply:SetArmor(100)
end,
PlayerDeath = function(ply, weapon, killer)
ply:teamBan()
ply:changeTeam(GAMEMODE.DefaultTeam, true)
DarkRP.notifyAll(0, 4, "Le Commissaire est mort!")
end,
customCheck = function(ply) return CLIENT or
table.HasValue({"vip+", "superadmin", "admin", "modo", "helpeur"}, ply:GetNWString("usergroup"))
end,
CustomCheckFailMsg = "Job VIP+"
})

TEAM_COOKE = DarkRP.createJob("Cuisinier Italien", {
color = Color(255, 0, 230, 255),
model = {"models/player/mossman.mdl"},
description = [[TEST]],
weapons = {},
command = "cuisinierit",
max = 4,
salary = 95,
admin = 0,
vote = true,
hasLicense = false,
candemote = true,
PlayerSpawn = function(ply)
ply:SetHealth(100)
end
})
 
  • Initiateur de la discussion
Florian Kenway

Florian Kenway

Geek
Messages
69
Score réaction
5
Points
95
Code:
TEAM_CITIZEN = DarkRP.createJob("Citoyen", {
color = Color(20, 150, 20, 255),
model = {
"models/humans/group02/player/tale_01.mdl",
"models/humans/group02/player/tale_03.mdl",
"models/humans/group02/player/tale_04.mdl",
"models/humans/group02/player/tale_05.mdl",
"models/humans/group02/player/tale_06.mdl",
"models/humans/group02/player/tale_07.mdl",
"models/humans/group02/player/tale_09.mdl",
"models/humans/group02/player/temale_01.mdl",
"models/humans/group02/player/temale_02.mdl",
"models/humans/group02/player/temale_07.mdl",
},
description = [[Citoyen]],
weapons = {},
command = "citizen",
max = 0,
salary = 5,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Citizens",
TEAM_MAYOR = DarkRP.createJob("Maire", {
color = Color(255, 0, 0, 255),
model = {"models/player/breen.mdl"},
description = [[TEST]],
weapons = {},
command = "maire",
max = 1,
salary = 180,
admin = 0,
vote = true,
hasLicense = true,
candemote = false,
mayor = true,
PlayerSpawn = function(ply)
ply:SetHealth(101)
ply:SetArmor(50)
end,
PlayerDeath = function(ply, weapon, killer)
ply:teamBan()
ply:changeTeam(GAMEMODE.DefaultTeam, true)
DarkRP.notifyAll(0, 4, "Le maire est mort")
end,
})
TEAM_COMANDPOL = DarkRP.createJob("[VIP+] Police Nationale | Commissaire", {
color = Color(0, 41, 255, 255),
model = {"models/bloocobalt/science/navy_09.mdl"},
description = [[TEST]],
weapons = {},
command = "comandpol",
max = 1,
salary = 350,
admin = 0,
vote = true,
hasLicense = true,
candemote = false,
chief = true,
PlayerSpawn = function(ply)
ply:SetHealth(120)
ply:SetArmor(100)
end,
PlayerDeath = function(ply, weapon, killer)
ply:teamBan()
ply:changeTeam(GAMEMODE.DefaultTeam, true)
DarkRP.notifyAll(0, 4, "Le Commissaire est mort!")
end,
customCheck = function(ply) return CLIENT or
table.HasValue({"vip+", "superadmin", "admin", "modo", "helpeur"}, ply:GetNWString("usergroup"))
end,
CustomCheckFailMsg = "Job VIP+"
})
TEAM_COOKE = DarkRP.createJob("Cuisinier Italien", {
color = Color(255, 0, 230, 255),
model = {"models/player/mossman.mdl"},
description = [[TEST]],
weapons = {},
command = "cuisinierit",
max = 4,
salary = 95,
admin = 0,
vote = true,
hasLicense = false,
candemote = true,
PlayerSpawn = function(ply)
ply:SetHealth(100)
end
})
 
  • Initiateur de la discussion
Florian Kenway

Florian Kenway

Geek
Messages
69
Score réaction
5
Points
95
ERREUR RESOLUE APRES UN T'CHECK SUR GOOGLE ^^
 
Feytone

Feytone

Chuck Norris
Messages
4 741
Score réaction
1 301
Points
600
FalkioGMR à dit:
table.HasValue({"vip+", "superadmin", "admin", "modo", "helpeur"},

Rajoute ce que je te met en rouge:
table.HasValue({"vip+", "superadmin", "admin", "modo", "helpeur"}),
Non surtout pas sinon tu casses la fonction. Cette fonction signifie (que tu vivras ta vie, sans aucun souciiiiis, philosophie, pardon.) que si tu fais parti d'un de ces groupes dans cette table de valeurs alors tu peux accéder à la TEAM. Et la parenthèse dont tu parles est présente à la fin de la demande.

Cette demande c'est : est ce que le joueur (ply) appartient à un de ces groupes (dans la table de valeurs) ?
Voilà bisous.
 
Discord d'entraide
Rejoignz-nous sur Discord