Вопрос Помогите с кодом adminmode

Статус
В этой теме нельзя размещать новые ответы.
  • 27
  • 1
Контакты для связи отсутствуют.
не работает код я незнаю почему

adminmode:
hook.Add( "PlayerSay", "AdminModes", function( ply, text )
    if text == "/amode" then
        print ("[# WORK]")
        if ply:IsUserGroup(a.config.Admins) then
            RunConsoleCommand("sam", "setjob", ply:Name(), "admin")
            RunConsoleCommand("sam", "respawn", ply:Name())
            RunConsoleCommand("sam", "noclip", ply:Name())
            wait(1)
            RunConsoleCommand("sam", "god", ply:Name())
        else
            ply:ChatPrint( "[#] Вы не администратор!")
        return ""
        end
    end
end)
У меня догадки что из за wait(1) но а как еще если не выдает бессмертье
 
  • 177
  • 9
  • 10
Контакты для связи отсутствуют.
coroutine.wait, ты не написал название библиотеки
 
  • 129
  • 1
  • 12
Контакты для связи отсутствуют.
Код:
hook.Add( "PlayerSay", "AdminModes", function( ply, text )
    if text == "/amode" then
        if ply:IsUserGroup(a.config.Admins) then          

RunConsoleCommand("sam", "setjob", ply:Name(), "admin")        

RunConsoleCommand("sam", "respawn", ply:Name())      
 
RunConsoleCommand("sam", "noclip", ply:Name())    
   
RunConsoleCommand("sam", "god", ply:Name())
        else
            ply:ChatPrint( "[#] Вы не администратор!")
        end
    end
end)

Должно работать
 
  • 27
  • 1
Контакты для связи отсутствуют.
Код:
hook.Add( "PlayerSay", "AdminModes", function( ply, text )
    if text == "/amode" then
        if ply:IsUserGroup(a.config.Admins) then        

RunConsoleCommand("sam", "setjob", ply:Name(), "admin")      

RunConsoleCommand("sam", "respawn", ply:Name())    
 
RunConsoleCommand("sam", "noclip", ply:Name())  
 
RunConsoleCommand("sam", "god", ply:Name())
        else
            ply:ChatPrint( "[#] Вы не администратор!")
        end
    end
end)

Должно работать
[[admin]sam] gamemodes/darkrp/gamemode/libraries/simplerr.lua:528: [ERROR] A runtime error has occurred in "addons/![core] drp/lua/darkrp_customthings/jobs.lua" on line 113.
The best help I can give you is this:

attempt to call method 'IsModer' (a nil value)

Hints:
- No hints, sorry.

The responsibility for the error above lies with (the authors of) one (or more) of these files:
 
  • 129
  • 1
  • 12
Контакты для связи отсутствуют.
[[admin]sam] gamemodes/darkrp/gamemode/libraries/simplerr.lua:528: [ERROR] A runtime error has occurred in "addons/![core] drp/lua/darkrp_customthings/jobs.lua" on line 113.
The best help I can give you is this:

attempt to call method 'IsModer' (a nil value)

Hints:
- No hints, sorry.

The responsibility for the error above lies with (the authors of) one (or more) of these files:
У тебя jobs.lua создают ошибку, а не мой код
 
Статус
В этой теме нельзя размещать новые ответы.
Активность
Пока что здесь никого нет
Сверху Снизу