1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

Disable the "kill" & "explode" console cmd

Discussion in 'DarkRP Modding Questions & Help' started by Mr.Dexter, Dec 22, 2014.

  1. Mr.Dexter

    Mr.Dexter Member

    i need to disable the "kill" and "explode" cmd, people are abusing it and failrp. Does anyone know how?
     
  2. LordiAnders

    LordiAnders Active Member

    Code (Lua):

    local allowsui = CreateConVar("sv_allowsuicide","1",{FCVAR_REPLICATED,FCVAR_NOTIFY})

    hook.Add("CanPlayerSuicide","sv_allowsuicide command",function(ply)
       if allowsui:GetInt() == 0 then
           ply:SendLua("GAMEMODE:AddNotify(\"Suiciding is disabled!\",1,3) surface.PlaySound('buttons/button10.wav')")
           return false
       elseif allowsui:GetInt() == 1 then
           --return true
       elseif allowsui:GetInt() == 2 then
           if not ply:IsAdmin() then
               ply:SendLua("GAMEMODE:AddNotify(\"Only admins can suicide!\",1,3) surface.PlaySound('buttons/button10.wav')")
               return false
           end
       end
    end)
     
    It's controlled by sv_allowsuicide. 0 will disable completely, 1 will allow it, 2 will make it admin only.
     
    Last edited: Dec 16, 2016
  3. Mr.Dexter

    Mr.Dexter Member

    i guess i place that function in lua/autorun/server?
     
  4. Cake

    Cake Active Member

    DarkRP can also control suicide, there is a config option to make people respawn where they stand if they use the kill command.
     
  5. Mr.Dexter

    Mr.Dexter Member

    Lordi that is great thank you but how could i make it so a server wide message will go round like the ulx cmd "tsay" saying "Dexter has attempted to suicide"

    I may have done my self just added
    "ply:ChatPrint(.. ply:Nick().. "attempted to suicide")"
    just about to test
     
    Last edited: Dec 24, 2014
  6. LordiAnders

    LordiAnders Active Member

    Trust me, that's a bad idea. People could keep spamming the chat
     
  7. Mr.Dexter

    Mr.Dexter Member

    Can you not do a timer?

    Doesn't matter if you can't just means i have another reason to kick/ban. I only want this as means that players can tell if someone tries to suicide why hostaged
     
  8. Sebas3G

    Sebas3G New Member

    Where it is?
     

Share This Page