• 0
Sign in to follow this  
Surefirer

rent item atcommands

Question

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.

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

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

 

Share this post


Link to post
Share on other sites
  • 0

*rentitem <item id>,<time>;

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Chun3 said:

*rentitem <item id>,<time>;

rentitem only works in the script.

Share this post


Link to post
Share on other sites
  • 0
-	script	atcmd_example	-1,{
OnInit:
	bindatcmd("rentitem", strnpcinfo(3)+"::OnAtcommand");
	end;
OnAtcommand:
	[email protected] = atoi([email protected]_parameters$[0]);
	if (getitemname([email protected]) != "null") {
		if (getiteminfo([email protected], 2) != IT_CARD) {
			if ([email protected] > 0)
				rentitem [email protected], (24 * 60 * 60); // 1 day
			end;
		}
		dispbottom [email protected]_command$+" - You cant rent "+getitemname([email protected]);
	}
	else {
		dispbottom [email protected]_command$+" - invalid item #"[email protected];
	}
	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

Share this post


Link to post
Share on other sites
  • 0
4 hours ago, Emistry said:
-	script	atcmd_example	-1,{
OnInit:
	bindatcmd("rentitem", strnpcinfo(3)+"::OnAtcommand");
	end;
OnAtcommand:
	[email protected] = atoi([email protected]_parameters$[0]);
	if (getitemname([email protected]) != "null" && ) {
		if (getiteminfo([email protected], 2) != IT_CARD) {
			if ([email protected]d > 0)
				rentitem [email protected], (24 * 60 * 60); // 1 day
			end;
		}
		dispbottom [email protected]_command$+" - You cant rent "+getitemname([email protected]);
	}
	else {
		dispbottom [email protected]_command$+" - invalid item #"[email protected];
	}
	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

Share this post


Link to post
Share on other sites
  • 0
23 hours ago, Emistry said:
if (getitemname([email protected]) != "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:
	[email protected] = atoi([email protected]_parameters$[0]);
	if (getitemname([email protected]) != "null") {
		if (getiteminfo([email protected], 2) != IT_CARD) {
			rentitem [email protected], (24 * 60 * 60); // 1 day
		}
		else {
			dispbottom [email protected]_command$+" - You cant rent "+getitemname([email protected]);
		}
	}
	else {
		dispbottom [email protected]_command$+" - invalid item #"[email protected];
	}
	end;
}

 

it works. Thanks a lot!

23 hours ago, Emistry said:
if (getitemname([email protected]) != "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

Share this post


Link to post
Share on other sites
  • 0
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:
	[email protected] = atoi([email protected]_parameters$[0]);
	[email protected] = atoi([email protected]_parameters$[1]);
	[email protected] = atoi([email protected]_parameters$[2]);
	[email protected] = atoi([email protected]_parameters$[3]);
	[email protected] = atoi([email protected]_parameters$[4]);
	[email protected] = atoi([email protected]_parameters$[5]);
	if (getitemname([email protected]) != "null") {
		if (getiteminfo([email protected], 2) != IT_CARD) {
			rentitem2 [email protected], (24 * 60 * 60),1,[email protected],0,[email protected],[email protected],[email protected],[email protected];
		}
		else {
			dispbottom [email protected]_command$+" - You cant rent "+getitemname([email protected]);
		}
	}
	else {
		dispbottom [email protected]_command$+" - invalid item #"[email protected];
	}
	end;
}

 

Share this post


Link to post
Share on other sites
  • 0
33 minutes ago, Emistry said:
-	script	atcmd_example	-1,{
OnInit:
	bindatcmd("rentitem", strnpcinfo(3)+"::OnAtcommand");
	end;
OnAtcommand:
	[email protected] = atoi([email protected]_parameters$[0]);
	[email protected] = atoi([email protected]_parameters$[1]);
	[email protected] = atoi([email protected]_parameters$[2]);
	[email protected] = atoi([email protected]_parameters$[3]);
	[email protected] = atoi([email protected]_parameters$[4]);
	[email protected] = atoi([email protected]_parameters$[5]);
	if (getitemname([email protected]) != "null") {
		if (getiteminfo([email protected], 2) != IT_CARD) {
			rentitem2 [email protected], (24 * 60 * 60),1,[email protected],0,[email protected],[email protected],[email protected],[email protected];
		}
		else {
			dispbottom [email protected]_command$+" - You cant rent "+getitemname([email protected]);
		}
	}
	else {
		dispbottom [email protected]_command$+" - invalid item #"[email protected];
	}
	end;
}

 

Thank you sooooo much!!!!

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.   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.

Loading...
Sign in to follow this