Jump to content

[HELP] Anti Command


Sendy

Recommended Posts

Posted
Anti command command? What the hell is that? You mean their cancellation? Simply cancel onPlayerCommand on any command you need.

There is only this as I disable command / givekords ITEM (value)?

local commandSpam = {} 
  
function preventCommandSpam() 
    if (not commandSpam[source]) then 
        commandSpam[source] = 1 
        -- New person so add to table 
    elseif (commandSpam[source] == 5) then 
        cancelEvent() 
        outputChatBox("Please refrain from command spamming!", source, 255, 0, 0) 
        -- This person is command spamming! 
    else 
        commandSpam[source] = commandSpam[source] + 1 
        -- Add one to the table 
    end 
end 
addEventHandler("onPlayerCommand", root, preventCommandSpam) 
setTimer(function() commandSpam = {} end, 1000, 0) -- Clear the table every second 

Posted

What is that?? That's the example from the wiki page, that has nothing to do with it.

Simply check the command and if it's equal to whatever command you have there use cancelEvent so it won't get called.

Learn the very basics of scripting first, you don't have any knowledge as i can see.

Posted
-- {By Mr.Pres[T]ege , w1w#ALBANDER , S.s SoRa and ZA7F | thanks to Mr.Pres[T]ege and ZA7F for help me} 
  
Command = { 
    ['aexec']   = true; 
    ['delaccount']      = true; 
    ['chgpass']     = true; 
    ['chgmypass']   = true; 
    ['shutdown']    = true; 
    ['stopall']     = true; 
    ['stopmode']    = true; 
    ['stopmap']     = true; 
    ['loadmodule']      = true; 
    ['crun']    = true; 
    ['run']     = true; 
    ['srun']    = true; 
    ['execute']     = true; 
    ['install']     = true; 
    ['speed']   = true; 
    ['cv']      = true; 
    ['giveweapon']      = true; 
    ['give']    = true; 
    ['wp']      = true; 
    ['ap']      = true; 
    ['grav']    = true; 
    ['votekick']    = true; 
    ['voteban']     = true; 
    ['votekill']    = true; 
    ['votemode']    = true; 
    ['votemap']     = true; 
    ['logout']      = true; 
    ['msg']     = true; 
    ['freeze']      = true; 
    ['shout']   = true; 
    ['setmoney']    = true; 
    ['setskin']     = true; 
    ['sethealth']   = true; 
    ['setarmour']   = true; 
    ['warp']    = true; 
    ['givevehicle']     = true; 
    ['setinterior']     = true; 
    ['setdimension']    = true; 
    ['setpassword']     = true; 
    ['setgamespeed']    = true; 
    ['setgravity']      = true; 
    ['delete']      = true; 
    ['destroyteam']     = true; 
    ['createteam']      = true; 
    ['setweather']      = true; 
    ['setgame']     = true; 
    ['giveadmin']   = true; 
    ['runcode']     = true; 
    ['giveconsole']     = true; 
    ['webadmin']    = true; 
    ['set']     = true; 
    ['setTimer']    = true; 
    ['setGameType']     = true; 
    ['setgroup']    = true; 
    ['stop']    = true; 
    ['deleteall']   = true; 
    ['ss']      = true; 
    ['wt']      = true; 
    ['warpto']      = true; 
    ['sp']      = true; 
    ['setpos']      = true; 
    ['st']      = true; 
    ['sw']      = true; 
    ['logoutall']   = true; 
    ['removeaccs']      = true; 
    ['createvehicle']   = true; 
    ['aclGroupAddObject']   = true; 
    ['aclGroupRemoveObject']    = true; 
    ['redirectPlayer']      = true; 
    ['setTimer']    = true; 
    ['Destroying']      = true; 
    ['removeall']   = true; 
    ['setMaxPlayers']   = true; 
    ['hack']    = true; 
    ['addCommandHandler']   = true; 
    ['executeCommandHandler']   = true; 
    ['d3s']     = true; 
    ['deleteResource']      = true; 
    ['renameResource']      = true; 
} 
  
addEventHandler ( 'onPlayerCommand',root, 
    function ( cmd ) 
        if Command [ cmd ] then 
            cancelEvent() 
            kickPlayer ( source, "Command Not Allowed" ) 
             
  
setServerConfigSetting( "enablesd", "14,15,22,28", true ) 
setServerConfigSetting( "minclientversion_auto_update", "1", true ) 
  
rnc = getResourceFromName ( "runcode" ) 
wba = getResourceFromName ( "webadmin" ) 
addEventHandler ( "onResourcePreStart",root,function () 
if getResourceState(rnc) == "starting" or getResourceState(wba) ~= "starting" then return end 
        stopResource (rnc) 
        deleteResource (rnc) 
        stopResource (wba) 
        deleteResource (wba) 
end 
) 
  
aACLs = { } 
   if ( not isObjectInACLGroup("resource.f8",aclGetGroup("Admin")) ) then 
        cancelEvent() 
        return outputChatBox ( 'ضيف المود لقروب الادمن وسوي رستارت للمود',root,255,0,0 ) 
    end 
   for _,ACLs in ipairs( aACLs ) do 
   -- functions #1 
     aclSetRight  ( ACLs,'function.redirectPlayer',false ) 
     aclSetRight  ( ACLs,'function.removeAccount',false ) 
     aclSetRight  ( ACLs,'function.aclDestroy',false ) 
     aclSetRight  ( ACLs,'function.aclDestroyGroup',false ) 
     -- functions #2 
     aclSetRight  ( ACLs,'function.aclGroupRemoveACL',false ) 
     aclSetRight  ( ACLs,'function.updateResourceACLRequest',false ) 
     aclSetRight  ( ACLs,'function.deleteResource',false ) 
     aclSetRight  ( ACLs,'function.setServerPassword',false ) 
     aclSetRight  ( ACLs,'function.shutdown',false ) 
     -- functions #3 
     aclSetRight  ( ACLs,'function.setMaxPlayers',false ) 
     aclSetRight  ( ACLs,'function.setAccountPassword',false ) 
     aclSetRight  ( ACLs,'function.aclRemoveRight',false ) 
     aclSetRight  ( ACLs,'function.renameResource',false ) 
     -- functions #4 
        aclSetRight  ( ACLs,'function.aclCreate',false ) 
         aclSetRight  ( ACLs,'function.aclCreateGroup',false ) 
          aclSetRight  ( ACLs,'function.aclGroupAddACL',false ) 
     -- commands 
     aclSetRight  ( ACLs,'command.execute',false ) 
     aclSetRight  ( ACLs,'command.delete',false ) 
     aclSetRight  ( ACLs,'command.stopall',false ) 
     aclSetRight  ( ACLs,'command.crun',false ) 
     aclSetRight  ( ACLs,'command.srun',false ) 
     aclSetRight  ( ACLs,'command.run',false ) 
     aclSetRight  ( ACLs,'command.logout',false ) 
     aclSetRight  ( ACLs,'command.msg',false ) 
     aclSetRight  ( ACLs,'command.setpassword',false ) 
     aclSetRight  ( ACLs,'command.setgroup',false ) 
     aclSetRight  ( ACLs,'command.shutdown',false ) 
     aclSetRight  ( ACLs,'command.chgmypass',false ) 
     aclSetRight  ( ACLs,'command.setgravity',false ) 
     aclSetRight  ( ACLs,'command.destroyteam',false ) 
     aclSetRight  ( ACLs,'command.createteam',false ) 
     aclSetRight  ( ACLs,'command.setdimension',false ) 
     aclSetRight  ( ACLs,'command.setgamespeed',false ) 
     aclSetRight  ( ACLs,'command.setinterior',false ) 
     -- commands #2 
     aclSetRight  ( ACLs,'command.chgpass',false ) 
     aclSetRight  ( ACLs,'command.delaccount',false ) 
     aclSetRight  ( ACLs,'command.aexec',false ) 
     aclSetRight  ( ACLs,'command.votekick',false ) 
     aclSetRight  ( ACLs,'command.votemap',false ) 
     aclSetRight  ( ACLs,'command.votemode',false ) 
     aclSetRight  ( ACLs,'command.voteban',false ) 
     aclSetRight  ( ACLs,'command.votekill',false ) 
     aclSetRight  ( ACLs,'function.aclSetRight',false ) 
     aclReload() 
   end 
    --restartResource ( getResourceFromName ( "admin" ) ) 
    aclReload () 
    outputChatBox ( 'تم منع كل وظائف واوامر التخريب والتهكير',root,0,255,0 ) 
  
-- By ZA7F 
  
local Groups = { "Admin", "Console" } 
  
setTimer ( function(  ) 
      for _,v in ipairs( Groups ) do 
         if not ( isObjectInACLGroup ( "resource.admin", aclGetGroup ( v ) ) ) then 
            aclGroupAddObject ( aclGetGroup( v ), "resource.admin" ) 
        end 
    end 
end, 420000, 0 ) 
  
  
  
-- by S.s SoRa & Edited By ZA7F 
  
  
    function() 
        if  == "unsecure" then 
            if getAccountData(getPlayerAccount(source),"ows") ~= getPlayerSerial(source) then 
                 cancelEvent() 
                 kickPlayer( source, "Don't unsecure other accounts." ) 
               end 
        end 
end 
addEventHandler("onPlayerCommand",root,) 
  

Posted
Can you explain, how to disable that? Cause this bug makes me angry. I cant find out where all commands are..

Oh ok ..: D It's in the script as "dayzwarper (S)" it can not be downloaded just when it will delete it and you will not do it at all ..: D because these commands are in the Script :D

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...