Jump to content

MTASA !wins command & besttime


SamB

Recommended Posts

I am trying to make a script for my mtasa server which records peoples wins and puts a best time on the maps. But, I have problem. This is my script:

on *:SIGNAL:mta.finish: {
 mta.text $1 $mta.nick($1,$2) finished $ord($mta.rank($1,$2)) with a time of $mta.time($1,$2).text
 if($mta.rank($1,$2) == 1) {
   %a = $readini playerstats.ini $mta.nick($1,$2) Wins
   !writeini playerstats.ini $mta.nick($1,$2) Wins $calc(%a + 1)
 }
 %b = $readini playerstats.ini $replace($mta.race($1,$2),$chr(32),format_space) Besttime
 if($mta.time($1,$2) < %b) {
   !writeini playerstats.ini $replace($mta.race($1,$2),$chr(32),format_space) Besttime $mta.time($1,$2)
   mta.text $1 $mta.nick($1,$2) has beaten the maps best time of %b.text
;  }
}

on *:SIGNAL:mta.command:{
 if (!wins == $3) {
   %a = $readini playerstats.ini $4 Wins
   mta.text $1 $4 wins: %a
 }
}

on *:SIGNAL:mta.startrace:command {
 %b = $readini playerstats.ini $replace($mta.race($1,$2),$chr(32),format_space) Besttime
 if(%b == 0) !writeini playerstats.ini $replace($mta.race($1,$2),$chr(32),format_space) Besttime 500000
}

the !wins [name] and stuff work. but Besttime doesnt work :( . Whenever some1 finishs it says: "Blah has beaten the maps besttime of" and it says that for EVERYONE that finishs :( can some1 help me ?

Link to comment
  • Recently Browsing   0 members

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