Need help with this simple darkrp code please !!! Thanks
2 replies, posted
[CODE]TEAM_BLOODL = DarkRP.createJob("Bloodz Leader", {
color = Color(255, 3, 3, 255),
model = {models/bloodz/slow_1.mdl},
description = [[The Bloodz Leader is the boss of the criminals in the city.
With his power he coordinates the gangsters and forms an efficient crime organization.
He has the ability to break into houses by using a lockpick.
The Mob boss posesses the ability to unarrest you]],
weapons = {"lockpick", "unarrest_stick", "weapon_fists", "robbery", "fas2_ak47", "basebat"},
command = "bloodzl",
max = 1,
salary = 250,
admin = 0,
vote = true,
hasLicense = false,
candemote = true,
customCheck = function(ply) return CLIENT or
table.HasValue({"superadmin", "owner", "gold", "silver", "bronze"}, ply:GetUserGroup())
end,
CustomCheckFailMsg = "You don't have vip! Buy vip in F4 menu!",
})[/CODE]
Server was working fine until I added this job and I cant find the reason why its faulty, please help me!
[CODE][ERROR] Lua is unable to understand file "darkrp_customthings/jobs.lua" because
its author made a mistake around line number 527.
The best help I can give you is this:
There is an opening '{' bracket at line 524, but this bracket is never closed or
not closed in time. It was expected to be closed before the 'description' at li
ne 527.
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 -------
1. error - [C]:-1
2. unknown - gamemodes/methrp/gamemode/libraries/simplerr.lua:467
3. doInclude - gamemodes/methrp/gamemode/libraries/fn.lua:80
4. loadCustomDarkRPItems - gamemodes/methrp/gamemode/libraries/modification
loader.lua:131
5. Call - gamemodes/methrp/gamemode/libraries/modificationloader.lua:142
6. unknown - gamemodes/methrp/gamemode/init.lua:81
Couldn't Load Init Script: 'methrp/gamemode/init.lua'[/CODE]
Could you try replacing
[lua] model = {models/bloodz/slow_1.mdl},[/lua]
with
[lua] model = {"models/bloodz/slow_1.mdl"},[/lua]
for me, and see if it works then please?
Not sure if it will work, since I'm not in a position to access my server to test it at the moment.
jonjon is right, the model needs to be a string. Also, I would replace that table.HasValue check with a file-wide table with allowed ranks.
Sorry, you need to Log In to post a reply to this thread.