Jump to content

Warn (3x) script for MTA-SA


Keslertje2005

Recommended Posts

Posted

Hey mensen.

Ik zoek al heel lang een script waar ik campers mee kan waarschuwen op MTA-SA. Als ik dan !camp doe wilde ik graag dat hij gewaarschuwd zou worden met de tekst. Na 2 keer waarschuwen zou hij dan gekickt moeten worden. Ik heb nu dit script tegen caps:

}
on *:SIGNAL:mta.text:{ 
 if ($len($3-) > 10) && ($calc($len($3-) - $len($removecs($3-,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z))) >= $calc($len($3-) * 0.7)) { 
   !writeini -n $+(",$mta.dir,$1.ini,") $2 warnings $calc($readini($mta.dir $+ $1.ini,$2,warnings) + 1) 
   var %a = $readini($mta.dir $+ $1.ini,$2,warnings) 
   if (%a >= 3) { 
     mta.text $1 $mta.nick($1,$2) reached the warnings limit and will be kicked! (Too much caps used) 
     mta.kick $1 $2 
   } 
   else mta.text $1 $mta.nick($1,$2) has been warned! $calc(3 - %a) more $iif($calc(3 - %a) == 1,warning,warnings) and he will be kicked! (Too much caps used) 
 } 
}

Ik heb geprobeerd hem te configureren naar !camp maar het wil me niet lukken want als ik !camp met mta.nick($1,%a) gaat hij de ID's af van 3 naar 1 volgens mij. Ik hoop dat iemnd een warn script zou kunnen maken zoals hierboven maar dan voor !camp

Alvast heeeeeeeeeel erg bedantk!!!

Posted

looked at the script and understood that its my caps kicker :P so whats the prob?

P.S: ENGLISH PLZ!

Do not PM me, im not going to read it anyway.

Posted

he wanted a warnings-system for MTA:SA so if he types !camp that they get a kick after 3 times.

lil Toady already scripted something like that for me:

works only with GUS:

Alias:

alias gus.warnings !return $iif($readini($scriptdir $+ warnings.ini,WARNINGS,$mta.nick($1,$2)),$v1,0)

Command:

elseif (!givewarning* iswm $3) {
 if ($gus.level($1,$2) >= 10) {
   if (%a == -1) mta.pm $1 $2 Error - Absent ID
   else {
     !writeini -n " $+ $scriptdir $+ warnings.ini" WARNINGS $mta.nick($1,%a) $calc($gus.warnings($1,%a)+1)
     if ($gus.warnings($1,%a) >= 3) {
       mta.text $1 $mta.nick($1,%a) has reached the warnings limit and will be banned!
       mta.ban $1 %a
     }
     else mta.text $1 $mta.nick($1,%a) has got a warning! $calc(3-$gus.warnings($1,%a)) more warnings and he will be banned.
   }
 }
}

Posted

OMG How stupid, I'll retyp it in english:

I'm searchin a very long time for a script where I can warn campers with on MTA-SA. So when I do !camp that player will get warned with a text. He should be kicked after 2 warnings. Ive got this script from lil (working perfect!!! Thanks lil!!):

} 
on *:SIGNAL:mta.text:{ 
 if ($len($3-) > 10) && ($calc($len($3-) - $len($removecs($3-,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z))) >= $calc($len($3-) * 0.7)) { 
   !writeini -n $+(",$mta.dir,$1.ini,") $2 warnings $calc($readini($mta.dir $+ $1.ini,$2,warnings) + 1) 
   var %a = $readini($mta.dir $+ $1.ini,$2,warnings) 
   if (%a >= 3) { 
     mta.text $1 $mta.nick($1,$2) reached the warnings limit and will be kicked! (Too much caps used) 
     mta.kick $1 $2 
   } 
   else mta.text $1 $mta.nick($1,$2) has been warned! $calc(3 - %a) more $iif($calc(3 - %a) == 1,warning,warnings) and he will be kicked! (Too much caps used) 
 } 
}

I tryed to edit it to !camp but it didnt work because when I do !camp with mta.nick($1,a%) it is warning from ID 3 to ID 1 i thought. I hope someone could edit this script to a warn script for me like the script above but than for !camp

Really really really many thanks!!!

Posted
he wanted a warnings-system for MTA:SA so if he types !camp that they get a kick after 3 times.

lil Toady already scripted something like that for me:

works only with GUS:

Alias:

alias gus.warnings !return $iif($readini($scriptdir $+ warnings.ini,WARNINGS,$mta.nick($1,$2)),$v1,0)

Command:

elseif (!givewarning* iswm $3) {
 if ($gus.level($1,$2) >= 10) {
   if (%a == -1) mta.pm $1 $2 Error - Absent ID
   else {
     !writeini -n " $+ $scriptdir $+ warnings.ini" WARNINGS $mta.nick($1,%a) $calc($gus.warnings($1,%a)+1)
     if ($gus.warnings($1,%a) >= 3) {
       mta.text $1 $mta.nick($1,%a) has reached the warnings limit and will be banned!
       mta.ban $1 %a
     }
     else mta.text $1 $mta.nick($1,%a) has got a warning! $calc(3-$gus.warnings($1,%a)) more warnings and he will be banned.
   }
 }
}

Its working! Your are the best! THANKS!!

Posted

But one more question. If I want to add another commands like this but than with AFK or Bad Language, wich part will I have to change so the warnings get stored in a other file than the camp warnings file?

Already thanks!

Posted

And because all the warnings are stored I cant start al over again with the warnings for that player. So when I warn him the next time he will be kicked with only 1 warning. Is it possible to get the warnings of that player deleted after he got kicked? Wihtout the otherones getting deleted?

Posted
  elseif ($3 == !givewarning) {
   if ($gus.level($1,$2) >= 10) {
     if (%a == -1) mta.pm $1 $2 Error - Absent ID
     else {
       !writeini -n " $+ $scriptdir $+ warnings.ini" WARNINGS $mta.nick($1,%a) $calc($gus.warnings($1,%a)+1)
       if ($gus.warnings($1,%a) >= 3) {
         mta.text $1 $mta.nick($1,%a) has reached the warnings limit and will be kicked!
         mta.kick $1 %a
         !writeini -n " $+ $scriptdir $+ warnings.ini" WARNINGS $mta.nick($1,%a) 0
       }
       else mta.text $1 $mta.nick($1,%a) has got a warning! $calc(3-$gus.warnings($1,%a)) more warnings and he will be banned.
     }
   }
 }

Posted (edited)

here, works with gus (or without it, just add a var %a that finds a player id), commands:

!afk - warnings for being away from kb

!bl - bad language

!camp - camping

all the warnings are saved in diff places :P

on *:SIGNAL:mta.command:{
 if ($3 == !afk) || ($3 == !camp) || ($3 == !bl) {
   if ($gus.level($1,$2) >= 5) {
     if (%a == -1) mta.pm $1 $2 Error - Absent ID
     else gus.giveawarning $1 %a $right($3,-1)
   }
 }
}
alias gus.giveawarning {
 !writeini -n " $+ $scriptdir $+ warnings.ini" $3 $mta.nick($1,$2) $calc($readini($scriptdir $+ warnings.ini,$3,$mta.nick($1,$2))+1)
 if ($readini($scriptdir $+ warnings.ini,$3,$mta.nick($1,$2)) >= 2) {
   mta.text $1 $mta.nick($1,$2) has reached the warnings limit and will be kicked!
   mta.kick $1 $2
   !remini " $+ $scriptdir $+ warnings.ini" $3 $mta.nick($1,$2)
 }
 else mta.text $1 $mta.nick($1,$2) has got a warning for $iif($3 == afk,being away from keyboard,$iif($3 == camp,camping,bad language)) $+! $calc(2-$readini($scriptdir $+ warnings.ini,$3,$mta.nick($1,$2))) more warnings and he will be kicked.
}

you can add as much commands as you want there under mta.command signal :P

P.S: haven't tested it, i don't have a mta:sa server to test scripts on

Edited by Guest

Do not PM me, im not going to read it anyway.

Posted

Beta, please help :P

  if ($len($3-) > 10) && ($calc($len($3-) - $len($removecs($3-,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z))) >= $calc($len($3-) * 0.7)) { 
   !writeini -n $+(",$mta.dir,$1.ini,") $2 warnings $calc($readini($mta.dir $+ $1.ini,$2,warnings) + 1) 
   var %a = $readini($mta.dir $+ $1.ini,$2,warnings) 
   if (%a >= 3) { 
     mta.text $1 $mta.nick($1,$2) reached the warnings limit and will be muted for 1 minute! (Too much caps used) 
     !writeini -n " $+ $scriptdir $+ $1.ini" WARNINGS $mta.nick($1,$2) 0  
     !.timer 1 3 mta.mute $1 $2   
     !.timer 1 63 mta.unmute $1 $2 
   } 
   else mta.text $1 $mta.nick($1,$2) has been warned! $calc(3 - %a) more $iif($calc(3 - %a) == 1,warning,warnings) and you will be muted for 1 minute! (Too much caps used) 
 } 

This is the whole command, but it wont delete the warnings... Thanks

Posted
here, works with gus (or without it, just add a var %a that finds a player id), commands:

!afk - warnings for being away from kb

!bl - bad language

!camp - camping

all the warnings are saved in diff places :P

on *:SIGNAL:mta.command:{
 if ($3 == !afk) || ($3 == !camp) || ($3 == !bl) {
   if ($gus.level($1,$2) >= 5) {
     if (%a == -1) mta.pm $1 $2 Error - Absent ID
     else gus.giveawarning $1 %a $right($3,-1)
   }
 }
}
alias gus.giveawarning {
 !writeini -n " $+ $scriptdir $+ warnings.ini" $3 $mta.nick($1,$2) $calc($readini($scriptdir $+ warnings.ini,$3,$mta.nick($1,$2))+1)
 if ($readini($scriptdir $+ warnings.ini,$3,$mta.nick($1,$2)) >= 2) {
   mta.text $1 $mta.nick($1,$2) has reached the warnings limit and will be kicked!
   mta.kick $1 $2
   !remini " $+ $scriptdir $+ warnings.ini" $3 $mta.nick($1,$2)
 }
 else mta.text $1 $mta.nick($1,$2) has got a warning for $iif($3 == afk,being away from keyboard,$iif($3 == camp,camping,bad language)) $+! $calc(2-$readini($scriptdir $+ warnings.ini,$3,$mta.nick($1,$2))) more warnings and he will be kicked.
}

you can add as much commands as you want there under mta.command signal :P

P.S: haven't tested it, i don't have a mta:sa server to test scripts on

Hey there,

I just tried this script there and i cant get it working.

I just copied it and made a .MRC file the loaded it but it just wont work lol

Any ideas?

Cheers in advance.

Posted
i think you need to load it in mtagus yeah, all my own scripts are in the mtagus file so that could be the problem

ok well i stuck it in there but still no joy.

Do you have it working?

EDIT:- in Lil Toadys post he wrote this..here, works with gus (or without it, just add a var %a that finds a player id)

is this maybe why its not working as i dont have a line like that in my script.

Also how would i do that.

Cheers :D

Posted
on *:SIGNAL:mta.command:{
var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$gus.getid($1,$4)),$2)
 if ($3 == !afk) || ($3 == !camp) || ($3 == !bl) {
   if (%a == -1) mta.pm $1 $2 Error - Absent ID
   else gus.giveawarning $1 %a $right($3,-1)
 }
}
alias gus.giveawarning {
 !writeini -n " $+ $scriptdir $+ warnings.ini" $3 $mta.nick($1,$2) $calc($readini($scriptdir $+ warnings.ini,$3,$mta.nick($1,$2))+1)
 if ($readini($scriptdir $+ warnings.ini,$3,$mta.nick($1,$2)) >= 2) {
   mta.text $1 $mta.nick($1,$2) has reached the warnings limit and will be kicked!
   mta.kick $1 $2
   !remini " $+ $scriptdir $+ warnings.ini" $3 $mta.nick($1,$2)
 }
 else mta.text $1 $mta.nick($1,$2) has got a warning for $iif($3 == afk,being away from keyboard,$iif($3 == camp,camping,bad language)) $+! $calc(2-$readini($scriptdir $+ warnings.ini,$3,$mta.nick($1,$2))) more warnings and he will be kicked.
}

Do not PM me, im not going to read it anyway.

Posted
on *:SIGNAL:mta.command:{
var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$gus.getid($1,$4)),$2)
 if ($3 == !afk) || ($3 == !camp) || ($3 == !bl) {
   if (%a == -1) mta.pm $1 $2 Error - Absent ID
   else gus.giveawarning $1 %a $right($3,-1)
 }
}
alias gus.giveawarning {
 !writeini -n " $+ $scriptdir $+ warnings.ini" $3 $mta.nick($1,$2) $calc($readini($scriptdir $+ warnings.ini,$3,$mta.nick($1,$2))+1)
 if ($readini($scriptdir $+ warnings.ini,$3,$mta.nick($1,$2)) >= 2) {
   mta.text $1 $mta.nick($1,$2) has reached the warnings limit and will be kicked!
   mta.kick $1 $2
   !remini " $+ $scriptdir $+ warnings.ini" $3 $mta.nick($1,$2)
 }
 else mta.text $1 $mta.nick($1,$2) has got a warning for $iif($3 == afk,being away from keyboard,$iif($3 == camp,camping,bad language)) $+! $calc(2-$readini($scriptdir $+ warnings.ini,$3,$mta.nick($1,$2))) more warnings and he will be kicked.
}

You sir are and absolute genius :D

Thankyou again :D

EDIT:- just noticed that anyone can use this script lol.

Is there anyway of ensuring no one under level 5 can use it?

Cheers again.

Posted

Woops have to post it in this topic

  if ($findtok($3-,f*ck,32)) { 
   !writeini -n " $+ $scriptdir $+ warnings8.ini" WARNINGS $mta.nick($1,$2) $calc($gus.warnings8($1,$2)+1) 
   if ($gus.warnings8($1,$2) >= 3) { 
     mta.text $1 $mta.nick($1,$2) has reached the warnings limit and will be muted for 1 minute!  
     !.timer 1 3 mta.mute $1 $2 
     !writeini -n " $+ $scriptdir $+ warnings8.ini" WARNINGS $mta.nick($1,$2) 0 
     !.timer 1 63 mta.unmute $1 $2 
   } 
   else mta.text $1 $mta.nick($1,$2) don't use that kind of language! $calc(3-$gus.warnings8($1,$2)) more warnings and you will be muted for 1 minute. 
 } 

This is the script I am talkin about, but now I want to add more words without writing a second script. And will it be possible to let someone be muted too when hes saying :o (becuase the f*ck is in the word) But wont be kicked if hes saying Fighting ur cosins killer...? Someone?

Thanks!

  • Recently Browsing   0 members

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