I would like to make a Police Chief panel so that the chief can promote Cops to SWAT with no votes and demote SWAT and Cops. I don't really know where to start. I googled a little and found this
hook.Add("canDemote", "vipdemote", function(ply, target, reason)
if not ply:isChief() then return end
if target:isCP() then
DarkRP.notifyAll(1, 6, target:Name().." was fired from The Police for '"..reason.."'")
target:changeTeam(GAMEMODE.DefaultTeam, true)
return false, ""
end
end)
Is this a good start? Basicly i wan't to make a key pressed panel ( i can make the panel ) and include a list of cops with options to promote them to SWAT or demote them.
Here's a place to get started:
https://github.com/FPtje/DarkRP/blob/3f131bb33fc3171f369cfa7f82616619f3d61822/gamemode/modules/afk/sv_afk.lua
You'll have to network this through a net message or a concommand. Looks like all you'll have to do is use the changeTeam and setDarkRPVar functions on setver-side.
Also, make sure you make the proper checks to prevent exploits.
No one is going to write you a custom menu for your server here. If you want that I suggest you head to gmod store and post a job. However people here will help you fix bugs and answer your questions if you write it yourself.
For starting I would read this Derma Basic Guide to learn about making a derma menu. Specifically DFrame / DListView / DButton.
Then I would read up on https://wiki.garrysmod.com/page/Category:net specifically net.Send / net.SendToServer
Sorry, you need to Log In to post a reply to this thread.