Auction House

Thought this might be useful to somebody, though it probably won’t be…

Auction house!

Will add the weapon and take the players rupees automatically, as long as you have the weapons triggerhacks enabled in serveroptions, and as long as you put the correct weapon name…

Here are the commands if you are the person running the auction house…
(must have the tag Events Team on)
:item itemname - This will start the auction…make sure that this is the name of the WEAPON that you will want added to the player
:time number - How many seconds the auction will last (how long players can auction). Once the timer reaches 0, you can no longer offer a bid…
:end - This will take the player with the highest bid’s rupees, give them the item, then clear the whole form to get ready for the next item being auctioned…

PEOPLE RUNNING THE EVENT CAN NOT BID, SO YOU NEED TO CHANGE TAGS IF YOU WANT TO BID

if you are the person offering bids, you have only one command…

:bid number - Instead of number, you put how much you want to bid. It must be within the number of rupees you have, and higher than the current bid.

//NPC by Alex
if(playerenters){
  //showtext index,x,y,font,style,text;
  showtext 1,x+2,y-8,arial,b,Auction House;
  changeimgzoom 1,1.5;
  timereverywhere;
  timeout = 0.05;
}
if(playerchats){
  if(strequals(#g,Events Team)){
    tokenize #c;
    if(strequals(#t(0),:item)){
      setstring server.#Litem,#e(6,-1,#c);
      setstring server.#Lauction,1;
      setstring server.#Lbid,0;
      setstring server.#Lbidder,(none);
      setplayerprop #c,#s(server.#Litem) is now for sale!;
    }
    if(strtofloat(#s(server.#Lauction))==1){
      if(strequals(#t(0),:time)){
        setstring server.#Ltime,#v(strtofloat(#t(1)));
        setplayerprop #c,Auction time set to #s(server.#Ltime) seconds.;
      }
      if(strequals(#t(0),:end)){
        setstring server.#Lauction,0;
        setplayerprop #c,Auction ended!;
      }
    }
  }

  else if(!strequals(#g,Events Team)){
    if(strtofloat(#s(server.#Lauction))==1){
      tokenize #c;
      if(strequals(#t(0),:bid) && strtofloat(#s(server.#Ltime))>0){
        if(strtofloat(#t(1))>strtofloat(#s(server.#Lbid))){
          if(playerrupees >= strtofloat(#t(1))){
            setstring server.#Lbid,#t(1);
            setplayerprop #c,Bid of #t(1)!;
            setstring server.#Lbidder,#a;
          }
          else if(playerrupees < strtofloat(#t(1))){
            setplayerprop #c,Not enough money for this bid!;
          }
        }
        else if(strtofloat(#t(1))<=strtofloat(#s(server.#Lbid))){
          setplayerprop #c,Your bid is too low!;
        }
      }
    }
  }
}
if(strequals(#a,#s(server.#Lbidder)) && strtofloat(#s(server.#Lauction))==0){
  setstring this.refundname,#s(server.#Lbidder);
  triggeraction 0,0,gr.addweapon,#s(server.#Litem);
  setstring this.weapon,#s(server.#Litem);
  this.rupees = strtofloat(#s(server.#Lbid));
  playerrupees -= this.rupees;
  setstring server.#Litem, ;
  setstring server.#Lbid, ;
  setstring server.#Lbidder, ;
}

if(timeout){
  showtext 2,x,y-5.5,arial,b,Item: #s(server.#Litem);
  showtext 3,x,y-4.4,arial,b,Current Bid: #s(server.#Lbid);
  showtext 4,x,y-3.3,arial,b,Current Bidder: #s(server.#Lbidder);
  if(strtofloat(#s(server.#Lauction))==1){
    showtext 5,x,y-2,arial,b,Time Left: #v(int(strtofloat(#s(server.#Ltime))/60)) Minutes #v(strtofloat(#s(server.#Ltime))%60) Seconds;
  }
  else if(strtofloat(#s(server.#Lauction)) == 0){
    setstring server.#Ltime,0;
    showtext 5,x,y-2.2,arial,b,Time Left: #v(int(strtofloat(#s(server.#Ltime))/60)) Minutes #v(strtofloat(#s(server.#Ltime))%60) Seconds;
  }
  if(isleader){
    if(strtofloat(#s(server.#Ltime))>0){
      setstring server.#Ltime,#v(strtofloat(#s(server.#Ltime))-0.1);
    }
  }
  timeout = 0.05;
}

I’ve tested it and have yet to find any issues, so please say so if there are any…

Very impressive :smiley: you the #1 Scripter xD

Very nice.

No he is not.