Hedning Posted August 4, 2006 Share Posted August 4, 2006 I want a script that make so you can only play a map 5 times, after 5 times you must play a new map. Link to comment
lil Toady Posted August 4, 2006 Share Posted August 4, 2006 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
CoZ Posted August 4, 2006 Share Posted August 4, 2006 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 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
lil Toady Posted August 4, 2006 Share Posted August 4, 2006 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
Hedning Posted August 4, 2006 Author Share Posted August 4, 2006 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
Recommended Posts