• What is wrong with this Mayor code?
    3 replies, posted
attempt to call field 'createJob' (a nil value) [QUOTE]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 serve the greater good of the people. 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, weapon, killer) ply:teamBan() ply:changeTeam(GAMEMODE.DefaultTeam, true) if killer:IsPlayer() then DarkRP.notifyAll(0, 4, "The mayor has been killed and is therefor demoted.") else DarkRP.notifyAll(0, 4, "The mayor has died and is therefor demoted.") end end }) }}[/QUOTE]
Put the code in [lua][/lua] tags.
Facepalm. PLEASE DO NOT REPOST TWICE -,-. No one will help if you repost twice.
This code was made by Codingbeast [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, })[/CODE]
Sorry, you need to Log In to post a reply to this thread.