Jump to content

Play a map only 5 times, request


Hedning

Recommended Posts

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

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

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

coz_sig_oob.png

Server Blog | Server quickinfo

STFU and dont bug the mta team with ''when is DM comming''

or risk theyre spending more time explaining they're still working on DM than actually getting work done :shock:

Posted

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

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

Posted

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

  • Recently Browsing   0 members

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