Re: [Release]Chair Vendor
Using arrays is much more simpler :o
Re: [Release]Chair Vendor
lol im gona use this it seems like an awesome idea+myshops r messed up cuz i tried to change it haha
Re: [Release]Chair Vendor
Quote:
Originally Posted by
ishan1996
lol im gona use this it seems like an awesome idea+myshops r messed up cuz i tried to change it haha
i only take credits for adding the items and making the script adjusted i dont take credits for the base i used the meso bank script ^.^ im gonna be basing alot of shops on this^.^
Re: [Release]Chair Vendor
Re: [Release]Chair Vendor
Quote:
Originally Posted by
Hubba
Nice Release =D
tanku i worked an hour or so on this ask anyone on my server this is my first real complex npc i basicaly make game npcs and fun stuff
Edit: Added pictures / tooken by one of my gms
Re: [Release]Chair Vendor
Quote:
Originally Posted by
brianobb
tanku i worked an hour or so on this ask anyone on my server this is my first real complex npc i basicaly make game npcs and fun stuff
Edit: Added pictures / tooken by one of my gms
LOL you picked the nubchair maker npc
hmm... i should make them a quest haha
Re: [Release]Chair Vendor
Quote:
Originally Posted by
ishan1996
LOL you picked the nubchair maker npc
hmm... i should make them a quest haha
lol good luck i just made it some random guy who was free
Re: [Release]Chair Vendor
credits to me for the base script?
what npc did you use as a base? O.o
the exp seller?
Re: [Release]Chair Vendor
Nice release :)
Now its simple and easy to buy a chair !
Re: [Release]Chair Vendor
Quote:
Originally Posted by
kippieeej
credits to me for the base script?
what npc did you use as a base? O.o
the exp seller?
The money bag vendor but it was already credits to u for base so i didnt take it out
Quote:
Originally Posted by
xbLazE
Nice release :)
Now its simple and easy to buy a chair !
thankyou
Re: [Release]Chair Vendor
Arrays are better in this case.
not to mention, that if you select any option but the first 2, and you don't have 100 mesos.. it will crash.
PHP Code:
var status = -1;
var chair = Array(3010002,3010008,3010012,3010014,3010007,3011000);
function start() {
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode != 1) {
cm.dispose();
return;
} else
status++;
if (status == 0) {
var text = "Hello #h #, Welcome to #rSaphireMs#k\r\nWould you like to buy a chair\r\n \r\nWhich Chair would you like?";
for(var i = 0; i < chair.length() ; i++)
text += "\r\n#L" + i + "##b #i" + chair[i] + "# #t"+ chair[i] + "##l";
cm.sendSimple(text);
} else if (status == 1) {
if (cm.getMeso() >= 100) {
cm.gainMeso(-100);
cm.gainItem(chair[selection], 1);
}else
cm.sendOk("You don't have enough #bMesos#k, are you trying to #eScam#k me!?");
cm.dispose();
}
}
Re: [Release]Chair Vendor
if (cm.itemQuantity(chair[selection]) >= 50)
should be
if (cm.itemQuantity(5200002) >= 50)
Re: [Release]Chair Vendor
Quote:
Originally Posted by
kippieeej
if (cm.itemQuantity(chair[selection]) >= 50)
should be
if (cm.itemQuantity(5200002) >= 50)
So true, I thought he means that player only had 50 chairs...
But now, I see pointless that "5200000" is being used and not even being removed and just mesos..
Is that the point? =/
Re: [Release]Chair Vendor
Code:
//Sora of YourStory
var status = 0;
var love = Array(3010002, 3010008, 3010012, 3010014, 3010007, 3011000);
var money = Array(-200, -200, -200, -200, -200, -200);
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && status == 0) {
cm.sendOk("comback");
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendSimple("Hello #h #, Welcome to #rSaphireMs#k\r\nWould you like to buy a chair\r\n \r\nWhich Chair would you like \r\n#L0##bBuy a #v3010002##k#l \r\n \r\n#L1##bBuy 1 #v3010008# #k#l \r\n \r\n#L2##bBuy 1 #v3010012##l \r\n \r\n#L3##bBuy 1 #v3010014# #l \r\n \r\n#L4##bBuy 1 #v3010007##l \r\n \r\n#L5##bBuy 1 #v3011000# #l");
//cm.dispose();
} else if (status == 1) {
if (cm.getMeso() >= 200) {
cm.gainItem(love[selection]);
cm.gainMeso(money[selection]);
cm.sendOk(" Hope you like #v" + love[selection] + "# chair.");
cm.dispose();
} else {
cm.sendOk("You don't have enough #bMesos#k, are you trying to #eScam#k me!?");
cm.dispose();
}
}
}
}
even better
Re: [Release]Chair Vendor
Quote:
Originally Posted by
XxOsirisxX
So true, I thought he means that player only had 50 chairs...
But now, I see pointless that "5200000" is being used and not even being removed and just mesos..
Is that the point? =/
no it took a base of an old script u can just ignore that
Re: [Release]Chair Vendor
Quote:
Originally Posted by
brianobb
no it took a base of an old script u can just ignore that
That case, so then remove it... Just did.
Re: [Release]Chair Vendor
Re: [Release]Chair Vendor
Quote:
Originally Posted by
XxOsirisxX
Arrays are better in this case.
not to mention, that if you select any option but the first 2, and you don't have 100 mesos.. it will crash.
PHP Code:
var status = -1;
var chair = Array(3010002,3010008,3010012,3010014,3010007,3011000);
function start() {
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode != 1) {
cm.dispose();
return;
} else
status++;
if (status == 0) {
var text = "Hello #h #, Welcome to #rSaphireMs#k\r\nWould you like to buy a chair\r\n \r\nWhich Chair would you like?";
for(var i = 0; i < chair.length() ; i++)
text += "\r\n#L" + i + "##b #i" + chair[i] + "# #t"+ chair[i] + "##l";
cm.sendSimple(text);
} else if (status == 1) {
if (cm.getMeso() >= 100) {
cm.gainMeso(-100);
cm.gainItem(chair[selection], 1);
}else
cm.sendOk("You don't have enough #bMesos#k, are you trying to #eScam#k me!?");
cm.dispose();
}
}
Correct me if I am wrong but shouldn't "var status = -1;" be "var status = 0;"?
And can you do } else not } else { ?
And why can't you do cm.sendSimple(Hello #h #, Welcome to #rSaphireMs#k\r\nWould you like to buy a chair\r\n \r\nWhich Chair would you like?); instead of using var?
Re: [Release]Chair Vendor
Quote:
Originally Posted by
shakar96
Correct me if I am wrong but shouldn't "var status = -1;" be "var status = 0;"?
And can you do } else not } else { ?
And why can't you do cm.sendSimple(Hello #h #, Welcome to #rSaphireMs#k\r\nWould you like to buy a chair\r\n \r\nWhich Chair would you like?); instead of using var?
Wrong.
Re: [Release]Chair Vendor
Quote:
Originally Posted by
MrMysterious
Wrong.
Oh really? Then I suck 0.o
Re: [Release]Chair Vendor
Re: [Release]Chair Vendor
lol as long as you just please leave my name somewhere thanks
Re: [Release]Chair Vendor
i have a shop for chairs so no need for npcs on it
Re: [Release]Chair Vendor
Quote:
Originally Posted by
shajal
i have a shop for chairs so no need for npcs on it
lol i like npc more then shop for some reason