Garry's Mod

Garry's Mod

评价数不足
SRK EXT | job ban
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 武器
插件标签: 角色扮演, 写实
文件大小
发表于
4.287 KB
2023 年 7 月 16 日 上午 5:30
1 项改动说明 ( 查看 )

订阅以下载
SRK EXT | job ban

在 Pyth0n11{FR} 的 3 个合集中
Collection du serveur Vendémiaire GDC
399 件物品
Vendémiaire Médiéval le fléau nocturne
205 件物品
Vendémiaire Milsim / Apocalypse Zombie
151 件物品
描述
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 条留言
Pyth0n11{FR}  [作者] 7 月 10 日 上午 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 7 月 9 日 下午 2:28 
what does it do