Jump to content

Play a map only 5 times, request


Hedning

Recommended Posts

on *:SIGNAL:mta.startrace: {
 var %a = $readini($scriptdir $+ maplimit.ini,LIMIT,$replace($mta.race($1),$chr(32),$chr(45)))
 if (%a >= 5) {
   mta.text $1 This map has reached its play limit, picking new map..
   mta.startrace $1 $rand(0,$mta.races($1))
 }
 else !writeini " $+ $scriptdir $+ maplimit.ini" LIMIT $replace($mta.race($1),$chr(32),$chr(45)) $calc(%a + 1)
}

Link to comment
on *:SIGNAL:mta.startrace: {
 var %a = $readini($scriptdir $+ maplimit.ini,LIMIT,$replace($mta.race($1),$chr(32),$chr(45)))
 if (%a >= 5) {
   mta.text $1 This map has reached its play limit, picking new map..
   mta.startrace $1 $rand(0,$mta.races($1))
 }
 else !writeini " $+ $scriptdir $+ maplimit.ini" LIMIT $replace($mta.race($1),$chr(32),$chr(45)) $calc(%a + 1)
}

maybe this is better

it changes after 5 , but makes it possible to play it again later :D;)

on *:SIGNAL:mta.startrace: {
 var %a = $readini($scriptdir $+ maplimit.ini,LIMIT,$replace($mta.race($1),$chr(32),$chr(45)))
 if (%a >= 5) {
   mta.text $1 This map has reached its play limit, picking new map..
   !writeini -n " $+ $scriptdir $+ maplimit.ini" LIMIT $replace($mta.race($1),$chr(32),$chr(45))) 0
   mta.startrace $1 $rand(0,$mta.races($1))
 }
 else !writeini " $+ $scriptdir $+ maplimit.ini" LIMIT $replace($mta.race($1),$chr(32),$chr(45)) $calc(%a + 1)
}

Link to comment

use !remini then, no need to write 0 ;)

or i could change your example coz to this ;) has 1 line less ;)

on *:SIGNAL:mta.startrace: {
 var %a = $readini($scriptdir $+ maplimit.ini,LIMIT,$replace($mta.race($1),$chr(32),$chr(45)))
 if (%a >= 5) {
   mta.text $1 This map has reached its play limit, picking new map..
   mta.startrace $1 $rand(0,$mta.races($1))
 }
 !writeini " $+ $scriptdir $+ maplimit.ini" LIMIT $replace($mta.race($1),$chr(32),$chr(45)) $iif(%a = 5,0,$calc(%a + 1))
}

Link to comment

on *:SIGNAL:mta.startrace: {
 var %a = $readini($scriptdir $+ maplimit.ini,LIMIT,$replace($mta.race($1),$chr(32),$chr(45)))
 if (%a >= 5) {
   mta.text $1 This map has reached its play limit, picking new map..
   !writeini -n " $+ $scriptdir $+ maplimit.ini" LIMIT $replace($mta.race($1),$chr(32),$chr(45))) 0
   mta.startrace $1 $rand(0,$mta.races($1))
 }
 else !writeini " $+ $scriptdir $+ maplimit.ini" LIMIT $replace($mta.race($1),$chr(32),$chr(45)) $calc(%a + 1)
}

So if i play a map 5 times and then change to another map and play like 1 time then i want to change to that map again, it will work again?

Hope you understadn

Link to comment
  • Recently Browsing   0 members

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