Garry's Mod

Garry's Mod

Otillräckligt med betyg
SRK EXT | job ban
   
Utmärkelse
Favorit
Favoritmarkerad
Avfavoritmarkerad
Content Type: Addon
Addon Type: Weapon
Addon Tags: Roleplay, Realism
Filstorlek
Lades upp
4.287 KB
16 jul, 2023 @ 5:30
1 ändringsnotis ( visa )

Abonnera för att ladda ner
SRK EXT | job ban

I 3 samlingar av Pyth0n11{FR}
Collection du serveur Vendémiaire GDC
399 artiklar
Vendémiaire Médiéval le fléau nocturne
205 artiklar
Vendémiaire Milsim / Apocalypse Zombie
151 artiklar
Beskrivning
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 kommentarer
Pyth0n11{FR}  [skapare] 10 jul @ 9:28 
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 @ 14:28 
what does it do