PDA

View Full Version : Time limitations on auctions


excaliber7388
03-12-2006, 11:22 PM
I'm making an auction house on my server that is ran entirely by one NPC. I know how to make everything for bidding and selling, however, the time limit is what's nailing me. I have an idea, but I have to know more first.
1st question-does timevar2 continue to increase, or does it stop at a certain number?
2nd is timevar2 exact seconds? Would lag throw it off?
Ex: would it be safe to say that timevar2+3600 is 1 hour from now?
Thanks!

napo_p2p
03-12-2006, 11:53 PM
1st question-does timevar2 continue to increase, or does it stop at a certain number?Timevar2 (serverside) keeps going and going. It doesn't stop.


2nd is timevar2 exact seconds? Would lag throw it off? It's exact, and very accurate. Measures seconds since 1/1/1970. It even measures within a millionth of a second I believe.


Ex: would it be safe to say that timevar2+3600 is 1 hour from now?
Thanks!
Yup. Although, I would do int(timevar2) + 3600;

I hope that helped. Good luck with your script.

excaliber7388
03-13-2006, 12:11 AM
Hrm...I know people hate this :frown: but what am i doing wrong?

if (created)
{
setshape 1,32,32;
}
if(actiontime)
{
triggeraction x,y,timer,#v(int(timevar2));
}
if(actionsell)
{
removeweapon #p(0);
setstring serverr.bid_#p(2)_item,#p(0);
setstring serverr.bid_#p(2)_acct,#p(3);
setstring serverr.bid_#p(2)_img,#p(4);
setstring serverr.bid_#p(2)_price,#p(1);
setstring serverr.bid_#p(2)_time,#v(int(timevar2));
}
if(actionreclaim2)
{
with(getplayer(#s(serverr.bid_#p(1)_acct)))
{
addweapon #s(serverr.bid_#p(0)_item);
}
setstring serverr.bid_#p(0)_item,0;
setstring serverr.bid_#p(0)_acct,0;
setstring serverr.bid_#p(0)_img,0;
setstring serverr.bid_#p(0)_price,0;
}
//#CLIENTSIDE
if(created)
{
timeout=1;
}
if(playerchats)
{
tokenize #c;
//selling
//item name, price, table number, acct, img
if(strequals(#t(0),/sell))
{
if(hasweapon(#t(1)) && !strcontains(#t(1),staff) && strtofloat(#t(2))<100001 && strtofloat(#s(serverr.bid_#t(3)_item))==0 && strtofloat(#t(3))<23 && !strcontains(#t(1),system))
{
triggeraction x,y,sell,#t(1),#t(2),#t(3),#a,#W;
}
else
{
say2 Illegal!;
}
}
}
if(timeout)
{
triggeraction x,y,time,time;
if(actiontimer)
{
for(this.i=0;this.i<20;this.i++)
{
if(strtofloat(#s(serverr.bid_#v(this.i)_time))+(10 )==#p(0))
{
//reclaim2 :this.i, seller account
triggeraction x,y,reclaim2,#v(this.i),#s(serverr.bid_#v(this.i)_ acct);
}
}
}
timeout=1;
}

ZeLpH_MyStiK
03-13-2006, 01:10 AM
why don't you try debugging it yourself first? -.-
see if the triggeraction is being called, and etc. seriously, if this trend continues, i think you should be banned from the forums.

excaliber7388
03-14-2006, 12:30 AM
nvm, Fixed it.
Also, is it posible to display the image of a weapon that is not the player's selected weapon?

Ajira
03-14-2006, 12:38 AM
nvm, Fixed it.
Also, is it posible to display the image of a weapon that is not the player's selected weapon?
#W(index)

ApothiX
03-14-2006, 05:12 PM
#W(index)
for the selected weapon, it's just #W I believe.

jake13jake
03-15-2006, 12:25 AM
I would suggest just to do the entire thing serverside.

This generally won't cause lag

timeout = time of auction;

If the auction ends before that
timeout = 0;