Jump to content

[SA] Scripts


BetaDevil

Recommended Posts

Here a list with some scripts for MTAmA4.

Full Packages

General Use Scripts x16 Finall by Tommis

Public Release Script 1.1 by Scooby

Public Gambling Script 1.0 by Scooby

GUS Extended by Tommis, CoZ & BetaDevil

GUS Extended will show an update-message at start-up, deny it!

Small Scripts

Deathmatch Script by BetaDevil

alias mta.end {
 if (%cplayers == 1) {
   var %a = 0
   while (%a < $mta.server($1).cmax) {
     if (!$mta.dead($1,%a)) {
       mta.text $1 $mta.nick($1,%a) is winner!
       mta.freeze $1 %a
       !halt
     }
     !inc %a
   }
 }
}
on *:SIGNAL:mta.startrace: {
 set %cplayers $mta.server($1).players
}
on *:SIGNAL:mta.part: {
 if (!$mta.dead($1,$2)) set %cplayers $calc(%cplayers - 1)
 mta.end $1 $2
}
on *:SIGNAL:mta.death: {
 set %cplayers $calc(%cplayers - 1)
 mta.end $1 $2
}
on *:SIGNAL:mta.connect: {
 set %cplayers 0
}

Points Script by BetaDevil & lil Toady

on *:SIGNAL:mta.command:{
 var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$mta.getid($1,$4)),$2)
 if ($3 == !points) {
   if (%a == -1) mta.text $1 Error - Absent ID
   else mta.text $1 $mta.nick($1,%a) has got $iif($readini($scriptdir $+ points.ini,POINTS,$mta.ip($1,%a)),$v1,0) points.
 }
}
on *:SIGNAL:mta.finish: {
 if ($mta.rank($1,$2) <5>= 2) var %score = $replacex($mta.rank($1,$2),1,5,2,4,3,3,4,2,5,1), %position = $replace($mta.rank($1,$2),1,first,2,second,3,third,4,fourth,5,fifth)
   else var %score = $replacex($mta.rank($1,$2),1,2), %position = $replace($mta.rank($1,$2),1,first)
   mta.text $1 $mta.nick($1,$2) came %position $+ , and earned %score points!
   !writeini " $+ $scriptdir $+ points.ini" POINTS $mta.ip($1,$2) $iif($readini($scriptdir $+ points.ini,POINTS,$mta.ip($1,$2)),$calc($v1 + %score),%score)
 }
}

Trace Script by lil Toady, ported for SA by Scooby

on *:SIGNAL:mta.command:{
 var %a = $iif((!$4),$2,$iif($mta.getid($1,* $+ $4 $+ *),$v1,$2))
 if ($3 == !trace) my.trace $1 %a
}
alias my.trace {
 set %my.trace $1 $2
 if (!$sock(my.trace $+ $mta.ip($1,$2))) sockopen my.trace $+ $mta.ip($1,$2) www.completewhois.com 80
}
on *:SOCKOPEN:my.trace*:{
 tokenize 32 %my.trace
 if ($sockerr > 0) {
   sockclose $sockname
   mta.text $1 Trace: An error has occured.
 }
 else {
   sockwrite -n $sockname GET /cgi2/rbl_lookup.cgi?query= $+ $mta.ip($1,$2) $+ &display=whois HTTP/1.1
   sockwrite -n $sockname User-Agent: MSIE 6.0
   sockwrite -n $sockname Host: www.completewhois.com
   sockwrite $sockname $crlf
 }
}
on *:SOCKCLOSE:my.trace*:{
 unset %tr.*
}
on *:SOCKREAD:my.trace*:{
 var %t
 sockread %t
 if (country-rirdata isin %t) {
   tokenize 32 %my.trace
   mta.text $1 $mta.nick($1,$2) ( $+ $mta.ip($1,$2) $+ ) - Location: $gettok(%t,2-,58)
   sockclose $sockname
 }
}

Votekick Script by lil Toady

on *:SIGNAL:mta.command:{
 var %a = $iif($iif($4,$iif($mta.nick($1,$4),$4,$mta.getid($1,$4)),$2),$v1,-1)
 if ($3 == !votekick) {
   if (%vote.nick. [ $+ [ $1 ] ] != $null) mta.pm $1 $2 Another votekick is running: $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
   elseif ($mta.server($1).players < 3) mta.pm $1 $2 Error - There should be at least 3 players in the server to start a votekick.
   elseif (%a == -1) mta.pm $1 $2 Error - Absent ID/Name
   elseif (%a == $2) mta.pm $1 $2 Error - Can't votekick yourself
   else {
     set %vote.nick. [ $+ [ $1 ] ] %a
     unset %vote.voters. [ $+ [ $1 ] ]
     mta.text $1 Votekick "!vote" if u want that $mta.nick($1,%a) should be kicked. [ $round($calc($mta.server($1).players / 2),0) votes needed] [1 minute]
     .timervote [ $+ [ $1 ] ] 1 60 mta.cancel.votekick $1
   }
 }
 elseif ($3 == !vote) {
   if ((%vote.nick. [ $+ [ $1 ] ] == $null) || (%vote.nick. [ $+ [ $1 ] ] !isnum)) mta.pm $1 $2 No votekick is currently running.
   elseif ($findtok(%vote.voters. [ $+ [ $1 ] ],$2,1,32)) mta.pm $1 $2 $mta.nick($1,$2) $+ , You have already voted.
   else {
     set %vote.voters. [ $+ [ $1 ] ] %vote.voters. [ $+ [ $1 ] ] $2
     if ($numtok(%vote.voters. [ $+ [ $1 ] ],32) >= $round($calc($mta.server($1).players / 2),0)) {
       mta.text $1 $mta.nick($1,%vote.nick. [ $+ [ $1 ] ]) Vote limit reached, $mta.nick($1,%vote.nick. [ $+ [ $1 ] ]) is out!
       mta.kick $1 %vote.nick. [ $+ [ $1 ] ]
       unset %vote.nick. [ $+ [ $1 ] ]
       unset %vote.voters. [ $+ [ $1 ] ]
       .timervote [ $+ [ $1 ] ] off
     }
     else mta.text $1 $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes for $mta.nick($1,%vote.nick. [ $+ [ $1 ] ]) [ $+ $calc($round($calc($mta.server($1).players / 2),0) - $numtok(%vote.voters. [ $+ [ $1 ] ],32)) more votes needed] [ $+ $timer(vote [ $+ [ $1 ] ]).secs seconds left]
   }
 }
}
on *:SIGNAL:mta.part:{
 if ($2 = %vote.nick. [ $+ [ $1 ] ]) mta.cancel.votekick $1
}
alias mta.cancel.votekick {
 mta.text $1 Vote kick cancelled: $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
 unset %vote.nick. [ $+ [ $1 ] ]
 unset %vote.voters. [ $+ [ $1 ] ]
}

Wordsban Script by Scooby

on *:SIGNAL:mta.command: {
 if (($3 == !banword) || ($3 == !unbanword)) {
   pgs.banword $1-
 }
 elseif ($3 == !banwords) mta.text $1 There are currently $lines(pgs.banwords.txt) banned words
}
alias pgs.banword {
 if ($mta.level($1,$2) < 5) mta.pm $1 $2 Error: Level 5 Admins Only!
 elseif ($3 == !banword) {
   if (!$4) mta.pm $1 $2 Error: !banword 
   else {
     var %a = 1,%b = $lines(pgs.banwords.txt)
     while (%a <= %b) {
       if ($4 iswm $read(pgs.banwords.txt,%a)) {
         mta.pm $1 $2 Error: Word Already Banned!
         !halt
       }
       !inc %a
     }
     !write pgs.banwords.txt $4
     mta.text $1 $+(',$4,') added to banned words list
   }
 }
 elseif ($3 == !unbanword) {
   if (!$4) mta.pm $1 $2 Error: !unbanword 
   else {
     var %a = 1,%b = $lines(pgs.banwords.txt)
     while (%a <= %b) {
       if ($4 iswm $read(pgs.banwords.txt,%a)) {
         !write -ds $+ $4 pgs.banwords.txt
         mta.text $1 $+(',$4,') removed from banned words list
         %a = $calc(%b + 2)
       }
       !inc %a
     }
     if (%a == $calc(%b + 1)) mta.pm $1 $2 Error: $4 Is Not Banned.
   }
 }
}
alias pgs.bannedwords {
 var %a = 1,%b = $3-,%c = $lines(pgs.banwords.txt)
 while (%a <= %c) {
   if ($read(pgs.banwords.txt,%a) iswm %b) {
     ;punsihment for use of a banned word
     mta.pm $1 $2 $+(',$read(pgs.banwords.txt,%a),') Is A Banned Word! Muted For 60 Secs
     mta.mute $1 $2
     .timerunmute $+ $2 1 60 mta.unmute $1 $2
     %a = %c
   }
   !inc %a
 }
}
on *:SIGNAL:mta.text: {
 pgs.bannedwords $1-
}

Edited by Guest
Link to comment
  • 2 weeks later...

this scripts is very easy try to use:

This i my scrip for win points in a NO RS map, see is very easy, i have other post asking if that is true (that == if you die recibe a rank) and is true and work perfect for me

Code:

alias san.winnernorsmap { 
 var %a = 0 
 while (%a <= $mta.server($1).cmax) { 
   if (!$mta.dead($1,%a)) !return %a 
   !inc %a 
 }    
} 

this the alias here the code

Code:

on *:SIGNAL:mta.death:{ 
 if ($mta.rank($1,$2) == 2) { 
   if (*(NO*RS)* iswm $mta.race($1)) { 
     mta.text $1 $mta.nick($1,$san.winnernorsmap($1)) is the winner of te map " $+ $mta.race($1) $+ " and win one point! 
     !writeini -n $+(",$mta.dir,winmaps.ini") $mta.nick($1,$san.winnernorsmap($1)) mapasnorsganados $calc($readini($mta.dir $+ winmaps.ini,$mta.nick($1,$san.winnernorsmap($1)),mapasnorsganados) + 1) 
   } 
 } 
} 

Link to comment
  • 3 weeks later...
  • Recently Browsing   0 members

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