Custom Job model errors in my server for players

My custom job models works for me and players who only SUBSCRIBED to those addons but won’t work for players who aren’t subscribed to those addons. :frowning:

+host_workshop_collection x -authkey x done.

BTW I am using a hosting website to run this server if that matters.

darkrpmod->lua->customthings->jobs.lua


--[[---------------------------------------------------------------------------
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_POLICEOFFICER = DarkRP.createJob("Police Officer", {
   color = Color(20, 0, 255, 255),
   model = {"models/player/santosrp/male_09_santosrp.mdl"},
   description = [[You will make this city great again!]],
   weapons = {"arrest_stick","unarrest_stick", "weapon_fiveseven2" ,"stunstick" ,"weaponchecker"},
   command = "police",
   max = 4,
   salary = 250,
   admin = 0,
   vote = true,
   hasLicense = true,
   candemote = true,
   -- CustomCheck
   medic = false,
   chief = true,
   mayor = false,
   hobo = false,
   cook = false,
   category = "Civil Protection",
})

TEAM_CITIZIENS = DarkRP.createJob("Doge", {
   color = Color(255, 255, 255, 255),
   model = {"models/doge_player/doge_player.mdl"},
   description = [[Wow much doge]],
   weapons = {"doge_player"},
   command = "doge",
   max = 3,
   salary = 250,
   admin = 0,
   vote = false,
   hasLicense = false,
   candemote = true,
   -- CustomCheck
   medic = false,
   chief = false,
   mayor = false,
   hobo = false,
   cook = false,
   category = "Pets",
})

TEAM_CIVILPROTECTION = DarkRP.createJob("Security Guard", {
   color = Color(213, 130, 252, 255),
   model = {"models/player/guard_pack/guard_03.mdl"},
   description = [[You get hired and work as a security !]],
   weapons = {"weapon_glock2"},
   command = "security",
   max = 2,
   salary = 50,
   admin = 0,
   vote = false,
   hasLicense = true,
   candemote = true,
   -- CustomCheck
   medic = false,
   chief = false,
   mayor = false,
   hobo = false,
   cook = false,
   category = "Citizens",
})

TEAM_SANIC = DarkRP.createJob("Sanic The Hero", {
   color = Color(240, 255, 75, 255),
   model = {"models/player/sanic.mdl"},
   description = [[Gotta catch 'em criminals fast! You are the good guy.]],
   weapons = {"m9k_scoped_taurus","arrest_stick","unarrest_stick"},
   command = "sanic",
   max = 2,
   salary = 300,
   admin = 0,
   vote = false,
   hasLicense = false,
   candemote = true,
   -- CustomCheck
   medic = false,
   chief = false,
   mayor = false,
   hobo = false,
   cook = false,
   category = "VIP",
   customCheck = function(ply) return ply:GetUserGroup() == "donator" or ply:GetUserGroup() == "VIP" or ply:GetUserGroup() == "rdonator" or ply:GetUserGroup() == "mdonator" or ply:IsAdmin() or ply:IsSuperAdmin() 
   end
   })
   
   TEAM_SANIC = DarkRP.createJob("Sanic The Thief", {
   color = Color(240, 255, 75, 255),
   model = {"models/player/shadough.mdl"},
   description = [[Gotta steal fast! You are the bad guy.]],
   weapons = {"prokeypadcracker","pro_lockpick_update"},
   command = "sanicthief",
   max = 2,
   salary = 35,
   admin = 0,
   vote = false,
   hasLicense = false,
   candemote = true,
   -- CustomCheck
   medic = false,
   chief = false,
   mayor = false,
   hobo = false,
   cook = false,
   category = "VIP",
   customCheck = function(ply) return ply:GetUserGroup() == "donator" or ply:GetUserGroup() == "VIP" or ply:GetUserGroup() == "rdonator" or ply:GetUserGroup() == "mdonator" or ply:IsAdmin() or ply:IsSuperAdmin() 
   end
   })
   TEAM_THIEF = DarkRP.createJob("Thief", {
    color = Color(0, 0, 0, 255),
    model = {"models/lillwasa/payday/chains.mdl", "models/lillwasa/payday/dallas.mdl", "models/lillwasa/payday/hoxton.mdl", "models/lillwasa/payday/wolf.mdl"},
    description = [[You are a thief, rob people, break into houses and steal printers]],
    weapons = {"lockpick","weapon_uni_cracker"}, 
    command = "thief",
    max = 5,
    salary = 65,
    admin = 0,
    vote = false,
    hasLicense = false,
	category = "Criminals"
})

-- Code generated at: TheCodingBeast.com | DarkRP 2.5 Tools
TEAM_VAPE = DarkRP.createJob("Snoop Dogg", {
   color = Color(255, 0, 0, 255),
   model = {"models/snoopdogg.mdl"},
   description = [[VAPE NAYSH YALL]],
   weapons = {"weapon_vape_juicy","weapon_vape_medicinal","weapon_vape"},
   command = "vapenash",
   max = 5,
   salary = 420,
   admin = 0,
   vote = false,
   hasLicense = false,
   candemote = true,
   -- CustomCheck
   medic = false,
   chief = false,
   mayor = false,
   hobo = false,
   cook = false,
   category = "VIP",
})

TEAM_SWAT = DarkRP.createJob("Swat", {
    color = Color(25, 25, 170, 255),
    model = {"models/codmw2/codmw2m.mdl"},
    description = [[The protector of every citizen that lives in the city.
        You have the power to arrest criminals and protect innocents.
        Hit a player with your arrest baton to put them in jail.
        Bash a player with a stunstick and they may learn to obey the law.
        The Battering Ram can break down the door of a criminal, with a warrant for their arrest.
        The Battering Ram can also unfreeze frozen props (if enabled).
        Type /wanted <name> to alert the public to the presence of a criminal.]],
    weapons = {"arrest_stick", "unarrest_stick", "m9k_g36", "stunstick", "door_ram", "weaponchecker", "handcuffs"},
    command = "Swat",
    max = 4,
    salary = 85,
    admin = 0,
    vote = true,
    hasLicense = true,
    help = {
        "Please don't abuse your job",
        "When you arrest someone they are auto transported to jail.",
        "They are auto let out of jail after some time",
        "Type /warrant [Nick|SteamID|Status ID] to set a search warrant for a player.",
        "Type /wanted [Nick|SteamID|Status ID] to alert everyone to a wanted suspect",
        "Type /unwanted [Nick|SteamID|Status ID] to clear the suspect",
        "Type /jailpos to set the jail position"
    },
    category = "Civil Protection",
})

TEAM_SWAT = DarkRP.createJob("Swat Medic", {
    color = Color(25, 25, 170, 255),
    model = {"models/codmw2/codmw2.mdl"},
    description = [[The protector of every citizen that lives in the city.
        You have the power to arrest criminals and protect innocents.
        Hit a player with your arrest baton to put them in jail.
        Bash a player with a stunstick and they may learn to obey the law.
        The Battering Ram can break down the door of a criminal, with a warrant for their arrest.
        The Battering Ram can also unfreeze frozen props (if enabled).
        Type /wanted <name> to alert the public to the presence of a criminal.]],
    weapons = {"arrest_stick", "unarrest_stick", "m9k_m3", "stunstick", "door_ram", "weaponchecker", "handcuffs", "weapon_medkit"},
    command = "Swatmedic",
    max = 1,
    salary = 85,
    admin = 0,
    vote = true,
    hasLicense = true,
    help = {
        "Please don't abuse your job",
        "When you arrest someone they are auto transported to jail.",
        "They are auto let out of jail after some time",
        "Type /warrant [Nick|SteamID|Status ID] to set a search warrant for a player.",
        "Type /wanted [Nick|SteamID|Status ID] to alert everyone to a wanted suspect",
        "Type /unwanted [Nick|SteamID|Status ID] to clear the suspect",
        "Type /jailpos to set the jail position"
    },
    category = "Civil Protection",
})

TEAM_SWAT = DarkRP.createJob("Swat Sniper", {
    color = Color(25, 25, 170, 255),
    model = {"models/codmw2/codmw2he.mdl"},
    description = [[The protector of every citizen that lives in the city.
        You have the power to arrest criminals and protect innocents.
        Hit a player with your arrest baton to put them in jail.
        Bash a player with a stunstick and they may learn to obey the law.
        The Battering Ram can break down the door of a criminal, with a warrant for their arrest.
        The Battering Ram can also unfreeze frozen props (if enabled).
        Type /wanted <name> to alert the public to the presence of a criminal.]],
    weapons = {"arrest_stick", "unarrest_stick", "m9k_m98b", "stunstick", "door_ram", "weaponchecker", "handcuffs"},
    command = "Swatsniper",
    max = 1,
    salary = 85,
    admin = 0,
    vote = true,
    hasLicense = true,
    help = {
        "Please don't abuse your job",
        "When you arrest someone they are auto transported to jail.",
        "They are auto let out of jail after some time",
        "Type /warrant [Nick|SteamID|Status ID] to set a search warrant for a player.",
        "Type /wanted [Nick|SteamID|Status ID] to alert everyone to a wanted suspect",
        "Type /unwanted [Nick|SteamID|Status ID] to clear the suspect",
        "Type /jailpos to set the jail position"
    },
    category = "Civil Protection",
})

TEAM_HITMAN = DarkRP.createJob("Hitman", {
    color = Color(0, 0, 0, 255),
    model = "models/player/korka007/gta5_online_character_3.mdl",
    description = [[People hire you to take out other people,
    this job require you to be completely focussed.
    A single breath can make you loose a shot.]],
    weapons = {"m9k_svu"},
    command = "hitman",
    max = 1,
    salary = 65,
    admin = 0,
    vote = false,
    hasLicense = false,
    category = "Criminals",
})

TEAM_SADMIN = DarkRP.createJob("Owner on duty", {
    color = Color(150, 20, 20, 255),
    model = "models/player/jesus/jesus.mdl",
    description = [[]],
    weapons = {},
    command = "saod",
    max = 0,
    salary = 100,
    admin = 0,
    vote = false,
    hasLicense = false,
	category = "420",
    customCheck = function(ply) return ply:GetUserGroup() == "superadmin" end,
 
})

TEAM_ADMIN = DarkRP.createJob("Co-Owner On Duty", {
    color = Color(150, 20, 20, 255),
    model = "models/player/demon_violinist/demon_violinist.mdl",
    description = [[]],
    weapons = {},
    command = "aod",
    max = 0,
    salary = 100,
    admin = 0,
    vote = false,
    hasLicense = false,
	category = "420",
    customCheck = function(ply) return ply:GetUserGroup() == {"admin","superadmin"} end,
})

--[[---------------------------------------------------------------------------
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)


You have to create a serverside Lua file that resource.AddWorkshop’s every workshop addon you want players to download

I’ve tried it in garrysmod\lua\autorun\server\workshop.lua but that didn’t work… should I make that file in garrysmod\addons\darkrpmodification-master\lua? Sorry, I’m just a complete newbie skid :smiley:

That file placement is fine; can you post the contents?

That’s all I’ve got for now as I was just testing with my friend and he says he still sees an error on that police model :confused:

resource.AddWorkshop(“128091208”) // M9K Heavy Weapons
resource.AddWorkshop(“608936011”) // Police

Can you try renaming it from workshop.lua to workshop_myserver.lua? An addon you have might be sharing the same name. Also, this file is on your server and not client, right? And you have restarted/changelevel’d since you added the file?

Yes I always restart after I change a script or add a new file.
Didn’t work :nope: and I guess

Are the errors with the addons you are trying to download to the player? Can you tell me what the result of entering this code into your server console is?


print(file.Exists("autorun/server/workshop_myserver.lua", "LUA"))

I know FTP/file manager clients sometimes don’t save files properly.

"Unknown command “print” and nope

BTW There’s my console, you might find something wrong because I can’t :confused:



Fetching Workshop Addons..
Calling GetCollectionDetails
Collection has 32 Addons
Mounting Addon 'Advanced Duplicator' (163806212)
Mounting Addon '(Official Pack) Police Officer { P.M. }' (608936011)
Mounting Addon '3D2D Textscreens' (109643223)
Mounting Addon 'AntiPlayerStuck' (149737736)
Mounting Addon 'DarkRP Pro Lock Pick swep' (107338497)
Mounting Addon 'Doge Playermodel' (656834283)
Mounting Addon 'M9K Assault Rifles' (128089118)
Mounting Addon 'M9K Heavy Weapons' (128091208)
Mounting Addon 'Hit Numbers' (110871780)
Mounting Addon 'M9K Small Arms pack' (128093075)
Mounting Addon 'More Materials!' (105841291)
Mounting Addon 'Security Guard Playermodels' (169011381)
Mounting Addon 'Simple Hitmarker' (201942905)
Mounting Addon 'Smart Remover Tool' (107382750)
Mounting Addon 'Stacker STool' (104479831)
Mounting Addon 'The sit anywhere script!' (108176967)
Mounting Addon 'Wiremod' (160250458)
Mounting Addon '[Official] Precision Tool' (104482086)
Mounting Addon 'Advanced Duplicator 2 (REUPLOAD)' (602372895)
Mounting Addon '[ScriptFodder] [#1679] Arivia F4 DarkRP Menu [Resources ONLY]' (529451065)
Mounting Addon 'Sanic Playermodel(S)' (325884882)
Mounting Addon 'Pro Keypad Cracker' (328695238)
Mounting Addon 'Keypad Tool and Cracker with Wire Support' (108424005)
Mounting Addon 'Fading Doors - Original' (762284291)
Mounting Addon 'PAYDAY The Heist models' (109747095)
Mounting Addon 'Vape SWEP' (673698301)
Mounting Addon 'Snoop Dogg Playermodel' (348376962)
Mounting Addon 'Swat Player Model' (414865323)
Mounting Addon 'Xanath Roleplay - Suit #3' (664266085)
Mounting Addon 'Jesus Playermodel' (237872885)
Mounting Addon 'Demon Violinist Playermodel' (315394811)
Mounting Addon '[Aurora] Terrorist' (471608898)
Adding Filesystem Addon 'c:	cafiles\users\ernestasa\27315\garrysmod\addons\customizablemoneyprinters'
Adding Filesystem Addon 'c:	cafiles\users\ernestasa\27315\garrysmod\addons\darkrpmodification-master'
Adding Filesystem Addon 'c:	cafiles\users\ernestasa\27315\garrysmod\addons\ulib'
Adding Filesystem Addon 'c:	cafiles\users\ernestasa\27315\garrysmod\addons\ulx'
Usage: sv_setsteamaccount <login_token>
Server logging enabled.
Server logging data to file logs\L1123057.log
L 11/23/2016 - 21:56:04: Log file started (file "logs\L1123057.log") (game "C:\TCAFiles\Users\ErnestasA\27315\garrysmod") (version "6563")
Unknown command "sbox_allownpcs"
Unknown command "sbox_plpldamage"
Unknown command "sbox_playergod"
Unknown command "sbox_maxspawners"
Unknown command "sbox_maxturrets"
'banned_ip.cfg' not present; not executing.
Changing gamemode to DarkRP (darkrp)
WARNING: Port 27005 was unavailable - bound to port 27006 instead
Network: IP 193.111.184.72, mode MP, dedicated Yes, ports 27025 SV / 27006 CL
Server logging data to file logs\L1123058.log
PREP OK
Particles: Missing 'particles/grub_blood.pcf'
Particles: Missing 'particles/antlion_gib_02.pcf'
Particles: Missing 'particles/antlion_worker.pcf'
Particles: Missing 'particles/striderbuster.pcf'
Weapon Strip con var created
Penetration/ricochet con var created
Recoil con var created
Ammo crate detonation con var created
Damage Multiplier con var created
Default Clip con var created
Unique Slots con var created
///////////////////////////////
//      Ulysses Library      //
///////////////////////////////
// Loading...                //
//  shared/defines.lua       //
//  shared/misc.lua          //
//  shared/util.lua          //
//  shared/hook.lua          //
//  shared/table.lua         //
//  shared/player.lua        //
//  server/player.lua        //
//  shared/messages.lua      //
//  shared/commands.lua      //
//  server/concommand.lua    //
//  server/util.lua          //
//  shared/sh_ucl.lua        //
//  server/ucl.lua           //
//  server/phys.lua          //
//  server/player_ext.lua    //
//  server/entity_ext.lua    //
//  shared/plugin.lua        //
//  shared/cami_global.lua   //
//  shared/cami_ulib.lua     //
// Load Complete!            //
///////////////////////////////
[ULIB] Loading SHARED module: ulx_init.lua
///////////////////////////////
//       ULX Admin Mod       //
///////////////////////////////
// Loading...                //
//  sh_defines.lua           //
//  lib.lua                  //
//  base.lua                 //
//  sh_base.lua              //
//  log.lua                  //
//  MODULE: slots.lua        //
//  MODULE: uteam.lua        //
//  MODULE: votemap.lua      //
//  MODULE: xgui_server.lua  //
///////////////////////////////
// ULX GUI -- by Stickly Man //
///////////////////////////////
// Adding Main Modules..     //
//  bans.lua                 //
//  commands.lua             //
//  groups.lua               //
//  maps.lua                 //
//  settings.lua             //
// Adding Setting Modules..  //
//  client.lua               //
//  server.lua               //
// Adding Gamemode Modules.. //
//  sandbox.lua              //
// Loading Server Modules..  //
//  sv_bans.lua              //
//  sv_groups.lua            //
//  sv_maps.lua              //
//  sv_sandbox.lua           //
//  sv_settings.lua          //
// XGUI modules added!       //
///////////////////////////////
//  MODULE: chat.lua         //
//  MODULE: fun.lua          //
//  MODULE: menus.lua        //
//  MODULE: rcon.lua         //
//  MODULE: teleport.lua     //
//  MODULE: user.lua         //
//  MODULE: userhelp.lua     //
//  MODULE: util.lua         //
//  MODULE: vote.lua         //
//  end.lua                  //
// Load Complete!            //
///////////////////////////////
Wiremod Version 'Workshop' loaded
false
[AdvDupe2Notify]	MODULE NOT INSTALLED CORRECTLY. SAVING WILL BE SLOW.
[Simple Hitmarkers loaded...]
-- Hit Numbers loaded --
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file materials/models/lillwasa/payday/chainsmask_d.vmt
VertexLitGeneric, 
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file materials/models/lillwasa/payday/chainsmask_d.vmt
VertexLitGeneric, 
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file materials/models/lillwasa/payday/dallasmask_d.vmt
VertexLitGeneric, 
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file materials/models/lillwasa/payday/dallasmask_d.vmt
VertexLitGeneric, 
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file materials/models/lillwasa/payday/hoxtonmask_d.vmt
VertexLitGeneric, 
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file materials/models/lillwasa/payday/hoxtonmask_d.vmt
VertexLitGeneric, 
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file materials/models/lillwasa/payday/wolfmask_d.vmt
VertexLitGeneric, 
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file materials/models/lillwasa/payday/wolfmask_d.vmt
VertexLitGeneric, 
Default clips will be not be modified
Particles: Missing 'particles/hunter_flechette.pcf'
Particles: Missing 'particles/hunter_projectile.pcf'
 +---------------------------------+
 |          E2 EXTENSIONS          |
 +----------------+----------------+
 |    ENABLED     |    DISABLED    |
 +----------------+----------------+
 | console        | constraintcore |
 | file           | effects        |
 | find           | http           |
 | holo           | propcore       |
 | npc            | remoteupload   |
 | ranger         | wiring         |
 | serialization  |                |
 | sound          |                |
 +----------------+----------------+
HTTP failed - ISteamHTTP isn't available!
Using map cycle file cfg/mapcycle.txt.
Couldn't find any entities named downtown_shopstorefront01bglass, which point_template respawn_downtown_shopstorefront01 is specifying.
Precache called on a point_template that has no templates: respawn_downtown_shopstorefront01
Nav File is wrong or something (4)
Server logging enabled.
Server logging data to file logs\L1123059.log
Unknown command "sbox_allownpcs"
Unknown command "sbox_plpldamage"
Unknown command "sbox_playergod"
Unknown command "sbox_maxspawners"
Unknown command "sbox_maxturrets"
'banned_ip.cfg' not present; not executing.
Writing cfg/banned_user.cfg.
Client "ST!KS" connected (178.78.97.151:27005).
Spawning textscreens...

Sorry, add lua_run in front of the code I provided.

I renamed my workshop_myserver.lua back to workshop.lua :slight_smile: if that’s ok so yeah…

> print(file.Exists(“autorun/server/workshop.lua”, “LUA”))…
true

EDIT: Good guy from my steam friendlist joined and told me I am invisible … So some players sees these models as an error or invisible… I am about go cry…

The problem either lies in the addons you are using or your players have downloads disabled.

Neither. I am using few exact same addons as some servers have. :confused:
Would you help me via teamviewer? I can pay.