{"action":"opened","issue":{"url":"https://api.github.com/repos/FPtje/DarkRP/issues/2353","repository_url":"https://api.github.com/repos/FPtje/DarkRP","labels_url":"https://api.github.com/repos/FPtje/DarkRP/issues/2353/labels{/name}","comments_url":"https://api.github.com/repos/FPtje/DarkRP/issues/2353/comments","events_url":"https://api.github.com/repos/FPtje/DarkRP/issues/2353/events","html_url":"https://github.com/FPtje/DarkRP/issues/2353","id":137699336,"number":2353,"title":"Enable to re-use a command of a removed job for a new job","user":{"login":"EstevanTH","id":5159778,"avatar_url":"https://avatars.githubusercontent.com/u/5159778?v=3","gravatar_id":"","url":"https://api.github.com/users/EstevanTH","html_url":"https://github.com/EstevanTH","followers_url":"https://api.github.com/users/EstevanTH/followers","following_url":"https://api.github.com/users/EstevanTH/following{/other_user}","gists_url":"https://api.github.com/users/EstevanTH/gists{/gist_id}","starred_url":"https://api.github.com/users/EstevanTH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EstevanTH/subscriptions","organizations_url":"https://api.github.com/users/EstevanTH/orgs","repos_url":"https://api.github.com/users/EstevanTH/repos","events_url":"https://api.github.com/users/EstevanTH/events{/privacy}","received_events_url":"https://api.github.com/users/EstevanTH/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-01T22:01:23Z","updated_at":"2016-03-01T22:01:23Z","closed_at":null,"body":"### Description of the bug\r\nHallo Falco en everybody!\r\nI'm making an addon that modifies the job list instantly. It only affects jobs created with it.\r\nI use\r\n```lua\r\n_G[TeamID] = DarkRP.createJob( blablah )\r\n```\r\nand\r\n```lua\r\nlocal function RemoveDarkRPTeam( TeamID )\r\n\tif _G[TeamID] then\r\n\t\tDarkRP.removeJob( _G[TeamID] )\r\n\t\t_G[TeamID] = nil\r\n\tend\r\nend\r\n```\r\nThe server throws an error when I re-create a job that has been previously removed, because the job command already exists while the matching job has been removed.\r\n\r\n### How to make the bug happen\r\n[//]: # (Knowing how to make a bug happen allows the developers to figure out)\r\n[//]: # (what the cause of the problem is and whether a certain fix solves it)\r\nExecute this code to add a custom team:\r\n```lua\r\nlocal TeamID = \"TEAM_DEBUGGER\"\r\nlocal command = \"debugger\"\r\nRemoveDarkRPTeam( TeamID )\r\n_G[TeamID] = DarkRP.createJob( \"Debugger\", {\r\n\tcolor = Color( 128,128,128 ),\r\n\tmodel = {\r\n\t\t\"models/player/Group03/Female_01.mdl\",\r\n\t\t\"models/player/Group03/Female_02.mdl\"\r\n\t\t},\r\n\tdescription = \"\",\r\n\tweapons = {},\r\n\tcommand = command,\r\n\tmax = 0,\r\n\tsalary = GAMEMODE.Config.normalsalary,\r\n\tadmin = 0,\r\n\tvote = false,\r\n\thasLicense = true,\r\n\tammo = {},\r\n\tsortOrder = nil,\r\n})\r\n```\r\nThen remove it:\r\n```lua\r\nRemoveDarkRPTeam( \"TEAM_DEBUGGER\" )\r\n```\r\nThen re-add the same job with the same code as previously. You will get an error.\r\n\r\n\r\n### Lua errors\r\n```\r\n[ERROR] A runtime error has occurred in \"addons/job_live_creator/lua/autorun/job_live_creator.lua\" on line 148.\r\nThe best help I can give you is this:\r\n\r\nCorrupt team: Debugger!\r\nThis job does not have a unique command.\r\n\r\nHints:\r\n        - There must be some other job that has the same command.\r\n        - Fix this by changing the 'command' of your job to something else.\r\n\r\nThe responsibility for this error lies with (the authors of) one (or more) of these files:\r\n        1. addons/job_live_creator/lua/autorun/job_live_creator.lua on line 148\r\n        2. lua_run on line 1\r\n------- End of Simplerr error -------\r\n\r\n  1. error - [C]:-1\r\n   2. error - gamemodes/darkrp/gamemode/libraries/simplerr.lua:467\r\n    3. createJob - gamemodes/darkrp/gamemode/modules/base/sh_createitems.lua:471\r\n     4. AddTeam - addons/job_live_creator/lua/autorun/job_live_creator.lua:148\r\n      5. unknown - lua_run:1\r\n```\r\n\r\n### Why the developer of DarkRP is responsible for this issue\r\nI guess that the job chat command should be removed when the related job is removed, what do you think?\r\nThat would be great to finish my custom-made addon without using a workaround using unique chat commands.\r\n\r\nThanks!\r\nLove, Momo :heart:"}}