Ywa Posted December 22, 2006 Share Posted December 22, 2006 Hello everyone, I have a problem. I have "wins" script. This works OK. But on a deathmatch/destruction derby map (Without CP's) I don't know how to catch the winner. And give him points. Any idea's here? Thanks in advance! Ywa Link to comment
SDK Posted December 30, 2006 Share Posted December 30, 2006 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
driver2 Posted January 1, 2007 Share Posted January 1, 2007 The problem is, you don't know which map is a DM map. You would have to make a list of all DM maps. Or at least check if someone respawns before the map ends. Link to comment
BetaDevil Posted January 1, 2007 Share Posted January 1, 2007 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
driver2 Posted January 2, 2007 Share Posted January 2, 2007 As the endrace event is practically the same as the startrace event, you should check it at every death event. Link to comment
Keslertje2005 Posted January 4, 2007 Share Posted January 4, 2007 I dont get it... Could someone explain it further? Thank you , I have put it in the script at the bottom with all the other on signal commands... I already changed end race in death but it still doesnt work.. Does anyone know why? Link to comment
SamB Posted January 9, 2007 Share Posted January 9, 2007 mta.endrace is called when theres only one person left surviving. so just do what you want in there. Link to comment
Keslertje2005 Posted January 9, 2007 Share Posted January 9, 2007 (edited) I made this one, it is almost workin.. It gives you a win point, and freezes the winning player so he wont get a death point. But its not working on everybody.. What did I do wrong? Edited January 10, 2007 by Guest Link to comment
Aeron Posted January 10, 2007 Share Posted January 10, 2007 I think I commented out the mta.endrace event triggering on DM-maps, i'm sure you can find it yourself in mta.mrc. Edit I did: search for ''/* Unable to detect" and remove the comment-markings and it *MIGHT* work. Link to comment
BetaDevil Posted January 10, 2007 Share Posted January 10, 2007 No, I already tried that... Link to comment
SanZoR.Sr Posted January 18, 2007 Share Posted January 18, 2007 So... what is missed word? I have too own DM (DD) Server, so i need this script too =D Link to comment
SamB Posted January 18, 2007 Share Posted January 18, 2007 at the start of it you get the number of players ingame. keep doing a check every 1 second to see how many people are dead using while(). When only 1 person is alive, reward him/her. Link to comment
Raoul Posted January 18, 2007 Share Posted January 18, 2007 But when someone is still respawing he is considered dead but is still in the race... Link to comment
SamB Posted January 18, 2007 Share Posted January 18, 2007 dm maps usually dont have a respawn. Link to comment
BetaDevil Posted January 18, 2007 Share Posted January 18, 2007 well, on this moment I think it is possible on many ways, but on all ways it is very buggy. Link to comment
Robix Posted January 18, 2007 Share Posted January 18, 2007 dm maps usually dont have a respawn. Are you shure? Link to comment
Keslertje2005 Posted January 18, 2007 Share Posted January 18, 2007 I have the scripts almost workin... I only have problems with ID's.. ID 0 always get freezed, but the other ones sometimes doesnt... Still searching for the problem Link to comment
SamB Posted January 18, 2007 Share Posted January 18, 2007 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
BetaDevil Posted January 19, 2007 Share Posted January 19, 2007 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
lil Toady Posted January 19, 2007 Share Posted January 19, 2007 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
BetaDevil Posted January 19, 2007 Share Posted January 19, 2007 ah right, well I made a big mistake there. He returns nothing if you're alive. I never heard of !halt but it seems good and I forgot !inc %a Link to comment
Keslertje2005 Posted January 19, 2007 Share Posted January 19, 2007 Ive got a deathmatch server, but lil's script isnt workin on my server ... 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
BetaDevil Posted January 20, 2007 Share Posted January 20, 2007 [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
Recommended Posts