Garry's Mod

Garry's Mod

Not enough ratings
SRK EXT | job ban
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Weapon
Addon Tags: Roleplay, Realism
File Size
Posted
4.287 KB
16 Jul, 2023 @ 5:30am
1 Change Note ( view )

Subscribe to download
SRK EXT | job ban

In 3 collections by Pyth0n11{FR}
Collection du serveur Vendémiaire GDC
399 items
Vendémiaire Médiéval le fléau nocturne
205 items
Vendémiaire Milsim / Apocalypse Zombie
151 items
Description
This addon is a extension of my simple revive kit(SRK).
It's a DarkRP extension, so it should not work on non darkrp based gamemodes.
This addon let server owners ban from job a player for a given time.
Simple exemple, you want to ban a player from his job when he respawn to let the job's place free for someone else.
You will have to add this line to your job.

srk_ext_job_ban(ply, ply:Team(), 600) -- 600 is the time in seconds. 600 = 10min ban.

You can add this line in the job's player death hook

PlayerDeath = function(ply)
srk_ext_job_ban(ply, ply:Team(), 600)
end,

The player will be banned from his job if he respawn or if he leave the server.
He will not be banned if he get revive.

Example :

A job without the job ban

TEAM_EXAMPLE = DarkRP.createJob("Example", {
color = Color(0, 0, 0, 255),
model = {"jobs_model"},
description = [[Job's description.]],
weapons = {},
command = "example",
max = 2,
salary = 0,
admin = 0,
vote = false,
hasLicense = false,
category = "Example category"
})

The same job with a job ban of 600 seconds.

TEAM_EXAMPLE = DarkRP.createJob("Example", {
color = Color(0, 0, 0, 255),
model = {"jobs_model"},
description = [[Job's description.]],
weapons = {},
command = "example",
max = 2,
salary = 0,
admin = 0,
vote = false,
hasLicense = false,
category = "Example category",
PlayerDeath = function(ply)
srk_ext_job_ban(ply, ply:Team(), 600)
end,
})

Note : You can use the function srk_ext_job_ban(ply, ply:Team(), 600) where you want.
Docs
Server | srk_ext_job_ban(ply, team_id, time)
Ban a player for the given time, from the given team, if they respawn or leave the server after falling unconscious.
ply, the player to ban.
team_id, the ID of the team you want to ban the player from.
time, the ban time in seconds.

License

This addon is under GPLv3.
That mean that you can use and modify this addon but if you distribute a other addon based on mine you have to put it under GPLv3 too.
2 Comments
Pyth0n11{FR}  [author] 10 Jul @ 9:28am 
When you use the simple revive kit, the posibility to ban someone from a job after his death is broken by my addon so this one give a workaround :)
Bames_1234 9 Jul @ 2:28pm 
what does it do