• Darkrp VIP jobs problem
    5 replies, posted
I made a job on darkrp and wanted to make it VIP only, but it doesn't work for some reason. [LUA] TEAM_LHOBO = AddExtraTeam("Lord of Das Hobos", { color = Color(80, 45, 0, 255), model = "models/player/charple01.mdl", description = [[You are the lord of the hobos and you lead them to whatever you see fit.]], weapons = {"weapon_bugbait"}, command = "lordhobo", max = 1, salary = 0, admin = 0, vote = false, hasLicense = false customCheck = function(ply) return ply:GetUserGroup() == "VIP" end }) [/LUA] That is my VIP job. Cheerios|2|STEAM_0:0:42168597 [ERROR] gamemodes/darkrp/gamemode/shared.lua:291: '}' expected (to close '{' at line 279) near 'customCheck' 1. unknown - gamemodes/darkrp/gamemode/shared.lua:0 This is the error in the console. Anyone have any idea what is wrong?
You need a comma at the end of line 12.
-snip-
[QUOTE=TheDeadlyHaze;39525246]I'm not even that good at Lua, but I know how to read. It says " '}' expected (to close '{' at line 279)". I think it's saying you're missing the "}" at line 279. -.-[/QUOTE] It means you don't have a comma.
[QUOTE=Garrison;39525252]It means you don't have a comma.[/QUOTE] Oh, well thanks for informing me, like I said "New to Lua", but it's not stopping me from trying to help ^-^
This is the old syntax but just edit to your liking :) [code] TEAM_DETECTIVE = AddExtraTeam("Detective", -- Name Color(0, 131, 255, 255), -- Team color "models/player/nsa_agent.mdl", -- Player model [[Investigate Crimes and other dark secrets of the server. Choose to work side-by-side with the Government or the Mafia/Terrorist... Or Both!]], -- Job description {"keys", "gmod_tool"}, -- Weapons "detective", -- Command to become the job 2, -- Maximum amount of said job 100, -- Salary 0, -- Admin status 0, -- Has to vote false, -- Has a license nil, -- Needs to be job X in order to get this job function(ply) return ply:GetNWString("usergroup") == "donator" or ply:GetNWString("usergroup") == "donatormod" or ply:GetNWString("usergroup") =="developer" or ply:GetNWString("usergroup") == "owner" end -- The extra check function. Enter nil or nothing to not have an extra check ) [/code]
Sorry, you need to Log In to post a reply to this thread.