Jump to content

who has a flood protection script snippet ?


CoZ

Recommended Posts

Posted (edited)

sometimes people wanna use a command to much

now it might be easier to watch for flooding in general.

but how would i go about creating a sort of interval required before the same command can be used by the same person again ?

im also intrigued in a global antiflood script

thanks in advance

edit

topic was : interval between times a command can be used

thought it over and the timecheck on each command could cause a serious load .. instead a simple flood protection would be better

does anyone by chance have a antiflood snippet of code ?

Edited by Guest
Posted

try something like

on *:SIGNAL:mta.command:{
 if (!%command [ $+ [ $3 ] ]) {
   set %command [ $+ [ $3 ] ] 1
   !timer $+ $3 1 3 unset %command [ $+ [ $3 ] ]

 }
}

you can use a command once in 3 seconds

dont know if it'll work, but try ;)

Posted

seems to work so far

it doesnt execute the command.. thats a good thing

but it doesnt warn people they're spamming

.. ah well - it will stop it anyway :D

thanks

Posted

on *:SIGNAL:mta.command:{
 if (!%command [ $+ [ $3 ] ]) {
   set %command [ $+ [ $3 ] ] 1
   !timer $+ $3 1 3 unset %command [ $+ [ $3 ] ]

 }
 else mta.msg $1 $2 Please don't use the command $+(',$3,') so much.
}

So it'll warn them not to use a command so much :)

Posted

tried some like that ..couldnt get it to work before

tried it again now .. and it did work

maybe because i did some wrong with brackets or did this

} else blabla

}

weird

ps .. mta.text or mta.pm , not msg but np :P

thanks

i found it messed with one particular command - making the script crash

.. but ive changed it to

if ($3 == !specificcommand) {

}

elseif (!%command [ $+ [ $3 ] ]) {

blabla

etcetcetc

}

else mta.pm $1 $2 dont spam

}

Posted

ye, u can do it like that, but that command will have no anti-spam check

dunno what caused an error though, maybe commands like 'if (!bla* iswm $3) {' can cause that.. not sure

P.S: sorry for mta.msg, used to scripting for VC :)

  • Recently Browsing   0 members

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