Jump to content

New DM Script!


HouseMD

Recommended Posts

  
alias cplayers !return $numtok($readini(Alive.ini,alive,ids),32) 
alias players.server !return $did(mta,$1 $+ 02).lines 
alias gus.getid { 
  var %a = 0 
  while (%a <= $mta.server($1).cmax)  { 
    if ($+(*,$2,*) iswm $mta.nick($1,%a)) !return %a 
    !inc %a 
  } 
  !return -1 
} 
  
alias mta.end {  
  if ($cplayers($1) == 1) && (players.server($1) >= 1) && (%mta.endwinner == $null) {  
    var %a = $readini(Alive.ini,alive,ids) 
    mta.text $1 $mta.nick($1,%a) is winner! 
    !writeini -n stats.ini WINS $mta.nick($1,%a) $calc($readini(stats.ini,WINS,$mta.nick($1,%a)) + 1) 
    set %mta.endwinner 1 
    !halt  
  } 
}  
on *:SIGNAL:mta.startrace: { 
  var %a = 0,%b = ffs 
  unset %mta.endwinner  
  !remini -n Alive.ini Alive IDs 
  while (%a <= $mta.server($1).cmax) { 
    if ($mta.nick($1,%a) != $null) { 
      if (%b == ffs) %b = %a 
      else %b = %b %a 
    } 
    !inc %a 
  } 
  !writeini alive.ini alive ids  %b 
} 
on *:SIGNAL:mta.part: {  
  var %b = $readini(Alive.ini,alive,ids) 
  if ($findtok(%b,$2,1,32) != $null) { 
    !writeini -n alive.ini alive ids $deltok(%b,$findtok(%b,$2,1,32),32) 
    mta.end $1 
  } 
}  
on *:SIGNAL:mta.death: { 
  var %b = $readini(Alive.ini,alive,ids) 
  !writeini -n alive.ini alive ids $deltok(%b,$findtok(%b,$2,1,32),32) 
  mta.end $1 
}  
  

This DM script hasn't failed yet :) and is faster than ever :D

Link to comment

Hi, first - nice script, but it;s missing few options like !alive !dead etc. And most important it doesn't care if it's dd or race map.

So, here's the thing i've made an upgrade that makes it possible to mark which maps are dd and which are race but as always there is a problem, now it doesn't says who won the map... Well i'm out of options and i have to ask you for help :)

    alias cplayers !return $numtok($readini(Alive.ini,alive,ids),32) 
    alias players.server !return $did(mta,$1 $+ 02).lines 
    alias gus.getid { 
      var %a = 0 
      while (%a <= $mta.server($1).cmax)  { 
        if ($+(*,$2,*) iswm $mta.nick($1,%a)) !return %a 
        !inc %a 
      } 
      !return -1 
    } 
      
    alias mta.end {  
[b]if ($readini($scriptdir $+ ddraces.ini,MAP,$replace($mta.race($1),$chr(32),-)) == DD {[/b] 
      if ($cplayers($1) == 1) && (players.server($1) >= 1) && (%mta.endwinner == $null) {  
        var %a = $readini(Alive.ini,alive,ids) 
        mta.text $1 $mta.nick($1,%a) is winner! 
        !writeini -n stats.ini WINS $mta.nick($1,%a) $calc($readini(stats.ini,WINS,$mta.nick($1,%a)) + 1) 
        set %mta.endwinner 1 
        !halt  
      } 
    }  
  } 
[b] on *:SIGNAL:mta.command: { 
if ($3 == !setmodedd) { 
!writeini -n " $+ $scriptdir $+ ddraces.ini" MAP $replace($mta.race($1),$chr(32),-) DD 
mta.text $1 Map $mta.race($1) set as dd 
} 
elseif ($3 == !setmoderace) { 
!writeini -n " $+ $scriptdir $+ ddraces.ini" MAP $replace($mta.race($1),$chr(32),-) RACE 
mta.text $1 Map $mta.race($1) set as race 
} 
}   [/b] 
    on *:SIGNAL:mta.startrace: { 
      var %a = 0,%b = ffs 
      unset %mta.endwinner  
      !remini -n Alive.ini Alive IDs 
      while (%a <= $mta.server($1).cmax) { 
        if ($mta.nick($1,%a) != $null) { 
          if (%b == ffs) %b = %a 
          else %b = %b %a 
        } 
        !inc %a 
      } 
      !writeini alive.ini alive ids  %b 
    } 
    on *:SIGNAL:mta.part: {  
      var %b = $readini(Alive.ini,alive,ids) 
      if ($findtok(%b,$2,1,32) != $null) { 
        !writeini -n alive.ini alive ids $deltok(%b,$findtok(%b,$2,1,32),32) 
        mta.end $1 
      } 
    }  
    on *:SIGNAL:mta.death: { 
      var %b = $readini(Alive.ini,alive,ids) 
      !writeini -n alive.ini alive ids $deltok(%b,$findtok(%b,$2,1,32),32) 
      mta.end $1 
    } 

Well script isn't too big then you can see what i've changed... Any help ? THX

Link to comment
Hi, first - nice script, but it;s missing few options like !alive !dead etc. And most important it doesn't care if it's dd or race map.

So, here's the thing i've made an upgrade that makes it possible to mark which maps are dd and which are race but as always there is a problem, now it doesn't says who won the map... Well i'm out of options and i have to ask you for help :)

    alias cplayers !return $numtok($readini(Alive.ini,alive,ids),32) 
    alias players.server !return $did(mta,$1 $+ 02).lines 
    alias gus.getid { 
      var %a = 0 
      while (%a <= $mta.server($1).cmax)  { 
        if ($+(*,$2,*) iswm $mta.nick($1,%a)) !return %a 
        !inc %a 
      } 
      !return -1 
    } 
      
    alias mta.end {  
[b]if ($readini($scriptdir $+ ddraces.ini,MAP,$replace($mta.race($1),$chr(32),-)) == DD {[/b] 
      if ($cplayers($1) == 1) && (players.server($1) >= 1) && (%mta.endwinner == $null) {  
        var %a = $readini(Alive.ini,alive,ids) 
        mta.text $1 $mta.nick($1,%a) is winner! 
        !writeini -n stats.ini WINS $mta.nick($1,%a) $calc($readini(stats.ini,WINS,$mta.nick($1,%a)) + 1) 
        set %mta.endwinner 1 
        !halt  
      } 
    }  
  } 
[b] on *:SIGNAL:mta.command: { 
if ($3 == !setmodedd) { 
!writeini -n " $+ $scriptdir $+ ddraces.ini" MAP $replace($mta.race($1),$chr(32),-) DD 
mta.text $1 Map $mta.race($1) set as dd 
} 
elseif ($3 == !setmoderace) { 
!writeini -n " $+ $scriptdir $+ ddraces.ini" MAP $replace($mta.race($1),$chr(32),-) RACE 
mta.text $1 Map $mta.race($1) set as race 
} 
}   [/b] 
    on *:SIGNAL:mta.startrace: { 
      var %a = 0,%b = ffs 
      unset %mta.endwinner  
      !remini -n Alive.ini Alive IDs 
      while (%a <= $mta.server($1).cmax) { 
        if ($mta.nick($1,%a) != $null) { 
          if (%b == ffs) %b = %a 
          else %b = %b %a 
        } 
        !inc %a 
      } 
      !writeini alive.ini alive ids  %b 
    } 
    on *:SIGNAL:mta.part: {  
      var %b = $readini(Alive.ini,alive,ids) 
      if ($findtok(%b,$2,1,32) != $null) { 
        !writeini -n alive.ini alive ids $deltok(%b,$findtok(%b,$2,1,32),32) 
        mta.end $1 
      } 
    }  
    on *:SIGNAL:mta.death: { 
      var %b = $readini(Alive.ini,alive,ids) 
      !writeini -n alive.ini alive ids $deltok(%b,$findtok(%b,$2,1,32),32) 
      mta.end $1 
    } 

Well script isn't too big then you can see what i've changed... Any help ? THX

Change the "if ($readini($scriptdir $+ ddraces.ini,MAP,$replace($mta.race($1),$chr(32),-)) == DD" to "if ($readini($scriptdir $+ ddraces.ini,MAP,$replace($mta.race($1),$chr(32),-)) == DD)"

Link to comment

  
alias cplayers !return $numtok($readini(Alive.ini,alive,ids),32) 
alias players.server !return $did(mta,$1 $+ 02).lines 
alias gus.getid { 
  var %a = 0 
  while (%a <= $mta.server($1).cmax)  { 
    if ($+(*,$2,*) iswm $mta.nick($1,%a)) !return %a 
    !inc %a 
  } 
  !return -1 
} 
  
alias mta.end {  
  if ($cplayers($1) == 1) && (players.server($1) >= 1) && (%mta.endwinner == $null) {  
    var %a = $readini(Alive.ini,alive,ids) 
    mta.text $1 $mta.nick($1,%a) is winner! 
    !writeini -n stats.ini WINS $mta.nick($1,%a) $calc($readini(stats.ini,WINS,$mta.nick($1,%a)) + 1) 
    set %mta.endwinner 1 
    !halt  
  } 
}  
on *:SIGNAL:mta.startrace: { 
  var %a = 0,%b = ffs 
  unset %mta.endwinner  
  !remini -n Alive.ini Alive IDs 
  while (%a <= $mta.server($1).cmax) { 
    if ($mta.nick($1,%a) != $null) { 
      if (%b == ffs) %b = %a 
      else %b = %b %a 
    } 
    !inc %a 
  } 
  !writeini alive.ini alive ids  %b 
} 
on *:SIGNAL:mta.part: {  
  var %b = $readini(Alive.ini,alive,ids) 
  if ($findtok(%b,$2,1,32) != $null) { 
    !writeini -n alive.ini alive ids $deltok(%b,$findtok(%b,$2,1,32),32) 
    mta.end $1 
  } 
}  
on *:SIGNAL:mta.death: { 
  var %b = $readini(Alive.ini,alive,ids) 
  !writeini -n alive.ini alive ids $deltok(%b,$findtok(%b,$2,1,32),32) 
  mta.end $1 
}  
on *:SIGNAL:mta.respawn: { 
set %mta.endwinner 1 
}  
  

Nah, this is better :D

Link to comment

Well I can't edit my previous post so..

Here the script i've made.. in fact i've found a script on forum and remade it a bit.

So it's (if map is marked as dd) adding a dd wins to file, and it's displayed in !stats, script works with gus.

Standalone file:

alias gus.level !return $iif($readini($scriptdir $+ admin.ini,ADMIN,$mta.nick($1,$2)),$readini($scriptdir $+ admin.ini,ADMIN,$mta.nick($1,$2)),0) 
alias mta.end { 
if ($readini($scriptdir $+ ddraces.ini,MAP,$replace($mta.race($1),$chr(32),-)) == DD) { 
  if (%cplayers == 1) { 
    var %a = 0 
    while (%a < $mta.server($1).cmax) { 
      if (!$mta.dead($1,%a)) { 
        mta.text $1 $mta.nick($1,%a) won! 
        mta.freeze $1 %a 
!writeini -n " $+ $scriptdir $+ stats.ini" DDWINS $mta.nick($1,%a) $gus.add($gus.wins($1,%a),1) 
        !halt 
      } 
      !inc %a 
   } 
  } 
 } 
} 
on *:SIGNAL:mta.startrace: { 
  set %cplayers $mta.server($1).players 
} 
on *:SIGNAL:mta.part: { 
  if (!$mta.dead($1,$2) set %cplayers $calc(%cplayers - 1) 
  mta.end $1 $2 
} 
on *:SIGNAL:mta.death: { 
  set %cplayers $calc(%cplayers - 1) 
  mta.end $1 $2 
} 
on *:SIGNAL:mta.connect: { 
  set %cplayers 0 
} 
on *:SIGNAL:mta.command: { 
if ($3 == !setmodedd) { 
   if ($gus.level($1,$2) >= 7) { 
!writeini -n " $+ $scriptdir $+ ddraces.ini" MAP $replace($mta.race($1),$chr(32),-) DD 
mta.text $1 Map $mta.race($1) marked as DD 
} 
else mta.pm $1 $2 You need 7 lvl. 
} 
elseif ($3 == !setmoderace) { 
   if ($gus.level($1,$2) >= 7) { 
!writeini -n " $+ $scriptdir $+ ddraces.ini" MAP $replace($mta.race($1),$chr(32),-) RACE 
mta.text $1 Map $mta.race($1) marked as Race 
} 
else mta.pm $1 $2 You need 7 lvl. 
} 
} 
  

To add in mtagus.mrc file

alias gus.ddwins !return $iif($readini($scriptdir $+ stats.ini,DDWINS,$mta.nick($1,$2)),$readini($scriptdir $+ stats.ini,DDWINS,$mta.nick($1,$2)),0) 
  

Now:

Find:

  elseif (!stat* iswm $3) { 
    if (%a == -1) mta.pm $1 $2 Error - Absent ID 
    else mta.text $1 $mta.nick($1,%a) $+ 's Stats - Level: $gus.level($1,%a) - Deaths: $gus.deaths($1,%a) - Visits: $gus.visits($1,%a) - Wins: $gus.wins($1,%a) - Spawns: $gus.spawns($1,%a) - Races: $gus.races($1,%a) 
  } 
  

Change to:

  elseif (!stat* iswm $3) { 
    if (%a == -1) mta.pm $1 $2 Error - Absent ID 
    else mta.text $1 $mta.nick($1,%a) $+ 's Stats - Level: $gus.level($1,%a) - Deaths: $gus.deaths($1,%a) - Visits: $gus.visits($1,%a) - Wins: $gus.wins($1,%a) - Spawns: $gus.spawns($1,%a) - Races: $gus.races($1,%a) - DD wins $gus.ddwins($1,%a) 
  } 
  

!setmodedd - mark map as dd (7 lvl needed)

!setmoderace - mark map as race (7 lvl needed)

Enjoy :P

Link to comment
  • 1 month later...
  • Recently Browsing   0 members

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