• Custom Police jobs, I cant get them to use commands [help]
    6 replies, posted
I know this is dumb post but i need help with this i made a custom police officer job and i want it to do /wanted or /warrant, i searched up the problem i was having people are saying add to the Gamemod.CivilProtection it still doesn't work GAMEMODE.CivilProtection= { [TEAM_POLICE] = true, [TEAM_CHIEF] = true, [TEAM_MAYOR] = true, } I dont know, how its suppose to be done i have a category for the police i am not sure if that messing it up DarkRP.createCategory{ name = "Government", The job i have is: TEAM_PoliceOfficer = DarkRP.createJob("Police Officer", { color = Color(77, 192, 255, 255), model = { "models/taggart/police01/male_01.mdl", "models/taggart/police01/male_02.mdl", "models/taggart/police01/male_03.mdl", "models/taggart/police01/male_04.mdl", "models/taggart/police01/male_05.mdl", "models/taggart/police01/male_06.mdl", "models/taggart/police01/male_07.mdl", "models/taggart/police01/male_08.mdl", "models/taggart/police01/male_09.mdl" }, description = [[Protect the city]], weapons = {"unarrest_stick", "stunstick", "weaponchecker", "darkrp_handcuffs", "door_ram", "m9k_remington870", "m9k_usp", "arrest_stick"}, command = "PoliceOfficer", max = 6, salary = 120, admin = 0, vote = true, hasLicense = true, candemote = true, category = "Government", PlayerLoadout = function(ply) -- this line is added. Remember a comma at the end of above line if it is not there. ply:SetHealth(100) ply:SetArmor(100) ply:SetWalkSpeed(250) ply:SetRunSpeed(300) end, }) If i add it to the gamemode it will say its nil, It also says that i am not eh right job to. In disabledDefaults.lua i also put ["cp"] = true, [highlight](User was banned for this post ("Stick to one thread, don't make duplicate threads" - Shendow))[/highlight]
GAMEMODE.CivilProtection= { [TEAM_POLICE] = true, [TEAM_CHIEF] = true, [TEAM_MAYOR] = true, } Requires the job name. So it'd look like this GAMEMODE.CivilProtection= { [TEAM_POLICE] = true, [TEAM_CHIEF] = true, [TEAM_MAYOR] = true, [TEAM_PoliceOfficer] = true, }
[QUOTE=blackwidowman;52809227]GAMEMODE.CivilProtection= { [TEAM_POLICE] = true, [TEAM_CHIEF] = true, [TEAM_MAYOR] = true, } Requires the job name. So it'd look like this GAMEMODE.CivilProtection= { [TEAM_POLICE] = true, [TEAM_CHIEF] = true, [TEAM_MAYOR] = true, [TEAM_PoliceOfficer] = true, }[/QUOTE] It doesnt work GAMEMODE.CivilProtection= { [TEAM_POLICE] = true, [TEAM_CHIEF] = true, [TEAM_MAYOR] = true, [TEAM_PoliceOfficer] = true, } I put that and i get this [ERROR] A runtime error has occurred in "addons/darkrpmodification/lua/darkrp_customthings/jobs.lua" on line 33. The best help I can give you is this: A table is being indexed by something that does not exist (table index is nil). Hints: - The thing between square brackets does not exist (is nil). The responsibility for the error above lies with (the authors of) one (or more) of these files: 1. addons/darkrpmodification/lua/darkrp_customthings/jobs.lua on line 33 2. gamemodes/darkrp/gamemode/libraries/fn.lua on line 84 3. gamemodes/darkrp/gamemode/libraries/fn.lua on line 84 4. gamemodes/darkrp/gamemode/libraries/modificationloader.lua on line 137 5. gamemodes/darkrp/gamemode/libraries/modificationloader.lua on line 148 6. gamemodes/darkrp/gamemode/init.lua on line 111 ------- End of Simplerr error ------- 1. error - [C]:-1 2. doInclude - gamemodes/darkrp/gamemode/libraries/simplerr.lua:530 3. loadCustomDarkRPItems - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:137 4. Couldn't Load Init Script: 'darkrp/gamemode/init.lua' Like i said i make a Category called government that has this job in it. Do i have to get rid of it?
You already have one thread about this exact same thing?:why:
[QUOTE=wepnet;52809453]You already have one thread about this exact same thing?:why:[/QUOTE] Well that wasn't very helpful.
The team needs to be declared before the table, just like I said in the last thread.
[QUOTE=code_gs;52809484]The team needs to be declared before the table, just like I said in the last thread.[/QUOTE] Can you show me an example?
Sorry, you need to Log In to post a reply to this thread.