Вопрос Скрипт смерти мэра

  • 9
  • 0
Контакты для связи отсутствуют.
Салам, кто-то может дать скрипт чтоб когда Мэр умирал он становился гражданином
 
  • 12
  • 3
Контакты для связи отсутствуют.
Code:
hook.Add("PlayerDeath", "mayor.OnDeath", function(v, k)
    if (v:Team() == TEAM_MAYOR) then
        v:changeTeam(GAMEMODE.DefaultTeam, true)
    end
end)
 
Последнее редактирование:
  • 457
  • 4
  • 90
Контакты для связи отсутствуют.
в jobs.lua добавить к профе мэра

Lua:
PlayerDeath = function(ply)
          -- It will check the team, and find out that yes, he is the mayor
                if ply:Team() == TEAM_MAYOR then
                  -- So, if he really is the mayor, and he dies, then change back to team citizen
                        ply:changeTeam( TEAM_CITIZEN, true )
                        for k,v in pairs( player.GetAll() ) do
                          -- This tell DarkRP to notify the entire server that yes, the mayor has been killed
                                DarkRP.notify(v, 1, 4, "The mayor has been killed!")
                        end
                end
        end,

чтобы получилось так

JavaScript:
TEAM_MAYOR = DarkRP.createJob("Mayor", {
        color = Color(150, 20, 20, 255),
        model = "models/player/breen.mdl",
        description = [[The Mayor of the city creates laws to govern the city.
        If you are the mayor you may create and accept warrants.
        Type /wanted <name>  to warrant a player.
        Type /jailpos to set the Jail Position.
        Type /lockdown initiate a lockdown of the city.
        Everyone must be inside during a lockdown.
        The cops patrol the area.
        /unlockdown to end a lockdown]],
        weapons = {},
        command = "mayor",
        max = 1,
        salary = GAMEMODE.Config.normalsalary * 1.89,
        admin = 0,
        vote = true,
        hasLicense = false,
        mayor = true,
        -- This tells it that when he dies
        PlayerDeath = function(ply)
          -- It will check the team, and find out that yes, he is the mayor
                if ply:Team() == TEAM_MAYOR then
                  -- So, if he really is the mayor, and he dies, then change back to team citizen
                        ply:changeTeam( TEAM_CITIZEN, true )
                        for k,v in pairs( player.GetAll() ) do
                          -- This tell DarkRP to notify the entire server that yes, the mayor has been killed
                                DarkRP.notify(v, 1, 4, "The mayor has been killed!")
                        end
                end
        end,
})
 
  • 159
  • 1
  • 18
PlayerDeath = function(ply) -- It will check the team, and find out that yes, he is the mayor if ply:Team() == TEAM_MAYOR then -- So, if he really is the mayor, and he dies, then change back to team citizen ply:changeTeam( TEAM_CITIZEN, true ) for k,v in pairs( player.GetAll() ) do -- This tell DarkRP to notify the entire server that yes, the mayor has been killed DarkRP.notify(v, 1, 4, "The mayor has been killed!") end end end,
Фаршмак гпт вотафаг?!
 
Сверху Снизу