Author Topic: Request assistance with a darkrp command  (Read 1981 times)

0 Members and 1 Guest are viewing this topic.

Offline WE_BRAIN_HURT

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Request assistance with a darkrp command
« on: October 10, 2015, 08:10:43 PM »
[ERROR] Lua is unable to understand file "darkrp_customthings/jobs.lua" because its author made a mistake around line number 761.
The best help I can give you is this:

There is an opening '{' bracket at line 747, but this bracket is never closed or not closed in time. It was expected to be closed before the 'customCheck' at line 761.

Hints:
   - Did you forget a comma?
   - All open brackets ({, (, [) must have a matching closing bracket. Are you sure it's there?
   - Brackets must be opened and closed in the right order. This will work: ({}), but this won't: ({)}.

------- End of Simplerr error -------


For this coding:

TEAM_POLICE = DarkRP.createJob("Spider-Man Black Suited", {
color = Color(255, 0, 0, 255),
VIPOnly = true,
model = {"models/player/raimispiderblack.mdl"},
description = [[Do not be afk in this job!]],
weapons = {"keys", "pocket", "spiderman's_swep", "weapon_lightsaber", "arrest_stick", "weapon_cuff_standard", "weapon_arc_atmcard"},
command = "spiderman3",
max = 1,
salary = 400,
admin = 0,
vote = false,
hasLicense = true,
candemote = false,
category = "Civil Protection"
customCheck = function(ply) return ply:GetNWString("usergroup") == "vip" or ply:IsAdmin() end, -- The extra check function. Enter nil or nothing to not have a restriction
})

-Please Help
« Last Edit: October 10, 2015, 08:26:40 PM by JamminR »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Request assistance with a darkrp command
« Reply #1 on: October 10, 2015, 08:32:41 PM »
First, I changed your topic title.
Most people "need help"
We know that. That's why many are here.
In the future, Make a better topic title that describes in a few words what the issue is you need help with.

The person who gave you those answers gave you all you'd need to know.
We can't help unless we were to see the entire file.
Line 761?
You've only shown us a few lines.
Get a good text editor that will highlight lua (and other) programming syntax. I personally use notepad++, which even highlights the beginning and ending brackets and shows me if I have them in a wrong order.

EDIT - my guess is you forgot a comma, you figure out where.
You've not given enough information for us to know 100% that is the issue though.
« Last Edit: October 10, 2015, 08:39:32 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

An Error Has Occurred!

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