Jump to content
  • 0

rent item atcommands


Surefirer

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.02
  • Content Count:  113
  • Reputation:   1
  • Joined:  12/15/18
  • Last Seen:  

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.

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 1

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

-	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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   9
  • Joined:  08/22/19
  • Last Seen:  

*rentitem <item id>,<time>;

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.02
  • Content Count:  113
  • Reputation:   1
  • Joined:  12/15/18
  • Last Seen:  

1 hour ago, Chun3 said:

*rentitem <item id>,<time>;

rentitem only works in the script.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

-	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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.02
  • Content Count:  113
  • Reputation:   1
  • Joined:  12/15/18
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

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

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.02
  • Content Count:  113
  • Reputation:   1
  • Joined:  12/15/18
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

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;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.02
  • Content Count:  113
  • Reputation:   1
  • Joined:  12/15/18
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  40
  • Reputation:   0
  • Joined:  02/26/21
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

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);

 

Link to comment
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.

×
×
  • Create New...