Rental NPC (with PAYMENT)

karazu

New member
Messages
1,115
Points
0
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. 
 

Code:
   }        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;            }          } 
 
 
Last edited by a moderator:
default_huh.png


 
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.

 
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.

 
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.

 
Last edited by a moderator:
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
default_sad.png


 
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.

tab.jpg

 
Last edited by a moderator:
Quazi said:
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.

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

Code:
-	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;}
 
Back
Top