Jump to content

Dear scripters, please help me with anti command flood


GuyFromPast

Recommended Posts

Posted

tell me why - im very curious..

its very easy top make one.. just save variable (new one for every player) that saves the time of last use of command, and on use check the current time and compare - if its > 6 sec or not..

Posted
tell me why - im very curious..

its very easy top make one.. just save variable (new one for every player) that saves the time of last use of command, and on use check the current time and compare - if its > 6 sec or not..

u can avoid hackers if server say who used that command and who din't(its for cash)

but can u explain more about "variable" ? im newbie as u know and don't understand smart talk YET

Posted

maybe make 2 new functions? lock, unlock?

local lock = 0

function lock() 
lock = 1 
end 
function unlock() 
lock = 0 
end  

when execute your function add,

setTimer ( lock, 50, 1 )

setTimer ( unlock, 6000, 1 )

and also check if time its 1

if lock == 1 then outputChatBox("ERROR: You can fix once every 6 seconds.",255,0,0)

and that should work?

Posted

why creating function only to set one variable o_O. also that 50ms lock is .. weird

  
lock = 1 
setTimer(function() lock = 0 end, 6000, 1) 
  

but this is server side script so lock will lock for all players, if you want it to work for each player independed you have to define lock table at beginning of script:

  
lock = { } 
  

and use later something like

lock[source]=1

etc etc

but if you dont know the basics - dont try to understand me - because you wont...

Posted
why creating function only to set one variable o_O. also that 50ms lock is .. weird
  
lock = 1 
setTimer(function() lock = 0 end, 6000, 1) 
  

but this is server side script so lock will lock for all players, if you want it to work for each player independed you have to define lock table at beginning of script:

  
lock = { } 
  

and use later something like

lock[source]=1

etc etc

but if you dont know the basics - dont try to understand me - because you wont...

he can make it client side like i did one time :D

Posted

variable.. how can you script when you dont know what variable is (i think im saying this for 3rd time since 2 days, wtf?)?

this is very basic, and you shouldnt try writing a function/whatever without this knowledge..

it's like you want to drive car, you already sitting in car, even start engine, but you dont know even that vehicle have pedals :/

omg.. okay, i won't read/reply anymore in yours and Fabios topics - this doesnt have any sense.. you can ask million of questions, but nobody can help you if you sit down for a while and start to think ;/

Posted

afaik 50p is busy recently, and im spending most of my day i front of pc since some time (im working btw :P), what about others - i dunno, sometimes i see others trying to help, but much topics are already replied

Posted
afaik 50p is busy recently, and im spending most of my day i front of pc since some time (im working btw :P), what about others - i dunno, sometimes i see others trying to help, but much topics are already replied

Tell me what is exactly i think i can help :)

Posted

If you want to disable command, you have to modify its handler. There will be no script to stop commands because there is no function to "cancel" command.. but before you start editing the command you should gain some general knowledge about Lua itself.

Posted

modify handler ? so u wanna just say its impossible to make this script if ur not lua pro right -.- so many players have to continue playing with command flooders.. i guess every server owner checked this topic

ok seems like i got my answers

Posted

All I'm saying is you need to modify the resource that has this command because you can't make separate resource that will stop the command from working.

Posted

dont get annoyed - because this won't help you.

you dont have to be pro, you need to have general idea bout scripting..

handler is that function that is being fired when you input the command - so in other words - you need to modify that function you have made.

Posted

You've had tips on the first page; telling you to use table and timers to (un)lock the command..

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...