Help in jobs.lua teamban
I've got a job that I want to be playable once an hour. So I need a jobban of 1 hour, but I don't know how to set it up. Please help me.
TEAM_MLG = DarkRP.createJob("MLG", {
color = Color(30, 56, 76, 255),
model = {"models/nseven/tru_illuminati.mdl"},
description = [[Ist ein junger Gott im RDMen.]],
weapons = {"m9k_mossberg590", "m9k_val"},
command = "mlg",
max = 1,
salary = 300,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Kriminelle",
sortOrder = 12,
PlayerDeath = function(ply, weapon, killer)
ply:teamBan(TEAM_MLG)
ply:changeTeam(GAMEMODE.DefaultTeam, true)
DarkRP.notifyAll(0, 4, "")
end,
PlayerSpawn = function(ply)
ply:SetMaxHealth(100)
ply:SetHealth(100)
ply:SetArmor(0)
end,
})
TEAM_MLG = DarkRP.createJob("MLG", {
color = Color(30, 56, 76, 255),
model = {"models/nseven/tru_illuminati.mdl"},
description = [[Ist ein junger Gott im RDMen.]],
weapons = {"m9k_mossberg590", "m9k_val"},
command = "mlg",
max = 1,
salary = 300,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Kriminelle",
sortOrder = 12,
PlayerDeath = function(ply, weapon, killer)
ply:teamBan(60) -- Ban the player from the job for 60 minutes (1 hour)
ply:changeTeam(GAMEMODE.DefaultTeam, true)
DarkRP.notifyAll(0, 4, "")
end,
PlayerSpawn = function(ply)
ply:SetMaxHealth(100)
ply:SetHealth(100)
ply:SetArmor(0)
end,
})
by chatgbt :)
Doesn't work. I don't know why, I just copied the code in my jobs.lua
try this:
TEAM_MLG = DarkRP.createJob("MLG", {
color = Color(30, 56, 76, 255),
model = "models/nseven/tru_illuminati.mdl",
description = [[Ist ein junger Gott im RDMen.]],
weapons = {"m9k_mossberg590", "m9k_val"},
command = "mlg",
max = 1,
salary = 300,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Kriminelle",
sortOrder = 12,
PlayerDeath = function(ply, weapon, killer)
ply:teamBan(60) -- Ban the player from the job for 60 minutes (1 hour)
ply:changeTeam(GAMEMODE.DefaultTeam, true)
DarkRP.notifyAll(0, 4, "A player in the MLG job has died.")
end,
PlayerSpawn = function(ply)
ply:SetMaxHealth(100)
ply:SetHealth(100)
ply:SetArmor(0)
end
})
Nope not working either
The Code isn't wrong. The Player is just not getting banned after death
I can recommend posting a job for that, people can make it work for pretty cheap.
Is there like a setting or something that can disable the ban so it doesnt work?
Try This
PlayerDeath = function(ply, weapon, killer)
ply:teamBan(ply:Team(), 60)
ply:changeTeam(GAMEMODE.DefaultTeam, true)
DarkRP.notifyAll(0, 4, "A player in the MLG job has died.")
end,
Have a gander into the DarkRP Wiki
https://darkrp.miraheze.org/wiki/Functions/Player/Server/teamBan
It tells you exactly how to use this function.