Pivity

Help in jobs.lua teamban

Last read Never
#1

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,

})

#2

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,

})

Funny x 1
#3

by chatgbt :)

Funny x 1
#4

Doesn't work. I don't know why, I just copied the code in my jobs.lua

#5

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

})

#6

Nope not working either

#7

The Code isn't wrong. The Player is just not getting banned after death

#8

I can recommend posting a job for that, people can make it work for pretty cheap.

Winner x 1
#9

Is there like a setting or something that can disable the ban so it doesnt work?

#10

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,

#11

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.

Users viewing this thread
Nobody