Jump to content

Races script on deathmatch


Keslertje2005

Recommended Posts

IS it possible to create an add races scruot fir deathmatch. So everytime a race starts it will be added to his stats? Something like this? Look at the bottom

}
on *:SIGNAL:mta.startrace: {
 ;Parameters:
 ;$1 = Server
 ;$2 = Race ID
 ;$3 = 0/1/2 (success,failed,no players)
 %remmap = $readini($scriptdir $+ remmap.ini,REMMAPS,$replace($mta.race($1),$chr(32),-))
 if (%constant = on && %constantmap != $mta.race($1) && %remmap != 1) mta.startrace $1 %constantmapid
 if (%remmap == 1 && %constant != on) {
   mta.text $1 Map " $+ $mta.race($1) $+ " has been removed, changing to a random map..
   !.timer 1 1 mta.startrace $1 $rand(0,$mta.races($1))
 }
 if ($3 == 0 && %remmap != 1) {
   set %race $2
   set %deaths 0
   var %a = $calc($readini($scriptdir $+ mta.stats.ini,n,$mta.races($1,$2),times) + 1),%b = $calc($readini($scriptdir $+ mta.stats.ini,n,ALL,times) + 1)
   !writeini -n $+(",$scriptdir,mta.stats.ini,") ALL times %b
   !writeini -n $+(",$scriptdir,mta.stats.ini,") $+(",$mta.races($1,$2),") times %a
   mta.text $1 $mta.races($1,$2) - Top Time: $gus.toptime($1) - By: $gus.topname($1) - Deathlimit: $gus.deathlimit($1,$2) - Played: $+(%a,/,%b) times ( $+ $round($calc(100 / %b * %a),2) $+ % $+ )
 }
 if ($readini($scriptdir $+ instructions.ini,INSTRUCTIONS,$replace($mta.races($1,$2),$chr(32),)) != $null && $readini($scriptdir $+ instructions.ini,INSTRUCTIONS,$replace($mta.races($1,$2),$chr(32),)) != default && %remmap != 1) {
   mta.text $1 $mta.races($1,$2) - Instructions: $readini($scriptdir $+ instructions.ini,INSTRUCTIONS,$replace($mta.races($1,$2),$chr(32),))
 }
 var %a = 0 
 !writeini -n " $+ $scriptdir $+ stats.ini" RACES $mta.nick($1,%a) $gus.add($gus.races($1,%a),1)
 }

[/code]

Link to comment
  • 3 weeks later...

if u mean is it possible to have stats for deathmatch style maps then yes.

but its not as simple as just adding a few writeini's

its too late for me to try and make anything out of that mess also, u cant do it by a few lines in the startrace alias.

Link to comment

this will work (I hope)...

[syntax=mIRC]on *:SIGNAL:mta.startrace: {

;Parameters:

;$1 = Server

;$2 = Race ID

;$3 = 0/1/2 (success,failed,no players)

%remmap = $readini($scriptdir $+ remmap.ini,REMMAPS,$replace($mta.race($1),$chr(32),-))

if (%constant = on && %constantmap != $mta.race($1) && %remmap != 1) mta.startrace $1 %constantmapid

if (%remmap == 1 && %constant != on) {

mta.text $1 Map " $+ $mta.race($1) $+ " has been removed, changing to a random map..

!.timer 1 1 mta.startrace $1 $rand(0,$mta.races($1))

}

if ($3 == 0 && %remmap != 1) {

set %race $2

set %deaths 0

var %a = $calc($readini($scriptdir $+ mta.stats.ini,n,$mta.races($1,$2),times) + 1),%b = $calc($readini($scriptdir $+ mta.stats.ini,n,ALL,times) + 1)

!writeini -n $+(",$scriptdir,mta.stats.ini,") ALL times %b

!writeini -n $+(",$scriptdir,mta.stats.ini,") $+(",$mta.races($1,$2),") times %a

mta.text $1 $mta.races($1,$2) - Top Time: $gus.toptime($1) - By: $gus.topname($1) - Deathlimit: $gus.deathlimit($1,$2) - Played: $+(%a,/,%b) times ( $+ $round($calc(100 / %b * %a),2) $+ % $+ )

}

if ($readini($scriptdir $+ instructions.ini,INSTRUCTIONS,$replace($mta.races($1,$2),$chr(32),)) != $null && $readini($scriptdir $+ instructions.ini,INSTRUCTIONS,$replace($mta.races($1,$2),$chr(32),)) != default && %remmap != 1) {

mta.text $1 $mta.races($1,$2) - Instructions: $readini($scriptdir $+ instructions.ini,INSTRUCTIONS,$replace($mta.races($1,$2),$chr(32),))

}

while (%a < $mta.server($1).cmax) {

if ($mta.nick($1,%a) != -1) !writeini -n " $+ $scriptdir $+ stats.ini" RACES $mta.nick($1,%a) $gus.add($gus.races($1,%a),1)

!inc %a

}

}[/lua]

Link to comment
  • Recently Browsing   0 members

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