• Why isn't this code working?
    8 replies, posted
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, PlayerDeath = function(ply) if ply:Team() == TEAM_MAYOR then ply:changeTeam( TEAM_CITIZEN, true ) for k,v in pairs( player.GetAll() ) do DarkRP.notify(v, 1, 4, "The mayor has been killed!") end end end, }) TEAM_SECURITY = AddExtraTeam("Security", { color = Color(190, 223, 0, 255), model = "models/player/swat.mdl", description = [[You're responsible for the safety of a citizen who pays you money for protecting him.]], weapons = {"m9k_m92beretta"}, command = "security", max = 5, salary = 40, admin = 0, vote = false, hasLicense = true, }) TEAM_THIEF = AddExtraTeam("Thief", { color = Color(0, 102, 102, 102), model = "models/player/phoenix.mdl", description = [[Break into places. Must be 2 or more theives to raid.]], weapons = {"lockpick"}, command = "thief", max = 6, salary = 50, admin = 0, vote = false, hasLicense = false, }) TEAM_HOBOK = AddExtraTeam("Hobo King", { color = Color( 192, 192, 192, 0)), model ="models/player/corpse1.mdl", description = [[You rule all hobos.]], weapons = {"weapon_bugbait"}, command = "hoboking", max= 1, salary = 0, admin = 0, vote = false, hasLicense = false, }) TEAM_HITM = AddExtraTeam("Hitman", { color = Color( 255, 0, 0, 0), model =" models/player/Phoenix.mdl", description = [[You are hired to kill. Use to !hitmenu for hits.]], weapons = {"m9k_barret_m82"}, command = "hitman", max= 2, salary = 50, admin = 0, vote = true, hasLicense = false, }) TEAM_TERT = AddExtraTeam("Terrorist", { color = Color( 0, 255, 0, 0), model ="models/player/guerilla.mdl", description = [[The police are your enemy. Don't RDM]], weapons = {"weapon_jihadbomb"}, command = "terrorist", max= 4, salary = 45, admin = 0, vote = false, hasLicense = false, }) TEAM_ADMIN = AddExtraTeam("Administration", { color = Color(0, 150, 255, 255), model = "models/player/skeleton.mdl", description = [[Do Admin Stuff]], weapons = {""}, command = "admin", max = 7, salary = 0, admin = 1, vote = false, hasLicense = true, }) When I start up the server it says something about expect to close at line 72 [editline]19th March 2014[/editline] This is a script code for Dark RP jobs by the way. [highlight](User was banned for this post ("wrong section" - postal))[/highlight]
[code]TEAM_HOBOK = AddExtraTeam("Hobo King", { color = Color( 192, 192, 192, 0)), model ="models/player/corpse1.mdl", description = [[You rule all hobos.]], weapons = {"weapon_bugbait"}, command = "hoboking", max= 1, salary = 0, admin = 0, vote = false, hasLicense = false, }) [/code] Remove the third ")" at color = Color(192, 192, 192 0))
TEAM_HOBOK = AddExtraTeam("Hobo King", { color = Color( 192, 192, 192)), model ="models/player/corpse1.mdl", description = [[You rule all hobos.]], weapons = {"weapon_bugbait"}, command = "hoboking", max= 1, salary = 0, admin = 0, vote = false, hasLicense = false, }) I changed it to that and I'm still getting [ERROR] addons/darkrpmodification-master/lua/darkrp_customthings/jobs.lua:73: un expected symbol near ')' 1. unknown - addons/darkrpmodification-master/lua/darkrp_customthings/jobs.lua :0 [ERROR] addons/darkrpmodification-master/lua/darkrp_customthings/jobs.lua:73: un expected symbol near ')' 1. unknown - addons/darkrpmodification-master/lua/darkrp_customthings/jobs.lua :0
[code]TEAM_HITM = AddExtraTeam("Hitman", { color = Color( 255, 0, 0, 0), model =" models/player/Phoenix.mdl", description = [[You are hired to kill. Use to !hitmenu for hits.]], weapons = {"m9k_barret_m82"}, command = "hitman", max= 2, salary = 50, admin = 0, vote = true, hasLicense = false, }) [/code] Line 73 is the line about the model. The only thing which can be seen as incorrect is " models/player/Phoenix.mdl" which should be "models/player/Phoenix.mdl" but I really don't think that would cause anything. I'm an amateur at best, so bare with me for not really knowing much.
Ok thanks for the help [editline]19th March 2014[/editline] I'm just saying I still haven't solved this
If you look closely at this: [CODE]TEAM_HITM = AddExtraTeam("Hitman", { color = Color( 255, 0, 0, 0), model ="models/player/Phoenix.mdl", description = [[You are hired to kill. Use to !hitmenu for hits.]], weapons = {"m9k_barret_m82"}, command = "hitman", max= 2, salary = 50, admin = 0, vote = true, hasLicense = false, })[/CODE] You have an extra space here [CODE]color = Color( 255, 0, 0, 0),[/CODE] Delete the space before 255
Lua - the ultimate grammar nazi
[CODE]TEAM_HITM = AddExtraTeam("Hitman", { color = Color( 255, 0, 0, 0), model ="models/player/Phoenix.mdl", description = [[You are hired to kill. Use to !hitmenu for hits.]], weapons = {"m9k_barret_m82"}, command = "hitman", max= 2, salary = 50, admin = 0, vote = true, hasLicense = false --don't put a comma on the last value in a table })[/CODE]
Thank you PortalGod for looking better than I did I went ahead and fixed some things that I found (Commas and extra spaces mainly) [CODE]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, PlayerDeath = function(ply) if ply:Team() == TEAM_MAYOR then ply:changeTeam( TEAM_CITIZEN, true ) for k,v in pairs( player.GetAll() ) do DarkRP.notify(v, 1, 4, "The mayor has been killed!") end end end }) TEAM_SECURITY = AddExtraTeam("Security", { color = Color(190, 223, 0, 255), model = "models/player/swat.mdl", description = [[You're responsible for the safety of a citizen who pays you money for protecting him.]], weapons = {"m9k_m92beretta"}, command = "security", max = 5, salary = 40, admin = 0, vote = false, hasLicense = true }) TEAM_THIEF = AddExtraTeam("Thief", { color = Color(0, 102, 102, 102), model = "models/player/phoenix.mdl", description = [[Break into places. Must be 2 or more theives to raid.]], weapons = {"lockpick"}, command = "thief", max = 6, salary = 50, admin = 0, vote = false, hasLicense = false }) TEAM_HOBOK = AddExtraTeam("Hobo King", { color = Color(192, 192, 192, 0), model ="models/player/corpse1.mdl", description = [[You rule all hobos.]], weapons = {"weapon_bugbait"}, command = "hoboking", max= 1, salary = 0, admin = 0, vote = false, hasLicense = false }) TEAM_HITM = AddExtraTeam("Hitman", { color = Color (255, 0, 0, 0), model = "models/player/Phoenix.mdl", description = [[You are hired to kill. Use to !hitmenu for hits.]], weapons = {"m9k_barret_m82"}, command = "hitman", max= 2, salary = 50, admin = 0, vote = true, hasLicense = false }) TEAM_TERT = AddExtraTeam("Terrorist", { color = Color(0, 255, 0, 0), model ="models/player/guerilla.mdl", description = [[The police are your enemy. Don't RDM]], weapons = {"weapon_jihadbomb"}, command = "terrorist", max= 4, salary = 45, admin = 0, vote = false, hasLicense = false }) TEAM_ADMIN = AddExtraTeam("Administration", { color = Color(0, 150, 255, 255), model = "models/player/skeleton.mdl", description = [[Do Admin Stuff]], weapons = {""}, command = "admin", max = 7, salary = 0, admin = 1, vote = false, hasLicense = true }) [/CODE]
Sorry, you need to Log In to post a reply to this thread.