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

Posted
Oli, you know thats nivko right? And hes asked that question over and over again.

Forums is easyer, on MSN and IRC he spams you to death.

Posted

Cheers for the fix for the !loc Oli, i hate to sound repetitive, but whats the story wiv a !Hp script? i have no idea how to right scripts myself, but do plan to learn

Posted

!writeini -n $+("djtindata.ini") pkamount pkamount $rand(0,30)

ok i have it set to do that every 10 minutes using a timer. it works the first time, but every other time it returns the first number...is there a randomize command i have to use like in vb or what? thx in advanced

Posted

hi

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

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

Posted
hi

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

yes its possible and its in the next version of MTA:mA:GRS

Posted

Nivko, i gavce you harrys admin system ages ago with the 15kb script that he compiled, i do not know why the fuck you keep nagging people for it.

Posted

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
}

Posted

What do you need my (ancient) admin system for? Is has been outperformed by allmost every script currently available

Posted

He's trying to make out that he's not Nivko, yeh i know he's lying because 'Nivko' also known as Niels added me on MSN on my old MSN account. Anyway, you make people waste their time on you and you don't accept what they offer? :lol:

Posted

have somone a good timeban system it script in script packase is don't work i typ !timeban test 1 sec i wait 10 sec and test is unbanned.

Posted

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 
 } 
} 

Posted
omg thats like the oldest timeban around... do u EVER make anything ureself??

Mr. van Kooten has some mental disorders (It's in the family).

He doesn't know what "doing things urself" is.

Posted

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!

Posted

@MTAFreak:

wow, didn't know anyone used that one. And i'm quite sure it's not yours..

@BJack:

Use tokens, $addtok and $remtok

Posted

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

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

    • No registered users viewing this page.

×
×
  • Create New...