Bug lua inconnu

  • Initiateur de la discussion Salothard
  • Date de début
  • Initiateur de la discussion
S

Salothard

Geek
Messages
5
Score réaction
0
Points
65
Bonjour et tout d'abord merci de me lire, je me suis lancé dans la création d'un serveur darkRP prison, je me suis tranquillement mit à coder les métiers, mais la, je tombe sans cesse sur une erreur lua qui est :
Lua Error:
[DarkRP] gamemodes/darkrp/gamemode/config/jobrelated.lua:58: '}' expected (to close '{' at line 43) near ')'
1. unknown - gamemodes/darkrp/gamemode/config/jobrelated.lua:0
[[CoFon_AlcatrazRP]Empereur Jame|2|STEAM_0:0:74835613] Lua Error:
[ERROR] addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:20: unexpected symbol near '{'
1. unknown - addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:0


Mais, je n’arrête pas de vérifier, je ne vois pas d'erreur dans le fichier concerné :

-- People often copy jobs. When they do, the GM table does not exist anymore.
-- This line makes the job code work both inside and outside of gamemode files.
-- You should not copy this line into your code.
local GAMEMODE = GAMEMODE or GM

TEAM_CITIZEN = DarkRP.createJob("Prisonnier", {
color = Color(255, 140, 0, 255),
model = {
"models/player/Group01/Male_07.mdl",
"models/player/Group01/Male_08.mdl",
"models/player/Group01/Male_09.mdl"},
description = [[Le Prisonnier, c'est un peu le clochard, c'est la sous-merde de la prison]],
weapons = {},
command = "citizen",
max = 0,
salary = GAMEMODE.Config.normalsalary,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Prisonniers",
})

TEAM_POLICE = DarkRP.createJob("Garde Des Cellules", {
color = Color(25, 25, 170, 255),
model = {"models/player/barney.mdl"},
description = [[Vous devez garder ces pleutres dans cette prison !]],
weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "stunstick", "door_ram", "weaponchecker"},
command = "cp",
max = 7,
salary = GAMEMODE.Config.normalsalary * 1.45,
admin = 0,
vote = true,
hasLicense = true,
ammo = {
["pistol"] = 600,
},
category = "Gardes",
})
 
  • Initiateur de la discussion
S

Salothard

Geek
Messages
5
Score réaction
0
Points
65
TEAM_GANG = DarkRP.createJob("Chef des gardes", {
color = Color(25, 25, 170, 255),
model = {
"models/player/combine_super_soldier.mdl"},
description = [[LE PUTAIN DE CHEF]],
weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "stunstick", "door_ram", "weaponchecker"},
command = "gangster",
max = 1,
salary = GAMEMODE.Config.normalsalary,
admin = 0,
vote = true ,
hasLicense = true,
ammo = {
["pistol"] = 600,
category = "Gardes",
})

TEAM_MOB = DarkRP.createJob("Garde de la porte", {
color = Color(25, 25, 170, 255),
model = "models/player/combine_soldier_prisonguard.mdl",
description = [[C'est le garde de la porte]],
weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "stunstick", "door_ram", "weaponchecker"},
command = "mobboss",
max = 3,
salary = GAMEMODE.Config.normalsalary * 1.34,
admin = 0,
vote = true ,
hasLicense = true,
ammo = {
["pistol"] = 600,
category = "Gardes",
})

TEAM_GUN = DarkRP.createJob("Vendeur d'armes", {
color = Color(255, 140, 0, 255),
model = "models/player/odessa.mdl",
description = [[Le vendeur d'armes]],
weapons = {},
command = "gundealer",
max = 2,
salary = GAMEMODE.Config.normalsalary,
admin = 0,
vote = false,
hasLicense = false,
category = "Prisonniers",
})

TEAM_MEDIC = DarkRP.createJob("Medecin", {
color = Color(47, 79, 79, 255),
model = "models/player/kleiner.mdl",
description = [[With your medical knowledge you work to restore players to full health.
Without a medic, people cannot be healed.
Left click with the Medical Kit to heal other players.
Right click with the Medical Kit to heal yourself.]],
weapons = {"med_kit"},
command = "medic",
max = 3,
salary = GAMEMODE.Config.normalsalary,
admin = 0,
vote = false,
hasLicense = false,
medic = true,
category = "Autres",
})

TEAM_CHIEF = DarkRP.createJob("Civil Protection Chief", {
color = Color(20, 20, 255, 255),
model = "models/player/combine_soldier_prisonguard.mdl",
description = [[The Chief is the leader of the Civil Protection unit.
Coordinate the police force to enforce law in the city.
Hit a player with arrest baton to put them in jail.
Bash a player with a stunstick and they may learn to obey the law.
The Battering Ram can break down the door of a criminal, with a warrant for his/her arrest.
Type /wanted <name> to alert the public to the presence of a criminal.
Type /jailpos to set the Jail Position]],
weapons = {"arrest_stick", "unarrest_stick", "weapon_deagle2", "stunstick", "door_ram", "weaponchecker"},
command = "chief",
max = 1,
salary = GAMEMODE.Config.normalsalary * 1.67,
admin = 0,
vote = false,
hasLicense = true,
chief = true,
NeedToChangeFrom = TEAM_POLICE,
ammo = {
["pistol"] = 60,
},
category = "Gardes",
})

TEAM_MAYOR = DarkRP.createJob("Mayor", {
color = Color(150, 20, 20, 255),
model = "models/player/breen.mdl",
description = [[The Mayor of the city creates laws to govern the city.
If you are the mayor you may create and accept warrants.
Type /wanted <name> to warrant a player.
Type /jailpos to set the Jail Position.
Type /lockdown initiate a lockdown of the city.
Everyone must be inside during a lockdown.
The cops patrol the area.
/unlockdown to end a lockdown]],
weapons = {},
command = "mayor",
max = 1,
salary = GAMEMODE.Config.normalsalary * 1.89,
admin = 0,
vote = true,
hasLicense = false,
mayor = true,
category = "Gardes",
})

TEAM_HOBO = DarkRP.createJob("Hobo", {
color = Color(80, 45, 0, 255),
model = "models/player/corpse1.mdl",
description = [[The lowest member of society. Everybody laughs at you.
You have no home.
Beg for your food and money
Sing for everyone who passes to get money
Make your own wooden home somewhere in a corner or outside someone else's door]],
weapons = {"weapon_bugbait"},
command = "hobo",
max = 5,
salary = 0,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
hobo = true,
category = "Autres",
})
TEAM_COOK = DarkRP.createJob("Cook", {
color = Color(238, 99, 99, 255),
model = "models/player/mossman.mdl",
description = [[As a cook, it is your responsibility to feed the other members of your city.
You can spawn a microwave and sell the food you make:
/buymicrowave]],
weapons = {},
command = "cook",
max = 2,
salary = 45,
admin = 0,
vote = false,
hasLicense = false,
cook = true
category = Autres
})
end

-- Compatibility for when default teams are disabled
TEAM_CITIZEN = TEAM_CITIZEN or -1
TEAM_POLICE = TEAM_POLICE or -1
TEAM_GANG = TEAM_GANG or -1
TEAM_MOB = TEAM_MOB or -1
TEAM_GUN = TEAM_GUN or -1
TEAM_MEDIC = TEAM_MEDIC or -1
TEAM_CHIEF = TEAM_CHIEF or -1
TEAM_MAYOR = TEAM_MAYOR or -1
TEAM_HOBO = TEAM_HOBO or -1



AddDoorGroup("Cops and Mayor only", TEAM_CHIEF, TEAM_POLICE, TEAM_MAYOR)
AddDoorGroup("Gundealer only", TEAM_GUN)



DarkRP.createAgenda("Gangster's agenda", TEAM_MOB, {TEAM_GANG})
DarkRP.createAgenda("Police agenda", {TEAM_MAYOR, TEAM_CHIEF}, {TEAM_POLICE})



DarkRP.createGroupChat(function(ply) return ply:isCP() end)
DarkRP.createGroupChat(TEAM_MOB, TEAM_GANG)
DarkRP.createGroupChat(function(listener, ply) return not ply or ply:Team() == listener:Team() end)


GAMEMODE.DefaultTeam = TEAM_CITIZEN


GAMEMODE.CivilProtection = {
[TEAM_POLICE] = true,
[TEAM_CHIEF] = true,
[TEAM_MAYOR] = true,
}


DarkRP.addHitmanTeam(TEAM_MOB)


DarkRP.createDemoteGroup("Cops", {TEAM_POLICE, TEAM_CHIEF})
DarkRP.createDemoteGroup("Gangsters", {TEAM_GANG, TEAM_MOB})


})})DarkRP.createCategory{
name = "Prisonniers",
categorises = "jobs",
startExpanded = true,
color = Color(0, 107, 0, 255),
canSee = fp{fn.Id, true},
sortOrder = 100,
}

DarkRP.createCategory{
name = "Gardes",
categorises = "jobs",
startExpanded = true,
color = Color(25, 25, 170, 255),
canSee = fp{fn.Id, true},
sortOrder = 101,
}

DarkRP.createCategory{
name = "Autres",
categorises = "jobs",
startExpanded = true,
color = Color(0, 107, 0, 255),
canSee = fp{fn.Id, true},
sortOrder = 255,
}
Si quelqu'un à le courage de m'aider, j'attendrai avec impatience !
 
NumberZeroUnknown

NumberZeroUnknown

Geek
Messages
14
Score réaction
3
Points
80
Bonjour ! Je viens de passer par le même problème, et j'ai réalissé que c'etait un truc tout con qui provoquait cette erreur : on avait juste oublié un caractère ! Donc voici la partie du code corrigée avec le caractère qui manquait en rouge et gras ;)

TEAM_GANG = DarkRP.createJob("Chef des gardes", {
color = Color(25, 25, 170, 255),
model = {
"models/player/combine_super_soldier.mdl"},
description = [[LE PUTAIN DE CHEF]],
weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "stunstick", "door_ram", "weaponchecker"},
command = "gangster",
max = 1,
salary = GAMEMODE.Config.normalsalary,
admin = 0,
vote = true ,
hasLicense = true,
ammo = {
["pistol"] = 600
},
category = "Gardes"
})
 
Discord d'entraide
Rejoignz-nous sur Discord