Jump to content
  • 0

rent item atcommands


Question

Posted

Hello,

Is there anyway that I can create rent item like I can creat normal item in the game?

Example:

I can creat an item# 1201 by useing @item 1201 1

But if I want to creat a rent item #1201 that can be used for only 1 day.

Something like @rentitem?

The reason I am asking this is if a player request a special item for testing purpose, instead of he return to me after the test, I want to creat a rent item, so I don't need to worry about the return. 

Thanks in advance.

11 answers to this question

Recommended Posts

  • 1
Posted
-	script	atcmd_example	-1,{
OnInit:
	bindatcmd("rentitem", strnpcinfo(3)+"::OnAtcommand");
	end;
OnAtcommand:
	.@itemid = atoi(.@atcmd_parameters$[0]);
	if (getitemname(.@itemid) != "null") {
		if (getiteminfo(.@itemid, 2) != IT_CARD) {
			rentitem .@itemid, (24 * 60 * 60); // 1 day
		}
		else {
			dispbottom .@atcmd_command$+" - You cant rent "+getitemname(.@itemid);
		}
	}
	else {
		dispbottom .@atcmd_command$+" - invalid item #"+.@itemid;
	}
	end;
}

 

  • Upvote 1
  • 0
Posted (edited)
-	script	atcmd_example	-1,{
OnInit:
	bindatcmd("rentitem", strnpcinfo(3)+"::OnAtcommand");
	end;
OnAtcommand:
	.@itemid = atoi(.@atcmd_parameters$[0]);
	if (getitemname(.@itemid) != "null") {
		if (getiteminfo(.@itemid, 2) != IT_CARD) {
			if (.@second > 0)
				rentitem .@itemid, (24 * 60 * 60); // 1 day
			end;
		}
		dispbottom .@atcmd_command$+" - You cant rent "+getitemname(.@itemid);
	}
	else {
		dispbottom .@atcmd_command$+" - invalid item #"+.@itemid;
	}
	end;
}

try

renting a card type item will create an exploit where player can remove the rental duration when they insert into an equipment.

Edited by Emistry
  • 0
Posted
4 hours ago, Emistry said:

-	script	atcmd_example	-1,{
OnInit:
	bindatcmd("rentitem", strnpcinfo(3)+"::OnAtcommand");
	end;
OnAtcommand:
	.@itemid = atoi(.@atcmd_parameters$[0]);
	if (getitemname(.@itemid) != "null" && ) {
		if (getiteminfo(.@itemid, 2) != IT_CARD) {
			if (.@second > 0)
				rentitem .@itemid, (24 * 60 * 60); // 1 day
			end;
		}
		dispbottom .@atcmd_command$+" - You cant rent "+getitemname(.@itemid);
	}
	else {
		dispbottom .@atcmd_command$+" - invalid item #"+.@itemid;
	}
	end;
}

try

renting a card type item will create an exploit where player can remove the rental duration when they insert into an equipment.

Thanks for you help. I got this error after I run the script. Pls see attached pic.

QQ图片20190915093657.png

  • 0
Posted (edited)
23 hours ago, Emistry said:

if (getitemname(.@itemid) != "null") {

 

Hello, how do I create rentitem? I tired type "@rentitem 1101 20 (I am assuming 20 is 20 second?)", but nothing happened, and there is no error.

I tired to create card item, it does show "can't rent card" at message box, so this works. But type rentitem to create equipment does not work.

22 hours ago, Emistry said:

-	script	atcmd_example	-1,{
OnInit:
	bindatcmd("rentitem", strnpcinfo(3)+"::OnAtcommand");
	end;
OnAtcommand:
	.@itemid = atoi(.@atcmd_parameters$[0]);
	if (getitemname(.@itemid) != "null") {
		if (getiteminfo(.@itemid, 2) != IT_CARD) {
			rentitem .@itemid, (24 * 60 * 60); // 1 day
		}
		else {
			dispbottom .@atcmd_command$+" - You cant rent "+getitemname(.@itemid);
		}
	}
	else {
		dispbottom .@atcmd_command$+" - invalid item #"+.@itemid;
	}
	end;
}

 

it works. Thanks a lot!

23 hours ago, Emistry said:

if (getitemname(.@itemid) != "null") {

 

Is is possible to have @rentitem2 like @item2? The reason I am asking is I can also add enchance elements into the rent equipment. Thanks

Edited by Surefirer
  • 0
Posted
17 hours ago, Surefirer said:

Is is possible to have @rentitem2 like @item2? The reason I am asking is I can also add enchance elements into the rent equipment. Thanks

-	script	atcmd_example	-1,{
OnInit:
	bindatcmd("rentitem", strnpcinfo(3)+"::OnAtcommand");
	end;
OnAtcommand:
	.@itemid = atoi(.@atcmd_parameters$[0]);
	.@refine = atoi(.@atcmd_parameters$[1]);
	.@card1 = atoi(.@atcmd_parameters$[2]);
	.@card2 = atoi(.@atcmd_parameters$[3]);
	.@card3 = atoi(.@atcmd_parameters$[4]);
	.@card4 = atoi(.@atcmd_parameters$[5]);
	if (getitemname(.@itemid) != "null") {
		if (getiteminfo(.@itemid, 2) != IT_CARD) {
			rentitem2 .@itemid, (24 * 60 * 60),1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
		}
		else {
			dispbottom .@atcmd_command$+" - You cant rent "+getitemname(.@itemid);
		}
	}
	else {
		dispbottom .@atcmd_command$+" - invalid item #"+.@itemid;
	}
	end;
}

 

  • 0
Posted
33 minutes ago, Emistry said:

-	script	atcmd_example	-1,{
OnInit:
	bindatcmd("rentitem", strnpcinfo(3)+"::OnAtcommand");
	end;
OnAtcommand:
	.@itemid = atoi(.@atcmd_parameters$[0]);
	.@refine = atoi(.@atcmd_parameters$[1]);
	.@card1 = atoi(.@atcmd_parameters$[2]);
	.@card2 = atoi(.@atcmd_parameters$[3]);
	.@card3 = atoi(.@atcmd_parameters$[4]);
	.@card4 = atoi(.@atcmd_parameters$[5]);
	if (getitemname(.@itemid) != "null") {
		if (getiteminfo(.@itemid, 2) != IT_CARD) {
			rentitem2 .@itemid, (24 * 60 * 60),1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
		}
		else {
			dispbottom .@atcmd_command$+" - You cant rent "+getitemname(.@itemid);
		}
	}
	else {
		dispbottom .@atcmd_command$+" - invalid item #"+.@itemid;
	}
	end;
}

 

Thank you sooooo much!!!!

  • 0
Posted
-	script	atcmd_example	-1,{
OnInit:
	bindatcmd("rentitem", strnpcinfo(3)+"::OnAtcommand");
	end;
OnAtcommand:
	.@itemid = atoi(.@atcmd_parameters$[0]);
	if (getitemname(.@itemid) != "null") {
		if (getiteminfo(.@itemid, 2) != IT_CARD) {
			rentitem .@itemid, (24 * 60 * 60); // 1 day
		}
		else {
			dispbottom .@atcmd_command$+" - You cant rent "+getitemname(.@itemid);
		}
	}
	else {
		dispbottom .@atcmd_command$+" - invalid item #"+.@itemid;
	}
	end;
}

Hi there, how can i add only GM with level 99 are allowed to use this @rentitem commands?

  • 0
Posted
On 4/22/2023 at 12:47 AM, amanikoko said:

how can i add only GM with level 99 are allowed to use this @rentitem commands?

bindatcmd("rentitem", strnpcinfo(3)+"::OnAtcommand", 99);

 

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...