Jump to content

who has a flood protection script snippet ?


CoZ

Recommended Posts

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
Link to comment

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 :)

Link to comment

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

}

Link to comment
  • Recently Browsing   0 members

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