[Exchange NPC] [Easily Editable] [100% secure]
Exchange NPC
He's meant to be an exchange npc, mesos for items, and the other way around.
Easily editable and noob friendly.
He compares your money, and the money he's gonna give you, if it'll end up above the 2,1bil, he'll dispose. 100% secure.
Pics:
If you don't want the items i put in, simply change the id's where it says Items go here, same with the mesos!
If you wanna add items, add the id behind a comma in the item's go here row, do the same thing with mesos!
Thanks to XxOsirisxX for shortening the script!
~Hope you guys like it. :laugh:
Code:
PHP Code:
/*
Mesos for items, and vice versa.
By Kars
*/
var status = -1;
var item = Array(4032133,4031284,4031679,4000174); // Item's go here
var mesos = Array(1500000000,1000000000,500000000,250000000); // Mesos here
var choice;
function start() {
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode != 1) {
cm.dispose();
return;
} else
status++;
if (status == 0) {
cm.sendSimple("Hello there, what would you like to do?\r\n#b#L0#Exchange mesos for items#l\r\n#L1#Exchange items for mesos#l");
} else if (status == 1) {
if (selection == 0) {
choice = 1;
var text = "Mesos for items?";
for (var i = 0; i < item.length; i++)
text += "\r\n#L" + i + "##r" + mesos[i] + " Mesos#k for #b#v" + item[i] + "# #z" + item[i] + "##k#l";
cm.sendSimple(text);
} else {
choice = 0;
var text = "Items for mesos?";
for (var i = 0; i < item.length; i++)
text += "\r\n#L" + i + "##r#v" + item[i] + "# #z" + item[i] + "##k for #b" + mesos[i] + " Mesos#k#l";
cm.sendSimple(text);
}
} else if (status == 2) {
if (choice == 1) {
if (cm.getMeso() > mesos[selection]){
cm.gainMeso(-mesos[selection]);
cm.gainItem(item[selection],1);
cm.sendOk("You have traded #r" + mesos[selection] + " Mesos#k for #b#z" + item[selection] + "##k");
cm.dispose();
} else
cm.sendOk("You need at least #r" + mesos[selection] + " Mesos#k for #b#z" + item[selection] + "##k!");
cm.dispose();
} else {
if (cm.haveItem(item[selection],1)) {
if (cm.getMeso()+ mesos[selection] >= 2100000000) {
cm.sendOk("You have too much money!\r\n#b" + cm.getMeso() + "#k + #r" + mesos[selection] + "#k = Above the meso limit of \r\n#d2100000000#k!");
cm.dispose();
} else {
cm.gainItem(item[selection],-1);
cm.gainMeso(mesos[selection]);
cm.sendOk("You have traded #r#z" + item[selection] + "##k for #b" + mesos[selection] + " Mesos#k!");
cm.dispose();
}
} else {
cm.sendOk("You need #r#z" + item[selection] + "##k for #b" + mesos[selection] + " Mesos#k!");
cm.dispose();
}
}
}
}
Re: [Exchange NPC] [Easily Editable] [100% secure]
Re: [Exchange NPC] [Easily Editable] [100% secure]
Quote:
Originally Posted by
Legacy
It looks okay, good job?
Thanks?
xD
Re: [Exchange NPC] [Easily Editable] [100% secure]
Nice Rls
What is That NPC ID?
Thx!
Re: [Exchange NPC] [Easily Editable] [100% secure]
Quote:
Originally Posted by
ANBUItachi
Nice Rls
What is That NPC ID?
Thx!
9010013, Hengki.
Goto www.mapletip.com
And thanks.
Re: [Exchange NPC] [Easily Editable] [100% secure]
2147483647 is around the max amount of mesos you can have, not 2100000000
Re: [Exchange NPC] [Easily Editable] [100% secure]
Quote:
Originally Posted by
hey0
2147483647 is around the max amount of mesos you can have, not 2100000000
Big deal, change if it bothers you.
Re: [Exchange NPC] [Easily Editable] [100% secure]
Err, kinda useless, no offence. They should be able to do this, though. This is REALLY easy...
Re: [Exchange NPC] [Easily Editable] [100% secure]
Yeah, anyone who can actually code, probably have already done this. like me. :)
Re: [Exchange NPC] [Easily Editable] [100% secure]
Quote:
Originally Posted by
watzmename
Yeah, anyone who can actually code, probably have already done this. like me. :)
Yep, but anyways, i looked, first release.
Re: [Exchange NPC] [Easily Editable] [100% secure]
Nice job I guess, but you spelled choice wrong.
Re: [Exchange NPC] [Easily Editable] [100% secure]
Re: [Exchange NPC] [Easily Editable] [100% secure]
Quote:
Originally Posted by
ishan1996
Oh god 51th release of this, well anywho goodjob?
Actually, this one is different.
This checks for the max mesos, doesn't have else if status blabla's and can do multiple items through variables.
Re: [Exchange NPC] [Easily Editable] [100% secure]
Where do i put this? SQL? or sciprts
Re: [Exchange NPC] [Easily Editable] [100% secure]
Quote:
Originally Posted by
vicmeifre3
Where do i put this? SQL? or sciprts
Scripts\npc\(npcid).js