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
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?
As MrMysterious said.. you're wrong.
I just make the use of "var status" faster and not useless "status = -1" under start function.
else/if without brackets just affect the next line. So yeah it's only a line, so I can win a "{ }" less.. which is preference.
I can't do the senSimple thing because text must have a text because it can be used as "+=" which is "text = text + THING". So then I rather get the static text appart in text variable, and then loop the arrays for the next part which is repetitive and just change values, which I store on Arrays for that propose.
Re: [Release]Chair Vendor
Quote:
Originally Posted by
XxOsirisxX
As MrMysterious said.. you're wrong.
I just make the use of "var status" faster and not useless "status = -1" under start function.
else/if without brackets just affect the next line. So yeah it's only a line, so I can win a "{ }" less.. which is preference.
I can't do the senSimple thing because text must have a text because it can be used as "+=" which is "text = text + THING". So then I rather get the static text appart in text variable, and then loop the arrays for the next part which is repetitive and just change values, which I store on Arrays for that propose.
ok then lmao
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
An hour? And this is complex?
:Oo
Ah well, good job I guess. If you're proud of it, good for you :thumbup:
Re: [Release]Chair Vendor
Quote:
Originally Posted by
brianobb
ok then lmao
I wasn't talking to you O_o, don't you read the Quote?
Re: [Release]Chair Vendor
Works,
in MapleLuv Private server,
big thanks.