• DarkRP | Job armor & job /warrant, /wanted
    6 replies, posted
Ok I got a few problems in my DarkRP server. First of all here are links of some files of my darkrp Gamemode: [I]garrysmod/gamemodes/DarkRP/gamemode[/I] [URL="http://pastebin.com/viUek3eE"]shared.lua[/URL] (this is where all jobs are created) [I]garrysmod/gamemodes/DarkRP/gamemode/server[/I] [URL="http://pastebin.com/Z5yX8Hhb"]player.lua[/URL] So my [B]first problem[/B] is, I can't get my TEAM_SWAT,TEAM_SWATSNIPER and TEAM_SWATMEDIC to do /warrant and /wanted. I tried this already : [URL="http://facepunch.com/showthread.php?t=1116339&p=31734440&viewfull=1#post31734440"]http://facepunch.com/showthread.php?t=1116339&p=31734440&viewfull=1#post31734440[/URL] But it didn't work, where do I add teams to the commands then? Then my [B]second problem[/B] is, i tried adding armor to certain jobs, i added a .lua file in the [I]garrysmod/lua/autorun/server[/I] directory. I named it jobarmor.lua and the code can be found: [URL="http://pastebin.com/rv87eFse"]HERE[/URL] The godmode worked,but the armor didnt, how do i fix this? Thank you!
-snip-
There's a lua file called [B]entity[/B] in [B]darkrp/gamemode/shared[/B]. Find the function called [B]IsCP()[/B] Change it from this: [CODE]function playerMeta:IsCP() if not IsValid(self) then return false end local Team = self:Team() return Team == TEAM_POLICE or Team == TEAM_CHIEF or Team == TEAM_MAYOR end[/CODE] To this: [CODE]function playerMeta:IsCP() if not IsValid(self) then return false end local Team = self:Team() return Team == TEAM_POLICE or Team == TEAM_CHIEF or Team == TEAM_MAYOR or Team == TEAM_SWAT or Team == TEAM_SWATSNIPER or Team == TEAM_SWATMEDIC end[/CODE] This should solve your first problem. To give armor to certain jobs, open up the [B]gamemode_functions.lua[/B] file and find the [B]GM:PlayerSpawn[/B] function. Add this inside the function: [CODE] local t = ply:Team() if t == TEAM_SWAT or t == TEAM_SWATMEDIC or t == TEAM_SWATSNIPER then ply:SetArmor(150) elseif t == TEAM_SA then ply:SetArmor(100) elseif t == TEAM_MAYOR then ply:SetArmor(50) elseif t == TEAM_PROTHIEF or t == TEAM_CHIEF then ply:SetArmor(25) end[/CODE] Hope that helped.
[QUOTE=DevilMarkes;39650621]text[/QUOTE] Thanks a ton man, I was looking everywhere for that IsCP thing.
Thank you alot Devil! Now i gotta fix the armor :(
[QUOTE=3nforc3r]Now i gotta fix the armor :( [/QUOTE] I included a method of adding armor to certain jobs in my previous post. Have you tried doing it that way?
just letting everyone know ifyou want the warrant and evrything dont do TEAM_SWATSNIPER just do TEAM_POLICE cos then it is counted as a CP [editline]24th December 2015[/editline] oh shit just realized how old this post i
Sorry, you need to Log In to post a reply to this thread.