Author Topic: Cant get VERY SIMPLE code too work.  (Read 1955 times)

0 Members and 1 Guest are viewing this topic.

Offline Coltonjman

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Cant get VERY SIMPLE code too work.
« on: July 11, 2016, 10:37:18 AM »
Im basicly brand new at Lua coding but im not a idiot i think. For the life of me i cant get this Garrys mod custom job too work.

the code i used at first.
TEAM_DANK = DarkRP.createJob("Pika Pika", {
   color = Color(211, 17, 17, 255),
   model = {"models/pokemon/pikachu.mdl"},
   description = [[DANK]],
   weapons = {"m9k_glock"},
   command = "Dank",
   max = 2,
   salary = 250,
   admin = 1,
   vote = true,
   hasLicense = true,
   candemote = true,
   -- CustomCheck
   medic = false,
   chief = false,
   mayor = false,
   hobo = false,
   cook = false,
   category = "Citizens",
})

I could not get that too work at all so then i used the darkRP code its self too see if it even works and nothing.
TEAM_CITIZEN = DarkRP.createJob("Citizen", {
    color = Color(20, 150, 20, 255),
    model = {
        "models/player/Group01/Female_01.mdl",
        "models/player/Group01/Female_02.mdl",
        "models/player/Group01/Female_03.mdl",
        "models/player/Group01/Female_04.mdl",
        "models/player/Group01/Female_06.mdl",
        "models/player/group01/male_01.mdl",
        "models/player/Group01/Male_02.mdl",
        "models/player/Group01/male_03.mdl",
        "models/player/Group01/Male_04.mdl",
        "models/player/Group01/Male_05.mdl",
        "models/player/Group01/Male_06.mdl",
        "models/player/Group01/Male_07.mdl",
        "models/player/Group01/Male_08.mdl",
        "models/player/Group01/Male_09.mdl"
    },
    description = [[The Citizen is the most basic level of society you can hold besides being a hobo. You have no specific role in city life.]],
    weapons = {},
    command = "citizen",
    max = 0,
    salary = GAMEMODE.Config.normalsalary,
    admin = 0,
    vote = false,
    hasLicense = false,
    candemote = false,
    category = "Citizens",
})

Heres the error code and under it will be the jobs file its self Thanks for any help at all,

[ERROR] addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:20: ')' expected near 'models'
  1. unknown - addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:0

--[[---------------------------------------------------------------------------
DarkRP custom jobs
---------------------------------------------------------------------------

This file contains your custom jobs.
This file should also contain jobs from DarkRP that you edited.

Note: If you want to edit a default DarkRP job, first disable it in darkrp_config/disabled_defaults.lua
   Once you've done that, copy and paste the job to this file and edit it.

The default jobs can be found here:
https://github.com/FPtje/DarkRP/blob/master/gamemode/config/jobrelated.lua

For examples and explanation please visit this wiki page:
http://wiki.darkrp.com/index.php/DarkRP:CustomJobFields


Add jobs under the following line:
---------------------------------------------------------------------------]]
TEAM_CITIZEN = DarkRP.createJob("Citizen", {
    color = Color(20, 150, 20, 255),
    model = {
        "models/player/Group01/Female_01.mdl",
        "models/player/Group01/Female_02.mdl",
        "models/player/Group01/Female_03.mdl",
        "models/player/Group01/Female_04.mdl",
        "models/player/Group01/Female_06.mdl",
        "models/player/group01/male_01.mdl",
        "models/player/Group01/Male_02.mdl",
        "models/player/Group01/male_03.mdl",
        "models/player/Group01/Male_04.mdl",
        "models/player/Group01/Male_05.mdl",
        "models/player/Group01/Male_06.mdl",
        "models/player/Group01/Male_07.mdl",
        "models/player/Group01/Male_08.mdl",
        "models/player/Group01/Male_09.mdl"
    },
    description = [[The Citizen is the most basic level of society you can hold besides being a hobo. You have no specific role in city life.]],
    weapons = {},
    command = "citizen",
    max = 0,
    salary = GAMEMODE.Config.normalsalary,
    admin = 0,
    vote = false,
    hasLicense = false,
    candemote = false,
    category = "Citizens",










--[[---------------------------------------------------------------------------
Define which team joining players spawn into and what team you change to if demoted
---------------------------------------------------------------------------]]
GAMEMODE.DefaultTeam = TEAM_CITIZEN


--[[---------------------------------------------------------------------------
Define which teams belong to civil protection
Civil protection can set warrants, make people wanted and do some other police related things
---------------------------------------------------------------------------]]
GAMEMODE.CivilProtection = {
   [TEAM_POLICE] = true,
   [TEAM_CHIEF] = true,
   [TEAM_MAYOR] = true,
}

--[[---------------------------------------------------------------------------
Jobs that are hitmen (enables the hitman menu)
---------------------------------------------------------------------------]]
DarkRP.addHitmanTeam(TEAM_MOB)



Offline Michael Brady

  • Newbie
  • *
  • Posts: 12
  • Karma: -3
Re: Cant get VERY SIMPLE code too work.
« Reply #1 on: July 11, 2016, 10:54:22 AM »
now because you didn't put that in the code format (I dont know how to do this either so it can be forgiven) its harder to tel where the error is but its on line 20
heres a working job that should help you

EAM_MOB = DarkRP.createJob("Mob boss", {
   color = Color(25, 25, 25, 255),
   model = "models/player/gman_high.mdl",
   description = [[Command your gang or ride alone.]],
   weapons = {"lockpick", "unarrest_stick", "m9k_coltpython", "weapon_arc_atmcard"},
   command = "mobboss",
   max = 1,
   salary = 50,
   admin = 0,
   vote = false,
   hasLicense = false,
   category = "Criminals",
})



An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given