Jump to content

Tournament


thestrangestick

Recommended Posts

I would like a script for PRS where it tallies up the wins of the last maps (user definable) and whoever gets the most combined wins gets added as an admin, level 1 (unless they are already an admin). It would only be able to be implemented by level 5 admins, and the command would work like this !tournament 7 [tournament over 7 maps] !tournament 5 [over 5 maps] etc.

If it is a draw then no-one gets admin. Bear in mind that I have changed pRS default so that all maps are set as Dm default. (I have a Dm server) Thanks.

First person to do this will of course become FriendOfServer (level 1) on my server. :D . Good luck guys!

thestrangestick

Link to comment

U could have asked in the prs topic...

on *:SIGNAL:mta.command: { 
  if ($3 == !tournament) { 
    if ($prs.level($1,$2) != 5) mta.pm $1 $2 Error: Level 5 Command! 
    elseif ($4 !isnum) mta.pm $1 $2 Error: !tournament <number of rounds> 
    else { 
      !hadd prstemp tourneyrounds $4 
      mta.text $1 Tournament Will Start On Next Map, For $4 $iif($4 == 1,Round,Rounds) 
    } 
  } 
} 
on *:SIGNAL:mta.startrace: { 
  if ($hget(prstemp,tourneyrounds) != $null) mta.text $1 Tournament Rounds Remainding: $hget(prstemp,tourneyrounds) 
} 
on *:SIGNAL:prs.endrace: { 
  if ($hget(prstemp,tourneyrounds) != $null) { 
    !hadd prstemp tourneypoints $+ $mta.nick($1,$2) $calc($hget(prstemp,tourneypoints $+ $mta.nick($1,$2)) + 1) 
    mta.text $1 Tournament Point Goes To $mta.nick($1,$2) $+ ! - Total: $hget(prstemp,tourneypoints $+ $mta.nick($1,$2)) 
    !hdec prstemp tourneyrounds 1 
    if ($hget(prstemp,tourneyrounds) == 0) prs.tourneyfinish $1- 
  } 
} 
alias prs.tourneyfinish { 
  var %a = 0, %c = 0,%d 
  while (%a < %loop) { 
    if ($mta.nick($1,%a) != $null) { 
      var %b == $hget(prstemp,tourneypoints $+ $mta.nick($1,%a)) 
      if (%b > %c) { 
        %c = $mta.nick($1,%a)  
        %d = %b 
      } 
    } 
    !inc %a 
  } 
  var %a = 0, %b, %e = 0 
  while (%a < %loop) { 
    %b == $hget(prstemp,tourneypoints $+ $mta.nick($1,%a)) 
    if ((%b == %d) && (%c != $mta.nick($1,%a))) { 
      %e = 1 
      %c == %c $mta.nick($1,%a) 
    } 
    !inc %a 
  } 
  if (%e == 1) mta.text $1 Its A Draw With %d Points: %c 
  else mta.text $1 Tournament Winner With %d Points: %c 
  !hdel -w prstemp tourney 
} 

ok so i havent tested this, and its not completeley finished, but u can try it out and let me know what happens before i add the adding FOS's to the winner part.

sorry i couldnt test it but i read ur post and though noone else would probably even attempt to make this for u, it may have a few bugs so this might take a few attempts :mrgreen:

it should work, as in start the tourney for the # of maps, then show the winner, or show winners if its a draw.

just create a new .mrc script and paste this in. run it as a seperate script.

Link to comment

OMG I love you. Level one on my server, anytime. I shall test this. Thanks.

And I didn't ask in PRS becuase I'm sure you could easily make this for GUS, so everyone can enjoy. Thanks tho.

And if this wouldn't be too difficult to add, could you make it so you can say !tournament [no. of maps] [win money/ win admin lvl 1]

ie !tournament 6 admin

!tournament 5 money

Thanks.

And I know you've done so much for me but I need another script doing - sanzor started but no offense to him, he doesn't finish many scripts. I am so desperate for this script now that I would pay you for this (and maybe it could be exclusive?) viewtopic.php?f=30&t=20277

If you don't wanna then that's fine.

Link to comment

ok seems i cant edit my post, so here it is again with a few changes.

ive added some checks and commands so u can tell me what it is or isnt doing a little better.

on *:SIGNAL:mta.command: { 
  if ($3 == !tournament) { 
    if ($prs.level($1,$2) != 5) mta.pm $1 $2 Error: Level 5 Command! 
    elseif ($4 == off) { 
      mta.text $1 Tournament Stopped! 
      !hdel -w prstemp tourney* 
    } 
    elseif ($4 !isnum) mta.pm $1 $2 Error: !tournament <number of rounds> 
    elseif ($hget(prstemp,tourneyrounds) != $null) mta.pm $1 $2 Error: Tournament In Progress! 
    else { 
      !hadd prstemp tourneyrounds $4 
      mta.text $1 Tournament Will Start On Next Map, For $4 $iif($4 == 1,Round,Rounds) 
    } 
  } 
  elseif ($3 == !rounds) { 
    if ($hget(prstemp,tourneyrounds) == $null) mta.pm $1 $2 Error: No Tournament In Progress!  
    else mta.text $1 Tournament Rounds Left: $hget(prstemp,tourneyrounds) 
  } 
} 
on *:SIGNAL:mta.startrace: { 
  if ($hget(prstemp,tourneyrounds) != $null) mta.text $1 Tournament Rounds Remainding: $hget(prstemp,tourneyrounds) 
} 
on *:SIGNAL:prs.endrace: { 
  if ($hget(prstemp,tourneyrounds) != $null) { 
    var %a = $mta.nick($1,$2) 
    !hadd prstemp tourneypoints $+ %a $calc($hget(prstemp,tourneypoints $+ %a) + 1) 
    mta.text $1 Tournament Point Goes To %a $+ ! - Total: $hget(prstemp,tourneypoints $+ %a) 
    !hadd prstemp tourneyrounds $calc($hget(prstemp,tourneyrounds) - 1) 
    if ($hget(prstemp,tourneyrounds) == 0) { 
      mta.text $1 Counting Tournament Scores.... 
      .timer 1 5 prs.tourneyfinish $1- 
    } 
  } 
} 
alias prs.tourneyfinish { 
  var %a = 0, %c = 0,%d 
  while (%a < %loop) { 
    if ($mta.nick($1,%a) != $null) { 
      var %b == $hget(prstemp,tourneypoints $+ $mta.nick($1,%a)) 
      if (%b > %c) { 
        %c = $mta.nick($1,%a) 
        %d = %b 
      } 
    } 
    !inc %a 
  } 
  var %a = 0, %b, %e = 0 
  while (%a < %loop) { 
    %b == $hget(prstemp,tourneypoints $+ $mta.nick($1,%a)) 
    if ((%b == %d) && (%c != $mta.nick($1,%a))) { 
      %e = 1  
      %c == %c $mta.nick($1,%a) 
    } 
    !inc %a 
  } 
  if (%e == 1) mta.text $1 Its A Draw With %d Points: %c 
  else mta.text $1 Tournament Winner With %d Points: %c 
  !hdel -w prstemp tourney* 
} 

Link to comment

Ok its all good, could you add the money win feature (not admin anymore, I merged with a server so its inappropriate) and would it be difficult to make it for GUS? I'm sorry but the new server guys prefer gus (I have complained about it but no luck)

Also, could you please consider making the above admins versus player script (for GUS but it would be simpler because it would just be for dm ( ie last man standing)

(Once again, thanks for the enormous help and expertise you give to the add on community)

Link to comment
Lagzilla is trying to make it compatible... why can't it be done? (I don't want him to try if it takes forever)

I can't beleive someone on this forum won't make an admins versus player script for me, even if I paid em! :(

i didnt say it couldnt be done... i wrote this in about 5-10 mins^ it would be quicker to just rewrite it for GUS than trying to edit and make it work for GUS either way its not a big job, also it would depend on ur version of GUS, in the versions ive seen there's no DM mode, and No hashes.

It could be made to work, the hashes would need to be either 'made' or converted to INI's

also some way of sending the winning ID to the alias.

works good ... thanx ...

any probs at all just repost here and i'll fix them, since i didnt test the script

Link to comment

ok try this, i found a few bugs :lol:

on *:SIGNAL:mta.command: { 
  if ($3 == !tournament) { 
    if ($prs.level($1,$2) != 5) mta.pm $1 $2 Error: Level 5 Command! 
    elseif ($4 == off) { 
      mta.text $1 Tournament Stopped! 
      !hdel -w prstemp tourney* 
    } 
    elseif ($4 !isnum) mta.pm $1 $2 Error: !tournament <number of rounds> 
    elseif ($hget(prstemp,tourneyrounds) != $null) mta.pm $1 $2 Error: Tournament In Progress! 
    else { 
      !hadd prstemp tourneyrounds $4 
      mta.text $1 Tournament Will Start On Next Map, For $4 $iif($4 == 1,Round,Rounds) 
    } 
  } 
  elseif ($3 == !rounds) { 
    if ($hget(prstemp,tourneyrounds) == $null) mta.pm $1 $2 Error: No Tournament In Progress!  
    else mta.text $1 Tournament Rounds Left: $hget(prstemp,tourneyrounds) 
  } 
  elseif ($3 == !tpoints) mta.text $1 $mta.nick($1,$2) $+ 's Points $hget(prstemp,tourneypoints $+ $mta.nick($1,$2)) 
} 
on *:SIGNAL:mta.startrace: { 
  if ($hget(prstemp,tourneyrounds) != $null) mta.text $1 Tournament Rounds Remainding: $hget(prstemp,tourneyrounds) 
} 
on *:SIGNAL:prs.endrace: { 
  if ($hget(prstemp,tourneyrounds) != $null) { 
    var %a = $mta.nick($1,$2) 
    !hadd prstemp tourneypoints $+ %a $calc($hget(prstemp,tourneypoints $+ %a) + 1) 
    mta.text $1 Tournament Point Goes To %a $+ ! - Total: $hget(prstemp,tourneypoints $+ %a) 
    !hadd prstemp tourneyrounds $calc($hget(prstemp,tourneyrounds) - 1) 
    if ($hget(prstemp,tourneyrounds) == 0) { 
      mta.text $1 Counting Tournament Scores.... 
      .timer 1 5 prs.tourneyfinish $1- 
    } 
  } 
} 
alias prs.tourneyfinish { 
  var %a = 0, %b, %c = 0, %d 
  while (%a < %loop) { 
    if ($mta.nick($1,%a) != $null) { 
      %b == $hget(prstemp,tourneypoints $+ $mta.nick($1,%a)) 
      if (%b > %c) { 
        %d = $mta.nick($1,%a)  
        %c = %b 
      } 
    } 
    !inc %a 
  } 
  var %a = 0, %b, %e = 0 
  while (%a < %loop) { 
    %b == $hget(prstemp,tourneypoints $+ $mta.nick($1,%a)) 
    if ((%b == %c) && (%d != $mta.nick($1,%a))) { 
      %e = 1 
      %d = %d $mta.nick($1,%a) 
    } 
    !inc %a 
  } 
  if (%e == 1) mta.text $1 Its A Draw With %c Points: %d 
  else mta.text $1 Tournament Winner With %c  Points: %d 
  !hdel -w prstemp tourney* 
} 

Link to comment
  • 4 weeks later...

on *:SIGNAL:mta.command: { 
  if ($3 == !tournament) { 
    if ($prs.level($1,$2) != 5) mta.pm $1 $2 Error: Level 5 Command! 
    elseif ($4 == off) { 
      mta.text $1 Tournament Stopped! 
      !hdel -w prstemp tourney* 
    } 
    elseif ($4 !isnum) mta.pm $1 $2 Error: !tournament <number of rounds> 
    elseif ($hget(prstemp,tourneyrounds) != $null) mta.pm $1 $2 Error: Tournament In Progress! 
    else { 
      !hadd prstemp tourneyrounds $4 
      mta.text $1 Tournament Will Start On Next Map, For $4 $iif($4 == 1,Round,Rounds) 
    } 
  } 
  elseif ($3 == !rounds) { 
    if ($hget(prstemp,tourneyrounds) == $null) mta.pm $1 $2 Error: No Tournament In Progress!  
    else mta.text $1 Tournament Rounds Left: $hget(prstemp,tourneyrounds) 
  } 
  elseif ($3 == !tpoints) mta.text $1 $mta.nick($1,$2) $+ 's Points $hget(prstemp,tourneypoints $+ $mta.nick($1,$2)) 
} 
on *:SIGNAL:mta.startrace: { 
  if ($hget(prstemp,tourneyrounds) != $null) mta.text $1 Tournament Rounds Remainding: $hget(prstemp,tourneyrounds) 
} 
on *:SIGNAL:prs.endrace: { 
  if ($hget(prstemp,tourneyrounds) != $null) { 
    var %a = $mta.nick($1,$2) 
    !hadd prstemp tourneypoints $+ %a $calc($hget(prstemp,tourneypoints $+ %a) + 1) 
    mta.text $1 Tournament Point Goes To %a $+ ! - Total: $hget(prstemp,tourneypoints $+ %a) 
    !hadd prstemp tourneyrounds $calc($hget(prstemp,tourneyrounds) - 1) 
    if ($hget(prstemp,tourneyrounds) == 0) { 
      mta.text $1 Counting Tournament Scores.... 
      .timer 1 5 prs.tourneyfinish $1- 
    } 
  } 
} 
alias prs.tourneyfinish { 
  var %a = 0, %b, %c = 0, %d 
  while (%a < %loop) { 
    if ($mta.nick($1,%a) != $null) { 
      %b = $hget(prstemp,tourneypoints $+ $mta.nick($1,%a)) 
      if (%b > %c) { 
        %d = $mta.nick($1,%a)  
        %c = %b 
      } 
    } 
    !inc %a 
  } 
  var %a = 0, %b, %e = 0 
  while (%a < %loop) { 
    %b = $hget(prstemp,tourneypoints $+ $mta.nick($1,%a)) 
    if ((%b == %c) && (%d != $mta.nick($1,%a))) { 
      %e = 1 
      %d = %d $mta.nick($1,%a) 
    } 
    !inc %a 
  } 
  if (%e == 1) mta.text $1 Its A Draw With %c Points: %d 
  else mta.text $1 Tournament Winner With %c  Points: %d 
  !hdel -w prstemp tourney* 
} 
  

sorry, i havent got round to even trying the script, try this one tho, fixed a bug :mrgreen:

Link to comment
  • Recently Browsing   0 members

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