Jump to content

MTAMA Scripting


Si|ent

Recommended Posts

  • Replies 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

hi

Is it possible to show up the colors from the cars ???? If yes please write a code for that :D

humm if I remember correctly DJ-Mills server used to have a script that told colour and location of vehicles, but this is probably based on the location of the vehicle. Not sure if it can read-out the colour all the time.

Ahh so many scripts that should be released here.

but people decide themselves if they want to release em' :)

Link to comment

well i wrote this guy a single level admin system.. which is what harry's is.. and he STILL didnt accept it.. so i really dont know what he wants

here u go just incase u missed the point:

alias mta.command {
 if $readini($mta.dir $+ $1.ini,ID $+ $2,admin) {
   ;admin commands here
 }
 if $3 == !admin {
   var %a = 0,%b
   while %a <= $mta.maxplayers($1) {
     if $readini($mta.dir $+ $1.ini,ID $+ %a,admin) {
       if %b == $null { %b = $mta.name($1,%a) }
       else { %b = %b $+ , $mta.name($1,%a) }
     }
     !inc %a
   }
   mta.say $1 $iif(%b == $null,No admins present,Current Admins: %b)
 }
 ;other commands here.. for all players
}
alias mta.join {
 if ($readini(nickserv.ini,$mta.name($1,$2),pass)) {
   mta.msg $1 $2 $mta.name($1,$2) is a reserved admin name. Login using /msg login 
   $+(!.timer,$1,.,$2) 1 30 mta.kick $1 $2
 }
 ;other join messages here
}
alias mta.pm {
 if ($3 == login) {
   if ($readini(nickserv.ini,$mta.name($1,$2),pass)) {
     if ($readini($mta.dir $+ $1.ini,ID $+ $2,admin) == $null) {
       if ($readini(%dir2 $+ nickserv.ini,$mta.name($1,$2),pass) == $4-) {
         mta.say $1 $+(',$mta.name($1,$2),') logged in as an admin.
         !writeini $+(",%dir,$1.ini") ID $+ $2 admin 1
         $+(!.timer,$1,.,$2) off
       }
       else mta.msg $1 $2 Invalid password.
     }
     else mta.msg $1 $2 Already logged in as admin.
   }
 }
 ;other pm commands here
}

Link to comment

no this script is fine GRS too, i write my script can you fix this ?

;A slightly updated timeban script, featuring: 
;- Recovering after MTAMA turnoff (Still no unban when MTAMA is off) 
;- Multiple servers (Last bantime will be the unban on all banned servers) 
;- Bantimes in secs, mins, hours and days 

;Insert in mta.start 
 .timerunban 0 10 mta.timeunban 

;Insert in mta.command something equivalent to: 
 elseif ($3 == !timeban && %isadmin. [ $+ [ $1 ] $+ . $+ [ $2 ] ] == true) { 
   mta.timeban $1- 
 } 

;And to finish it all, insert these method at the bottom of your script: 
alias mta.timeban { 
 %id = $mta.getid($1,$4) 
 %ip = $mta.ip($1, %id) 
 %currenttime = $ctime 

 if (%id == -1) { 
   !return 
 } 
 %factor_text = $6 
 if (%factor_text == sec || %factor_text == s || %factor_text == secs || %factor_text == seconds) { 
   %factor = 1 
 } 
 elseif (%factor_text == min || %factor_text == m || %factor_text == mins || %factor_text == minutes) { 
   %factor = 60 
 } 
 elseif (%factor_text == hour || %factor_text == h || %factor_text == hours) { 
   %factor = 3600 
 } 
 elseif (%factor_text == day || %factor_text == d || %factor_text == hours || %factor_text == uur || %factor_text == uren) { 
   %factor = 86400 
 } 
 elseif (%factor_text == week || %factor_text == w || %factor_text == weeks) { 
   %factor = 604800 
 } 

 %ban_until = $calc(%currenttime + $5 * %factor) 
 mta.say $1 $4 has been banned until $asctime(%ban_until) 

 %bans = $readini( "MTAbans.ini", bans, ips) 
 %bans = $addtok(%bans, $longip(%ip), 32) 

 %servers = $readini( "MTAbans.ini", servers, $longip(%ip)) 
 %servers = $addtok(%servers, $1, 32) 

 writeini "MTAbans.ini" bans ips %bans 
 writeini "MTAbans.ini" banduration $longip(%ip) %ban_until 
 writeini "MTAbans.ini" server $longip(%ip) %servers 
 writeini "MTAbans.ini" name $longip(%ip) $mta.name($1,%id) 

 mta.ban $1 %id 
} 

alias mta.timeunban { 
 %bans = $readini( "MTAbans.ini", bans, ips) 
 %num_bans = $numtok(%bans, 32) 
 %currenttime = $ctime 
 %counter = 0 

 while (%counter < %num_bans) { 
   if (%num_bans > 1) { 
     %banned = $gettok( %bans , %counter + 1 , 32) 
   } 
   else { 
     %banned = %bans 
   } 
   if (%banned != $null) { 
     %ban_until = $readini( "MTAbans.ini", banduration, %banned ) 
     if (%ban_until < %currenttime) { 
       %servers = $readini( "MTAbans.ini", server, %banned) 
       %name   = $readini( "MTAbans.ini", name, %banned) 
       %num_servers = $numtok(%servers,32) 
       %counter2 = 0 
       while (%counter2 < %num_servers) { 
         %server = $gettok( %servers , %counter2 + 1 , 32) 
         mta.say %server  %name ( $+ $longip(%banned) $+ ) is unbanned (timer) 
         mta.unban %server $longip(%banned) 
         %counter2 = %counter2 + 1 
       } 
       %bans = $remtok(%bans, %banned, 32) 
       %num_bans = $calc(%num_bans - 1) 
       %counter = %counter - 1 

       remini "MTAbans.ini" banduration %banned 
       remini "MTAbans.ini" server %banned 
       remini "MTAbans.ini" name %banned 
     } 
   } 
   %counter = %counter + 1 
 } 
 if (%bans != $null) { 
   writeini "MTAbans.ini" bans ips %bans 
 } 
 else { 
   remini "MTAbans.ini" bans ips 
 } 
} 

Link to comment

I have a bit of a problem with my current admins script

this is the join

on *:SIGNAL:mta.join:{
 if ($readini(bjack.ini,adminlist,$mta.name($1,$2)) != $null) {
   mta.say $1 $readini(bjack.ini,server,awelcome)) $mta.name($1,$2)
   writeini bjack.ini onlineadmin current $readini(bjack.ini,onlineadmin,current) $+ , $mta.name($1,$2)
 }
 elseif ($readini(bjack.ini,adminlist,$mta.name($1,$2)) == $null) {
   mta.say $1 $readini(bjack.ini,server,welcome))
 }
}

i need a part script that only removes 1 name from a list instead of removing all names!

Link to comment

I'm not real sure what your asking but i use $remini

eg $remini("bjack.ini",adminlist,$mta.name($1,$2))

or to use if admin leaves use.

on *:SIGNAL:mta.exit:{ 
 if ($readini(bjack.ini,adminlist,$mta.name($1,$2)) != $null) { 
 !.$remini("bjack.ini",adminlist,$mta.name($1,$2))
 }
}

Hope this helped you

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...