Jump to content

[SA] How to see who is the last man standing in DM Map?


Ywa

Recommended Posts

  • 2 weeks later...

yeah, you could count the numbers of players at the start of the DM map

and every time one player dies, you put of one of the number.

when the number is one, you've got the player

i don't know scripting, so i don't know if this is possible :)

Link to comment

yeah, but Ywa has a DM Server so he need it for that ;).

I'm trying to make him a script but it doesn't work, anyone knows the solution?

on *:SIGNAL:mta.endrace: {
 var %a = 0
 while (%a < $mta.server($1).cmax) {
   if ($mta.nick($1,%a) != -1) {
     if ($calc($mta.dead($1) + $mta.frozen($1) + 1) == $mta.server($1).players) {
       if ($mta.dead($1,%a) != 1 && $mta.dead($1,%a) != 2 && $mta.dead($1,%a) == $null) {
         mta.text $1 $mta.nick($1,%a) won!
       }
     }
   }
   !inc %a 
 }
}

Link to comment
dm maps usually dont have a respawn.

Are you shure?

if you want a propor dm map, last man standing, you can set the respawn the none in map editor. some dm maps use wave as a respawn method though, but thats more for fun servers, not real record my stats dm server.

Link to comment

can sum1 test this for me?[syntax=mIRC]on *:SIGNAL:mta.startrace: {

set %cplayers $mta.server($1).players

}

on *:SIGNAL:mta.death: {

set %cplayers $calc(%cplayers - 1)

if (%cplayers == 1) {

var %a = 0

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

if ($mta.dead($1,%a) == $null) {

mta.text $1 $mta.nick($1,%a) won!

mta.freeze $1 %a

}

}

}

}[/lua]

Link to comment
can sum1 test this for me?[syntax=mIRC]on *:SIGNAL:mta.startrace: {

set %cplayers $mta.server($1).players

}

on *:SIGNAL:mta.death: {

set %cplayers $calc(%cplayers - 1)

if (%cplayers == 1) {

var %a = 0

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

if ($mta.dead($1,%a) == $null) {

mta.text $1 $mta.nick($1,%a) won!

mta.freeze $1 %a

}

}

}

}[/lua]

well i have no race server so i cant test it, but i see that you forgot an 'inc %a' in the loop and i suppose that $mta.dead returns $true or $false, also you could stop the loop after it found the winner with !halt ;)

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

set %cplayers $mta.server($1).players

}

on *:SIGNAL:mta.death: {

set %cplayers $calc(%cplayers - 1)

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

!halt

}

!inc %a

}

}

}[/lua]

Link to comment

Ive got a deathmatch server, but lil's script isnt workin on my server :S... I had this script:

  var %a = 0 
 while (%a < $mta.server($1).cmax) { 
   if ($mta.nick($1,%a) != -1) { 
     if ($calc($mta.dead($1) + $mta.frozen($1) + 1) == $mta.server($1).players) { 
       if ($mta.dead($1,%a) != 1 && $mta.dead($1,%a) != 2 && $mta.dead($1,%a) == $null) { 
         mta.freeze $1 %a
         mta.text $1 $mta.nick($1,%a) won this map and will recieve 1 point! 
         !writeini -n " $+ $scriptdir $+ stats.ini" WINS $mta.nick($1,%a) $gus.add($gus.wins($1,%a),1)
       } 
     } 
   } 
   !inc %a 
 } 

And it almost works.. But it isnt freezing everybody.. only 50% of the players or something. And some people never get freezed... Sometimes the scripts freezes someone before the last man died... Anyone?[/code]

Link to comment

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

set %cplayers $mta.server($1).players

}

on *:SIGNAL:mta.death: {

set %cplayers $calc(%cplayers - 1)

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

!halt

}

!inc %a

}

}

}[/lua]

if this isn't working, nothing works!

Link to comment
  • Recently Browsing   0 members

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