Есть по ней гайд? А то захожу у меня чел без модельки зато профа гражданин в нпс есть но брать ее нельзя.
/*
EXAMPLE
*/
TEAM_POLICE = DarkRP.createJob("Police Officer", {
color = Color(20, 150, 20, 255),
model = {
"dummy.mdl"
},
description = [[Team description.]],
weapons = {},
command = "citizen",
max = 0,
salary = GAMEMODE.Config.normalsalary,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
/*
!!! NEW STUFF !!!
*/
type = "police", // type of team (police, crime or commerce) you can add your own type, more info below
unlockCost = 500 // unlock cost
})
TEAM_CHIEF = DarkRP.createJob("Police Chief", {
...
stuff from your police job
...
type = "police", // type of team
requireUnlock = TEAM_POLICE, // job that need to be unlocked firsy
unlockCost = 1000 // unlock cost
})
TEAM_MAYOR = DarkRP.createJob("Mayor", {
...
stuff from your police job
...
type = "police",
requireUnlock = TEAM_CHIEF
/* since "unlockCost" is empty this job will be free if you have TEAM_CHIEF unlocked */
})
2. Add new NPCs and configure emoplyer types
1. Imagine that you are a NPC and stand where you want your NPC to stand
2. Run JonbNPCSpawnPos
3. You'll get something like this:
[n] = {
pos = Vector(-852.093750, -968.375000, -195.968750),
angle = Angle(0.000, -90.000, 0.000),
}
3. Paste it into darkrpmodificationfolder\modules\job_system\sh_init.lua
/* BEFORE */
commerce = {
name = "Commerce",
model = {"models/mossman.mdl", "models/Humans/Group02/male_08.mdl"},
pos = {
[1] = {
pos = Vector(-852.093750, -968.375000, -195.968750),
angle = Angle(0.000, -90.000, 0.000),
}
},
limit = 0.4
},
/* AFTER */
commerce = {
name = "Commerce", -- type name
model = {"models/mossman.mdl", "models/Humans/Group02/male_08.mdl"}, -- NPC models
pos = { -- NPC positions
[1] = {
pos = Vector(-852.093750, -968.375000, -195.968750),
angle = Angle(0.000, -90.000, 0.000),
}, -- do not forget about this comma
/* PASTED STUFF */
[2] = { -- change [n] to number
pos = Vector(-809.58392333984,-971.39575195313,-195.96875),
angle = Angle(0, -86.806198120117,0),
}
},
limit = 0.4 -- percentage limit (40% of players allowed to pick a job which has commerce type)
},
4. Do not be afraid to delete old poses.
5. Edit names / limits / models by your taste all (information given in the file)
6. There is exaple commended "hobo" type which given to show you how to add your own types.
3.
/*
If you are running latest DarkRP:
*/
Go to modules\job_system\sv_init.lua and paste this to the top of the file:
View Paste 6CaqI
/*
If you are running DarkRP 2.5.x:
*/
1. Open DarkRP\gamemode\modules\jobs\sv_jobs.lua
2. Go to line 41 and paste code below, image:
Imgur: The most awesome images on the Internet
if !force then
if TEAM.type && !self:NearJobNPC(TEAM.type) then self:MultiversionNotify(NOTIFY_ERROR, "Please register for this job at NPC employers. They are spread between town.") return false end
if TEAM.type && !self:NearJobNPC(TEAM.type) then return false end
if (TEAM.unlockCost && !table.HasValue(self.unlocks, TEAM.command)) then
return false
end
if TEAM.type && !(RPExtraTeams[prevTeam].type && RPExtraTeams[prevTeam].type == TEAM.type) then
local max = 0
for k, v in pairs(player.GetAll()) do
if TEAM.type == RPExtraTeams[v:Team()].type then
max = max + 1
end
end
if #player.GetAll() > 10 && max/#player.GetAll() > Job.NPC[TEAM.type].limit then self:MultiversionNotify(NOTIFY_ERROR, string.format(LANGUAGE.team_limit_reached, TEAM.name)) return false end
end
end
3. Deleting default JOB tab from F4 menu: simply delete DarkRP\gamemode\modules\f4menu\cl_jobstab.lua
/*
If you are running DarkRP 2.4.x:
*/
1. Open DarkRP\gamemode\server\player.lua
2. Go to line 256 and paste code below, image:
Imgur: The most awesome images on the Internet
if !force then
if TEAM.type && !self:NearJobNPC(TEAM.type) then self:MultiversionNotify(NOTIFY_ERROR, "Please register for this job at NPC employers. They are spread between town.") return false end
if (TEAM.unlockCost && !table.HasValue(self.unlocks, TEAM.command)) then
return false
end
if TEAM.type && !(RPExtraTeams[prevTeam].type && RPExtraTeams[prevTeam].type == TEAM.type) then
local max = 0
for k, v in pairs(player.GetAll()) do
if TEAM.type == RPExtraTeams[v:Team()].type then
max = max + 1
end
end
if #player.GetAll() > 10 && max/#player.GetAll() > Job.NPC[TEAM.type].limit then self:MultiversionNotify(NOTIFY_ERROR, string.format(LANGUAGE.team_limit_reached, TEAM.name)) return false end
end
end
3. Join your server and enter JonbNPCInit in your console
4. Deleting default JOB tab from F4 menu:
1. Open file DarkRP\gamemode\client\vgui.lua
2. Find this line (by default line 273) and delete it
GAMEMODE:addF4MenuTab("Jobs", GAMEMODE:JobsTab(), "icon16/user_suit.png")