[Server Scripting] Current Pokémon Online Server Scripts

Discussion in 'Server and Client Scripting' started by coyotte508, Apr 21, 2010.

  1. Kake12321

    Kake12321 New Member

    Joined:
    Oct 25, 2010
    Messages:
    5
    Likes Received:
    0
    Still wont work and it has teh same message
     
  2. meztips

    meztips The name is Bond.

    Joined:
    Jun 4, 2010
    Messages:
    392
    Likes Received:
    0
    Are you using the correct server application? You might still be using the same one you were before. Make sure you're using the new one, and it should work.
     
  3. Kake12321

    Kake12321 New Member

    Joined:
    Oct 25, 2010
    Messages:
    5
    Likes Received:
    0
    Thank you! I finally got it working! Thank you Mez for your patience with me!
     
  4. meztips

    meztips The name is Bond.

    Joined:
    Jun 4, 2010
    Messages:
    392
    Likes Received:
    0
    Not a problem. :)
     
  5. ladysalamence

    ladysalamence Member

    Joined:
    Aug 3, 2010
    Messages:
    368
    Likes Received:
    0
    Err... Shouldn't this be a sticky?
     
  6. Daniel M.

    Daniel M. New Member

    Joined:
    Dec 25, 2010
    Messages:
    9
    Likes Received:
    0
    What is the command to create a championship?
     
  7. nesan

    nesan Love is blind

    Joined:
    Jun 13, 2010
    Messages:
    241
    Likes Received:
    0
    A tournament?

    it's

    !tour OverUsed*12

    OverUsed can be replaced with any tier and 12 can be replaced with the number of entrants you want.
     
  8. Daniel M.

    Daniel M. New Member

    Joined:
    Dec 25, 2010
    Messages:
    9
    Likes Received:
    0
    When I put "/tour Challenge Cup*10" this message appears "You must Specify a tournament size of three or more." and will not. What do I do?
     
  9. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Yeah
    That's because it's /tour challenge cup:10
    Replace the * with a :
     
  10. Daniel M.

    Daniel M. New Member

    Joined:
    Dec 25, 2010
    Messages:
    9
    Likes Received:
    0
    Thanks. One more doubt: When I close the program from the server the server of the game disappears. what I do I always get the server online?

    Edit:
    When I enter the server IP by appearing on "Error while connected to server - error number 0 Received: Connection refused ".
     
  11. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    You have to keep the server program running constantly, or use a dedicated host for the server. (Google)
     
  12. Daniel M.

    Daniel M. New Member

    Joined:
    Dec 25, 2010
    Messages:
    9
    Likes Received:
    0
    How do I leave it open with a dedicated host for the server?
     
  13. Slipperjeans

    Slipperjeans Loose pants

    Joined:
    Jun 27, 2010
    Messages:
    448
    Likes Received:
    0
    Hosts dedicados custam dinheiro e nao vale a pena pra um server pequeno
    o que vc tem que fazer é deixar o programa server.exe rodando, se vc fechar ele, o seu server vai fechar
     
  14. Lady Umb

    Lady Umb 寅丸 星

    Joined:
    Aug 5, 2010
    Messages:
    309
    Likes Received:
    1
    Just leave the server window opened
    Even if you close the ultravnc/NX window, the server is still hosted

    But I think Slipper explained to you in Spanish :O
     
    Last edited: Dec 27, 2010
  15. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Cleared up off topic posts...
     
  16. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Updated scripts
    Also sticking
     
  17. ÐâÑîe

    ÐâÑîe New Member

    Joined:
    Jan 11, 2011
    Messages:
    25
    Likes Received:
    0
    How can I insert characters like [ ] in the scripts for mafia?
     
    Last edited: Jan 31, 2011
  18. Gio96b

    Gio96b New Member

    Joined:
    Feb 6, 2011
    Messages:
    8
    Likes Received:
    0
    Someon can post only the script of the tournaments? I translate them and do not understand what are those of the tournament

    PS: Sorry for my english, i'm italian.
     
  19. orioltron

    orioltron New Member

    Joined:
    Feb 6, 2011
    Messages:
    2
    Likes Received:
    0
    please help, when I put the script I get this error: S

    Fatal Script Error line 1943: SyntaxError: Parse error


    someone could tell me error?

    thanks
     
  20. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Weird, I don't get that error, but I'm going to update the scripts now, maybe that will help.
     
  21. orioltron

    orioltron New Member

    Joined:
    Feb 6, 2011
    Messages:
    2
    Likes Received:
    0
    thanks, the error no longer exists
     
  22. ÐâÑîe

    ÐâÑîe New Member

    Joined:
    Jan 11, 2011
    Messages:
    25
    Likes Received:
    0
    THe scripts are deleted -.-
     
  23. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Sorry, it was linking to an old pastebin for some reason, yet the actual text was the new link... I hate this advanced editor sometimes :x
     
  24. Gio96b

    Gio96b New Member

    Joined:
    Feb 6, 2011
    Messages:
    8
    Likes Received:
    0
    Someone can post only the script of the tournaments? I translate them and do not understand what are those of the tournament

    PS: Sorry for my english, i'm italian.
     
    Last edited by a moderator: Feb 7, 2011
  25. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    It's a sticky... please don't up it...
    Anyways, this should be everything
    [SECRET]
    Code JAVASCRIPT:
    tourmode = 0; //variable needed to be declared
    if (sys.existChannel("Tournaments")) {
    tourchannel = sys.channelId("Tournaments");
    } else {
    tourchannel = sys.createChannel("Tournaments");
    }
    permChannels[tourchannel] = true;

    //channel needed to be made
    if (tourmode == 1){
    sys.sendMessage(src,"*** A " + tourtier + " tournament is in its signup phase, " + this.tourSpots() + " space(s) are left!");
    sys.sendMessage(src, "");
    sys.sendMessage(src, border);
    sys.sendMessage(src, "");

    } else if (tourmode == 2){
    sys.sendMessage(src, "");
    sys.sendMessage(src, border);
    sys.sendMessage(src, "");
    sys.sendMessage(src, "~~Server~~: A tournament (" + tourtier + ") is currently running.");
    sys.sendMessage(src, "");
    sys.sendMessage(src, border);
    sys.sendMessage(src, "");
    }
    //afterLogIn
    if (command == "unjoin") {
    if (tourmode == 0) {
    sendChanMessage(src, "+TourneyBot: Wait till the tournament has started.");
    return;
    }
    var name2 = sys.name(src).toLowerCase();

    if (tourmembers.indexOf(name2) != -1) {
    tourmembers.splice(tourmembers.indexOf(name2),1);
    delete tourplayers[name2];
    sys.sendAll("+TourneyBot: " + sys.name(src) + " left the tournament!", tourchannel);
    return;
    }
    if (tourbattlers.indexOf(name2) != -1) {
    battlesStarted[Math.floor(tourbattlers.indexOf(name2)/2)] = true;
    sys.sendAll("+TourneyBot: " + sys.name(src) + " left the tournament!", tourchannel);
    this.tourBattleEnd(this.tourOpponent(name2), name2);
    }
    return;
    }
    if (command == "join"){
    if (!sys.isInChannel(src, tourchannel)) {
    sendChanMessage(src, "+TourBot: You must be in the tournaments channel to join a tournament!");
    return;
    }
    if (tourmode != 1){
    sendChanMessage(src, "Sorry, you are unable to join because a tournament is not currently running or has passed the signups phase.");
    return;
    }
    var name = sys.name(src).toLowerCase();
    if (tourmembers.indexOf(name.toLowerCase()) != -1){
    sendChanMessage(src, "Sorry, you are already in the tournament. You are not able to join more than once.");
    return;
    }
    var srctier = sys.tier(src);
    if (!cmp(srctier, tourtier)){
    sendChanMessage(src, "You are currently not battling in the " + tourtier + " tier. Change your tier to " + tourtier + " to be able to join.");
    return;
    }
    if (this.tourSpots() > 0){
    tourmembers.push(name);
    tourplayers[name] = sys.name(src);
    sys.sendAll("~~Server~~: " + sys.name(src) + " joined the tournament! " + this.tourSpots() + " more spot(s) left!", tourchannel);
    if (this.tourSpots() == 0){
    tourmode = 2;
    roundnumber = 0;
    this.roundPairing();
    }
    }
    return;
    }
    if (command == "viewround"){
    if (tourmode != 2){
    sendChanMessage(src, "Sorry, you are unable to view the round because a tournament is not currently running or is in signing up phase.");
    return;
    }

    sendChanMessage(src, "");
    sendChanMessage(src, border);
    sendChanMessage(src, "");
    sendChanMessage(src, "*** ROUND " + roundnumber + " OF " + tourtier.toUpperCase() + " TOURNAMENT ***");

    if (battlesLost.length > 0) {
    sendChanMessage(src, "");
    sendChanMessage(src, "*** Battles finished ***");
    sendChanMessage(src, "");
    for (var i = 0; i < battlesLost.length; i+=2) {
    sendChanMessage(src, battlesLost[i] + " won against " + battlesLost[i+1]);
    }
    sendChanMessage(src, "");
    }

    if (tourbattlers.length > 0) {
    if (battlesStarted.indexOf(true) != -1) {
    sendChanMessage(src, "", channel);
    sendChanMessage(src, "*** Ongoing battles ***");
    sendChanMessage(src, "");
    for (var i = 0; i < tourbattlers.length; i+=2) {
    if (battlesStarted [i/2] == true)
    sendChanMessage(src, this.padd(tourplayers[tourbattlers[i]]) + " VS " + tourplayers[tourbattlers[i+1]]);
    }
    sendChanMessage(src, "");
    }
    if (battlesStarted.indexOf(false) != -1) {
    sendChanMessage(src, "");
    sendChanMessage(src, "*** Yet to start battles ***");
    sendChanMessage(src, "");
    for (var i = 0; i < tourbattlers.length; i+=2) {
    if (battlesStarted [i/2] == false)
    sendChanMessage(src, tourplayers[tourbattlers[i]] + " VS " + tourplayers[tourbattlers[i+1]]);
    }
    sendChanMessage(src, "");
    }
    }

    if (tourmembers.length > 0) {
    sendChanMessage(src, "");
    sendChanMessage(src, "*** Members to the next round ***");
    sendChanMessage(src, "");
    var str = "";

    for (x in tourmembers) {
    str += (str.length == 0 ? "" : ", ") + tourplayers[tourmembers[x]];
    }
    sendChanMessage(src, str);
    sendChanMessage(src, "");
    }

    sendChanMessage(src, border);
    sendChanMessage(src, "");

    return;
    }
    //commands for normal users
    if (command == "dq") {
    if (tourmode == 0) {
    sendChanMessage(src, "+TourneyBot: Wait till the tournament has started.");
    return;
    }
    var name2 = commandData.toLowerCase();

    if (tourmembers.indexOf(name2) != -1) {
    tourmembers.splice(tourmembers.indexOf(name2),1);
    delete tourplayers[name2];
    sys.sendAll("+TourneyBot: " + commandData + " was removed from the tournament by " + sys.name(src) + "!", tourchannel);
    return;
    }
    if (tourbattlers.indexOf(name2) != -1) {
    battlesStarted[Math.floor(tourbattlers.indexOf(name2)/2)] = true;
    sys.sendAll("+TourneyBot: " + commandData + " was removed from the tournament by " + sys.name(src) + "!", tourchannel);
    this.tourBattleEnd(this.tourOpponent(name2), name2);
    }
    return;
    }
    if (command == "push") {
    if (tourmode == 0) {
    sendChanMessage(src, "+TourneyBot: Wait untill the tournament has started.");
    return;
    }
    if (this.isInTourney(commandData.toLowerCase())) {
    sendChanMessage(src, "+TourneyBot: " +commandData + " is already in the tournament.");
    return;
    }
    if (tourmode == 2) {
    sys.sendAll("+TourneyBot: " +commandData + " was added to the tournament by " + sys.name(src) + ".", tourchannel);
    tourmembers.push(commandData.toLowerCase());
    tourplayers[commandData.toLowerCase()] = commandData;
    }
    if (tourmode == 1) {
    tourmembers.push(commandData.toLowerCase());
    tourplayers[commandData.toLowerCase()] = commandData;
    sys.sendAll("+TourneyBot: " +commandData + " was added to the tournament by " + sys.name(src) + ". " + this.tourSpots() + " more spot(s) left!", tourchannel);

    }
    if (tourmode == 1 && this.tourSpots() == 0) {
    tourmode = 2;
    roundnumber = 0;
    this.roundPairing();
    }
    return;
    }
    if (command == "cancelbattle") {
    if (tourmode != 2) {
    sendChanMessage(src, "Wait until a tournament starts");
    return;
    }
    var name = commandData.toLowerCase();

    if (tourbattlers.indexOf(name) != -1) {
    battlesStarted[Math.floor(tourbattlers.indexOf(name)/2)] = false;
    sendChanMessage(src, "+TourBot: " + commandData + " can forfeit their battle and rematch now.");
    }

    return;
    }
    if (command == "sub") {
    if (tourmode != 2) {
    sendChanMessage(src, "Wait until a tournament starts");
    return;
    }
    var players = commandData.split(':');

    if (!this.isInTourney(players[0]) && !this.isInTourney(players[1])) {
    sendChanMessage(src, "+TourBot: Neither are in the tourney.");
    return;
    }
    sys.sendAll("+TourBot: " + players[0] + " and " + players[1] + " were exchanged places in the ongoing tournament by " + sys.name(src) + ".", tourchannel);

    var p1 = players[0].toLowerCase();
    var p2 = players[1].toLowerCase();

    for (x in tourmembers) {
    if (tourmembers[x] == p1) {
    tourmembers[x] = p2;
    } else if (tourmembers[x] == p2) {
    tourmembers[x] = p1;
    }
    }
    for (x in tourbattlers) {
    if (tourbattlers[x] == p1) {
    tourbattlers[x] = p2;
    battlesStarted[Math.floor(x/2)] = false;
    } else if (tourbattlers[x] == p2) {
    tourbattlers[x] = p1;
    battlesStarted[Math.floor(x/2)] = false;
    }
    }

    if (!this.isInTourney(p1)) {
    tourplayers[p1] = players[0];
    delete tourplayers[p2];
    } else if (!this.isInTourney(p2)) {
    tourplayers[p2] = players[1];
    delete tourplayers[p1];
    }

    return;
    }
    if (command == "tour"){
    if (typeof(tourmode) != "undefined" && tourmode > 0){
    sendChanMessage(src, "Sorry, you are unable to start a tournament because one is still currently running.");
    return;
    }

    if (commandData.indexOf(':') == -1)
    commandpart = commandData.split(' ');
    else
    commandpart = commandData.split(':');

    tournumber = parseInt(commandpart[1]);

    if (isNaN(tournumber) || tournumber <= 2){
    sendChanMessage(src, "You must specify a tournament size of 3 or more.");
    return;
    }

    var tier = sys.getTierList();
    var found = false;
    for (var x in tier) {
    if (cmp(tier[x], commandpart[0])) {
    tourtier = tier[x];
    found = true;
    break;
    }
    }
    if (!found) {
    sendChanMessage(src, "Sorry, the server does not recognise the " + commandpart[0] + " tier.");
    return;
    }

    tourmode = 1;
    tourmembers = [];
    tourbattlers = [];
    tourplayers = [];
    battlesStarted = [];
    battlesLost = [];

    var chans = [0, tourchannel];

    for (var x in chans) {
    var y = chans[x];
    sys.sendAll("", y);
    sys.sendAll(border, y);
    sys.sendAll("*** A Tournament was started by " + sys.name(src) + "! ***", y);
    sys.sendAll("PLAYERS: " + tournumber, y);
    sys.sendAll("TYPE: Single Elimination", y);
    sys.sendAll("TIER: " + tourtier, y);
    sys.sendAll("", y);
    sys.sendAll("*** Go in the Tournaments channel and type /join or !join to enter the tournament! ***", y);
    sys.sendAll(border, y);
    sys.sendAll("", y);
    }
    return;
    }

    if (command == "changecount") {
    if (tourmode != 1) {
    sendChanMessage(src, "Sorry, you are unable to join because the tournament has passed the sign-up phase.");
    return;
    }
    var count = parseInt(commandData);

    if (isNaN(count) || count < 3) {
    return;
    }

    if (count < tourmembers.length) {
    sendChanMessage(src, "There are more than that people registered");
    return;
    }

    tournumber = count;

    sys.sendAll("", tourchannel);
    sys.sendAll(border, tourchannel);
    sys.sendAll("~~Server~~: " + sys.name(src) + " changed the numbers of entrants to " + count + "!", tourchannel);
    sys.sendAll("*** " + this.tourSpots() + " more spot(s) left!", tourchannel);
    sys.sendAll(border, tourchannel);
    sys.sendAll("", tourchannel);

    if (this.tourSpots() == 0 ){
    tourmode = 2;
    roundnumber = 0;
    this.roundPairing();
    }

    return;
    }
    if (command == "endtour"){
    if (tourmode != 0){
    tourmode = 0;
    sys.sendAll("", tourchannel);
    sys.sendAll(border, tourchannel);
    sys.sendAll("~~Server~~: The tournament was cancelled by " + sys.name(src) + "!", tourchannel);
    sys.sendAll(border, tourchannel);
    sys.sendAll("", tourchannel);
    }else
    sendChanMessage(src, "Sorry, you are unable to end a tournament because one is not currently running.");
    return;
    }
    //commands for tour auth
    tourSpots : function() {
    return tournumber - tourmembers.length;
    }
    ,
    roundPairing : function() {
    roundnumber += 1;

    battlesStarted = [];
    tourbattlers = [];
    battlesLost = [];

    if (tourmembers.length == 1) {
    var chans = [0, tourchannel];

    for (x in chans) {
    var tchan = chans[x];
    sys.sendAll("", tchan);
    sys.sendAll(border, tchan);
    sys.sendAll("", tchan);
    sys.sendAll("THE WINNER OF THE TOURNAMENT IS : " + tourplayers[tourmembers[0]], tchan);
    sys.sendAll("", tchan);
    sys.sendAll("*** Congratulations, " + tourplayers[tourmembers[0]] + ", on your success! ***", tchan);
    sys.sendAll("", tchan);
    sys.sendAll(border, tchan);
    sys.sendAll("", tchan);
    }
    tourmode = 0;
    return;
    }

    var finals = tourmembers.length == 2;

    if (!finals) {
    sys.sendAll("", tourchannel);
    sys.sendAll(border, tourchannel);
    sys.sendAll("*** Round " + roundnumber + " of " + tourtier + " tournament ***", tourchannel);
    sys.sendAll("", tourchannel);
    }
    else {
    sys.sendAll("", tourchannel);
    sys.sendAll(border, tourchannel);
    sys.sendAll("*** FINALS OF " + tourtier.toUpperCase() + " TOURNAMENT ***", tourchannel);
    sys.sendAll("", tourchannel);
    sys.sendAll("", 0);
    sys.sendAll(border, 0);
    sys.sendAll("*** FINALS OF " + tourtier.toUpperCase() + " TOURNAMENT ***", 0);
    sys.sendAll("", 0);
    }

    var i = 0;
    while (tourmembers.length >= 2) {
    i += 1;
    var x1 = sys.rand(0, tourmembers.length);
    tourbattlers.push(tourmembers[x1]);
    var name1 = tourplayers[tourmembers[x1]];
    tourmembers.splice(x1,1);


    x1 = sys.rand(0, tourmembers.length);
    tourbattlers.push(tourmembers[x1]);
    var name2 = tourplayers[tourmembers[x1]];
    tourmembers.splice(x1,1);

    battlesStarted.push(false);

    if (!finals)
    sys.sendAll (i + "." + this.padd(name1) + " VS " + name2, tourchannel);
    else {
    sys.sendAll (" " + this.padd(name1) + " VS " + name2, tourchannel);
    sys.sendAll (" " + this.padd(name1) + " VS " + name2, 0);
    }
    }

    if (tourmembers.length > 0) {
    sys.sendAll ("", tourchannel);
    sys.sendAll ("*** " + tourplayers[tourmembers[0]] + " is randomly selected to go to next round!", tourchannel);
    }

    sys.sendAll(border, tourchannel);
    sys.sendAll("", tourchannel);
    if (finals) {
    sys.sendAll(border, 0);
    sys.sendAll("", 0);
    }
    }

    ,

    padd : function(name) {
    var ret = name;

    while (ret.length < 20) ret = ' ' + ret;

    return ret;
    }
    ,
    isInTourney : function (name) {
    var name2 = name.toLowerCase();
    return name2 in tourplayers;
    }

    ,

    tourOpponent : function (nam) {
    var name = nam.toLowerCase();

    var x = tourbattlers.indexOf(name);

    if (x != -1) {
    if (x % 2 == 0) {
    return tourbattlers[x+1];
    } else {
    return tourbattlers[x-1];
    }
    }

    return "";
    }

    ,

    areOpponentsForTourBattle : function(src, dest) {
    return this.isInTourney(sys.name(src)) && this.isInTourney(sys.name(dest)) && this.tourOpponent(sys.name(src)) == sys.name(dest).toLowerCase();
    }
    ,

    areOpponentsForTourBattle2 : function(src, dest) {
    return this.isInTourney(src) && this.isInTourney(dest) && this.tourOpponent(src) == dest.toLowerCase();
    }
    ,

    ongoingTourneyBattle : function (name) {
    return tourbattlers.indexOf(name.toLowerCase()) != -1 && battlesStarted[Math.floor(tourbattlers.indexOf(name.toLowerCase())/2)] == true;
    }

    ,

    afterBattleStarted: function(src, dest) {
    if (tourmode == 2) {
    if (this.areOpponentsForTourBattle(src, dest)) {
    if (sys.tier(src) == sys.tier(dest) && cmp(sys.tier(src), tourtier))
    battlesStarted[Math.floor(tourbattlers.indexOf(sys.name(src).toLowerCase())/2)] = true;
    }
    }
    }

    ,

    afterBattleEnded : function(src, dest, desc) {
    if (tourmode != 2 ||desc == "tie")
    return;
    this.tourBattleEnd(sys.name(src), sys.name(dest));
    }

    ,

    tourBattleEnd : function(src, dest)
    {
    if (!this.areOpponentsForTourBattle2(src, dest) || !this.ongoingTourneyBattle(src))
    return;
    battlesLost.push(src);
    battlesLost.push(dest);

    var srcL = src.toLowerCase();
    var destL = dest.toLowerCase();

    battlesStarted.splice(Math.floor(tourbattlers.indexOf(srcL)/2), 1);
    tourbattlers.splice(tourbattlers.indexOf(srcL), 1);
    tourbattlers.splice(tourbattlers.indexOf(destL), 1);
    tourmembers.push(srcL);
    delete tourplayers[destL];

    if (tourbattlers.length != 0 || tourmembers.length > 1) {
    sys.sendAll("", tourchannel);
    sys.sendAll(border, tourchannel);
    sys.sendAll("~~Server~~: " + src + " advances to the next round.", tourchannel);
    sys.sendAll("~~Server~~: " + dest + " is out of the tournament.", tourchannel);
    }

    if (tourbattlers.length > 0) {
    sys.sendAll("*** " + tourbattlers.length/2 + " battle(s) remaining.", tourchannel);
    sys.sendAll(border, tourchannel);
    sys.sendAll("", tourchannel);
    return;
    }

    this.roundPairing();
    }

    ,
    //all functions needed for the tour
    if (tourmode == 2) {
    var name1 = sys.name(src);
    var name2 = sys.name(dest);

    if (this.isInTourney(name1)) {
    if (this.isInTourney(name2)) {
    if (this.tourOpponent(name1) != name2.toLowerCase()) {
    sys.sendMessage(src, "+TourneyBot: This guy isn't your opponent in the tourney.");
    sys.stopEvent();
    return;
    }
    } else {
    sys.sendMessage(src, "+TourneyBot: This guy isn't your opponent in the tourney.");
    sys.stopEvent();
    return;
    }
    if (sys.tier(src) != sys.tier(dest) || !cmp(sys.tier(src),tourtier)) {
    sys.sendMessage(src, "+TourneyBot: You must be both in the tier " + tourtier+ " to battle in the tourney.");
    sys.stopEvent();
    return;
    }
    } else {
    if (this.isInTourney(name2)) {
    sys.sendMessage(src, "+TourneyBot: This guy is in the tournament and you are not, so you can't battle him/her.");
    sys.stopEvent();
    return;
    }
    }
    }
    //beforeChallengeIssued
    if (tourmode == 2 && (this.isInTourney(sys.name(src)) || this.isInTourney(sys.name(dest)) )) {
    sys.stopEvent();
    return;
    }
    //beforeBattleMatchup




    [/SECRET]
     
  26. Gio96b

    Gio96b New Member

    Joined:
    Feb 6, 2011
    Messages:
    8
    Likes Received:
    0
    Thanks
     
  27. Darklight

    Darklight Nothing is True

    Joined:
    Jan 8, 2011
    Messages:
    1,195
    Likes Received:
    1
    ok.. i wanna use this script but I cannot use this to make myself an owner of my own server =.=
     
  28. eric the espeon

    eric the espeon is an espeon.

    Joined:
    Apr 21, 2010
    Messages:
    854
    Likes Received:
    1
    Add this to give yourself auth 3, then you will be able to use /changeauth. Alternatively, make /changeauth an admin command and set yourself to admin in the server window.
     
  29. PkPedro

    PkPedro New Member

    Joined:
    Sep 19, 2010
    Messages:
    3
    Likes Received:
    0
    When i place this script on my server, appears this on server.exe:

    Script Error line 1174: ReferenceError: Can't find variable: mafiachan
    Script Error line 2212: ReferenceError: Can't find variable: mafiachan

    How could i solve it?
     
  30. nesan

    nesan Love is blind

    Joined:
    Jun 13, 2010
    Messages:
    241
    Likes Received:
    0
    Restart the server.
     
  31. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    I updated the scripts in the OP.
     
  32. Mystra

    Mystra Active Member

    Joined:
    Jul 12, 2010
    Messages:
    1,389
    Likes Received:
    4
    Code (javascript):
    1.  
    2. function POGlobal(id)  
    3. {
    4. }
    5.  
    6. SESSION.registerGlobalFactory(POGlobal);
    7.  
    You don't need this if you don't use it.
     
  33. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    You know crystal :x
     
  34. Sdaf

    Sdaf New Member

    Joined:
    Mar 5, 2011
    Messages:
    1
    Likes Received:
    0
    i copied exatly the last scripts
     
  35. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Get the one in the link in the first post.
     
  36. fafiobri

    fafiobri New Member

    Joined:
    Mar 5, 2011
    Messages:
    1
    Likes Received:
    0
    excuse for my English, but I also I have a problem with those scripts, when I put none can write, and when I can, when typing commands the commands as if they were typing normally
     
  37. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Oops, sorry, updated the link in the OP.
     
  38. natty2

    natty2 Member

    Joined:
    May 11, 2010
    Messages:
    83
    Likes Received:
    0
    Hey, I tryed the new script in my server (actually, Im using the same script, but I translate everything to Hebrew in our server).
    I got that error:
    Script Error line 958: ReferenceError: Can't find variable: getFileContent

    line 958 is:
    var contents = getFileContent("rangebans.txt");

    There is no such file as "rangebans.txt", maybe that is the problem?
    Where should I create it? and what about the content?
     
  39. NeO

    NeO BR Scripter

    Joined:
    May 26, 2010
    Messages:
    50
    Likes Received:
    0
    var contents = sys.getFileContent("rangebans.txt");
     
  40. natty2

    natty2 Member

    Joined:
    May 11, 2010
    Messages:
    83
    Likes Received:
    0
    Thanks, that fixed it XD
    you could have told me on the MSN, nvm. :)
    It's all good and running now.