Jump to content
  • 0
karazu

Rental NPC (with PAYMENT)

Question

Hello I've been searching all over in the forum about a Rental that ive been looking for but seems to be i cannot find one.



Its only like this, the NPC requires a certain Item to let the players rent an item

like for example :

10TCG for 1DAY  Slipner/Megs  etc..


I saw alot of post here about rental NPC but they dont have payments. can anyone help/give/show me please?


This is the script of my friend before and i think its not working anymore. 
 

 

   }        case 6: //halter lead          if (countitem(12622) > 0) {            mes "[Universal Rental Npc]";            mes "Sorry " + strcharinfo(0) + ", but you already have a halter lead.";            close;          } else if (countitem(7227) < 1) {            mes "[Universal Rental Npc]";            mes "Sorry " + strcharinfo(0) + ", but you need one TCG Card to rent one halter lead for one day.";            close;          } else {            mes "[Universal Rental Npc]";            mes "How many days do you intend to rent a halter lead?";            input @days;            if (countitem(7227) < @days) {              mes "[Universal Rental Npc]";              mes "I'm sorry " + strcharinfo(0) + ", but you need " + @days + " TCG Card to rent a halter lead for " + @days + " day(s).";              close;            } else {                delitem 7227, @days;                rentitem 12622, @days * 86400;                close;            }          } 

 

 
Edited by karazu

Share this post


Link to post
Share on other sites

17 answers to this question

Recommended Posts

  • 0
prontera,150,150,4    script    rentitem#123    100,{//prontera,150,150,4<tab>script<tab>rentitem#123<tab>100mes "Rent cost: " + .rentitemamt + "x " +getitemname(.rentitemid)+ " for one day";    next;    mes "What do you want to rent?";switch ( select ( .menu$ )  ) { // items to rent menu    case 1: callsub OnDeclareDays; // call OnDeclareDays to input days.            callsub OnRentItems,2410,.days; // 2410 is sleipnir's Item ID. only change the item ID.    case 2:    callsub OnDeclareDays; // call OnDeclareDays to input days.            callsub OnRentItems,2629,.days; // 2629 is Megs's Item ID. only change the item ID.    // to add more items add more cases example    // case 3: callsub OnDeclareDays;    //            callsub OnRentItems,2220,.days; // rent hat    // and add its name on .menu$ part at the bottom.    // pretty simple huh. }OnDeclareDays:        mes "How many days do you want to rent it?";        input .days; // input days        if (.days == 0 ) { // 0 is not a valid value.            mes "0 is not a valid value.";            close;        }        return .days;OnRentItems:        if ( countitem ( .rentitemid ) < getarg(1) * .rentitemamt ) { // not enough items            mes " ","Not Enough items","You need "+getarg(1) * .rentitemamt+"x "+getitemname(.rentitemid);            close;        }        delitem .rentitemid, getarg(1) * .rentitemamt; // delete items        rentitem getarg(0), getarg(1) * 86400; // rent an items. 86400 = 1 day in seconds        close;OnInit:    set .rentitemid, 7227; // item id of TCG change to your likings.    set .rentitemamt, 10; // item amount of TCG change to your likings.    set .menu$,"Sleip:Megs"; // to add an item separate the item with ":" without the quotes eg: "Sleip:Megs:HAT"}

try?

 

@edit

added some comments.

Edited by quesoph

Share this post


Link to post
Share on other sites
  • 0

Please stop bumping so often. Avoid bumping more than once a day, and your bump is pointless since your topic is currently leading this board.

 

Right now I'm not in my pc so I can't develop anything. Maybe a scripter will help you whenever he reads this topic, but remember devs are all around the world so maybe the one that will help you is sleeping at the moment.

 

Anyways, keep in mind that what you posted isn't a full script. It's just a snippet of a script so if you try to load that you'll surely get an error.

 

I'll try to help you when I'm back home, if any other scripter hasn't done that yet.

Share this post


Link to post
Share on other sites
  • 0

thank you! actually that script was just inserted in the "Universal Rental Npc" Script.    (it was about the halter lead which can be rented for 1 TCG per day)

yes I only posted that one since that the only line of script that i want.

It can be a new NPC with that kind of  script which can make people rent some GODLY items via TCG.

Share this post


Link to post
Share on other sites
  • 0

 

prontera,150,150,4    script    rentitem#123    100,{//prontera,150,150,4<tab>script<tab>rentitem#123<tab>100mes "Rent cost: " + .rentitemamt + "x " +getitemname(.rentitemid)+ " for one day";    next;    mes "What do you want to rent?";switch ( select ( .menu$ )  ) { // items to rent menu    case 1: callsub OnDeclareDays; // call OnDeclareDays to input days.            callsub OnRentItems,2410,.days; // 2410 is sleipnir's Item ID. only change the item ID.    case 2:    callsub OnDeclareDays; // call OnDeclareDays to input days.            callsub OnRentItems,2629,.days; // 2629 is Megs's Item ID. only change the item ID.    // to add more items add more cases example    // case 3: callsub OnDeclareDays;    //            callsub OnRentItems,2220,.days; // rent hat    // and add its name on .menu$ part at the bottom.    // pretty simple huh. }OnDeclareDays:        mes "How many days do you want to rent it?";        input .days; // input days        if (.days == 0 ) { // 0 is not a valid value.            mes "0 is not a valid value.";            close;        }        return .days;OnRentItems:        if ( countitem ( .rentitemid ) < getarg(1) * .rentitemamt ) { // not enough items            mes " ","Not Enough items","You need "+getarg(1) * .rentitemamt+"x "+getitemname(.rentitemid);            close;        }        delitem .rentitemid, getarg(1) * .rentitemamt; // delete items        rentitem getarg(0), getarg(1) * 86400; // rent an items. 86400 = 1 day in seconds        close;OnInit:    set .rentitemid, 7227; // item id of TCG change to your likings.    set .rentitemamt, 10; // item amount of TCG change to your likings.    set .menu$,"Sleip:Megs"; // to add an item separate the item with ":" without the quotes eg: "Sleip:Megs:HAT"}

try?

 

@edit

added some comments.

npc doesn't appear :(

Share this post


Link to post
Share on other sites
  • 0

console = map-server command promt

 

BTW use notepad++ then edit this in notepad++

 

take note of this //prontera,150,150,4<tab>script<tab>rentitem#123<tab>100

 

Tab is a button in your keyboard located at the middle left corner overhead of Caps Lock button

See attacment.

post-1582-0-84314600-1386215605.jpg

Share this post


Link to post
Share on other sites
  • 0

 


 

prontera,150,150,4    script    rentitem#123    100,{//prontera,150,150,4<tab>script<tab>rentitem#123<tab>100mes "Rent cost: " + .rentitemamt + "x " +getitemname(.rentitemid)+ " for one day";    next;    mes "What do you want to rent?";switch ( select ( .menu$ )  ) { // items to rent menu    case 1: callsub OnDeclareDays; // call OnDeclareDays to input days.            callsub OnRentItems,2410,.days; // 2410 is sleipnir's Item ID. only change the item ID.    case 2:    callsub OnDeclareDays; // call OnDeclareDays to input days.            callsub OnRentItems,2629,.days; // 2629 is Megs's Item ID. only change the item ID.    // to add more items add more cases example    // case 3: callsub OnDeclareDays;    //            callsub OnRentItems,2220,.days; // rent hat    // and add its name on .menu$ part at the bottom.    // pretty simple huh. }OnDeclareDays:        mes "How many days do you want to rent it?";        input .days; // input days        if (.days == 0 ) { // 0 is not a valid value.            mes "0 is not a valid value.";            close;        }        return .days;OnRentItems:        if ( countitem ( .rentitemid ) < getarg(1) * .rentitemamt ) { // not enough items            mes " ","Not Enough items","You need "+getarg(1) * .rentitemamt+"x "+getitemname(.rentitemid);            close;        }        delitem .rentitemid, getarg(1) * .rentitemamt; // delete items        rentitem getarg(0), getarg(1) * 86400; // rent an items. 86400 = 1 day in seconds        close;OnInit:    set .rentitemid, 7227; // item id of TCG change to your likings.    set .rentitemamt, 10; // item amount of TCG change to your likings.    set .menu$,"Sleip:Megs"; // to add an item separate the item with ":" without the quotes eg: "Sleip:Megs:HAT"}

try?

 

@edit

added some comments.

sir how make this script like a shop?.. but still selling a rental item with a choice of how many days to be rented..

you create a rental box and sell it in shop for tcg.

Share this post


Link to post
Share on other sites
  • 0

@@Quazi try this script: http://upaste.me/7bbc2166170cb9962

 

-	shop	rental_shop	-1,501:50prontera,150,150,4	script	Rentals Shop	100,{	callshop "rental_shop", 1;	npcshopattach "rental_shop";	end;OnBuyItem:	dispbottom "Rentals Shop: You can only buy one item at once.";	setarray .@q[0], @bought_nameid[0], @bought_quantity[0];	for (.@i = 0; .@i < getarraysize(.items_list); .@i++) {		if (.@q[0] == .items_list[.@i]) {			.@q[2] = .price_list[.@i];		}	}	mes .@npc_name$ = "[Rentals Shop]";	mes "Rental Item: "+getitemname(.@q[0]);	mes "Rental Cost: "+.@q[2]+"x "+getitemname(.currency)+" for one day.";	mes " ";	mes "How many days do you want to rent it ?";	next;	if (input(.@day, 1, 365)) {		mes .@npc_name$;		mes "Invalid input days..";		callsub ClearBought;		close;	}	.@q[3] = .@day * .@q[2];	mes .@npc_name$;	mes "Rental Item: "+getitemname(.@q[0]);	mes "Rental Cost: "+.@q[3]+"x "+getitemname(.currency)+" for "+.@day+" day"+((.@day > 1) ? "s" : "")+".";	mes " ";	mes "Still want to make the rent ?";	next;	if (select("Yes:No") == 2) {		mes .@npc_name$;		mes "All right, "+callfunc("F_Bye");		callsub ClearBought;		close;	}	if (countitem(.currency) < .@q[3]) {		mes .@npc_name$;		mes "I'm sorry, you haven't enought "+getitemname(.currency)+" to pay the rental";		callsub ClearBought;		close;	}	if (!checkweight(.@q[0], .@q[1])) {		mes .@npc_name$;		mes "You need more space in your inventory.";		callsub ClearBought;		close;	}	delitem .currency, .@q[3]; // delete items	rentitem .@q[0], .@day * 86400; // rent an items. 86400 = 1 day in seconds	callsub ClearBought;	end;	ClearBought:	deletearray @bought_quantity, getarraysize(@bought_quantity);	deletearray @bought_nameid, getarraysize(@bought_nameid);	return;OnInit:	// Configuration	setarray .items_list, 1201, 1201, 1201; // items list that you want to sell.	setarray .price_list,  100,  200,  300; // itens price that item you sell in the shop.	.currency = 7227; // items that will be used as exchange currency		// do not touch from here!!	npcshopdelitem "rental_shop", 501;	for (.@i = 0; .@i < getarraysize(.items_list); .@i++)		npcshopadditem "rental_shop", .items_list[.@i], .price_list[.@i];	end;}

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.