Jump to content
  • 0
Takizuki

@item command

Question

Hi, is it possible to disable specific item using @item command? only npc can release it

 

what i mean is... example

 

if i type @item 607 (ygg) it wont give me the item i want, but if i talk to ygg dealer npc it can gives me a ygg. ( make sense? )

 

coz i know that you can disable an item on itemdb so that you cant get it even your using @item.

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Tossed this together quickly, haven't tested, but should work.

 

-	script	itembind	-1,{// Script-Based @item Alternative by Eiphes// Version: 1.0 - August 2014// Feel free to edit this script or simply use it as a base. OnInit:	unbindatcmd "item";	bindatcmd("item","itembind::OnAtcommand",0,10);	end;	 OnAtcommand:if(getgroupid() < 1) { dispbottom "[Server] : You are not authorized to use this command."; end; }set @item$,.@atcmd_parameters$[0]; // Group-Based Restrictionsif(@item$ == "" || @item$ == "" && getgroupid() < 99) {// Add new IDs into the quotations. Things in here can't be created by anyone lower than group 99 (Admin).		dispbottom "[Server] : Your group ID is not authorized to create that item.";		end;}// Create new sections by copy/pasting the above code and modifying the IDs and groupid level accordingly.}

Share this post


Link to post
Share on other sites
  • 0

tried it but it wont allow them to use @item even the item is not restricted on this line if(@item$ == "" || @item$ == "" && getgroupid() < 99) {

 

also even a GM 99 cant also do @item saying that Your group ID is not authorized to create that item.

 

i think the script wont allow the use of @item on any group id

 

no error in the console

Share this post


Link to post
Share on other sites
  • 0

 

-	script	itembind	-1,{// Script-Based @item Alternative by Eiphes// Version: 1.0 - August 2014// Feel free to edit this script or simply use it as a base. OnInit:	unbindatcmd "item";	bindatcmd("item","itembind::OnAtcommand",10,10);	end;	 OnAtcommand:if(getgroupid() < 10) { dispbottom "[Server] : You are not authorized to use this command."; end; }set .@item$,.@atcmd_parameters$[0];set .@amount$,.@atcmd_parameters$[1];  // Group-Based Restrictionsif(.@item$ == "504" || .@item$ == "505" && getgroupid() < 99) {// Add new IDs into the quotations. Things in here can't be created by anyone lower than group 99 (Admin).		dispbottom "[Server] : Your group ID is not authorized to create that item.";		end;}// Create new sections by copy/pasting the above code and modifying the IDs and groupid level accordingly.set .@item,.@item$;set .@amount,.@amount$;if(.@amount < 1) { set .@amount,1;}getitem .@item,.@amount;end;}

Share this post


Link to post
Share on other sites
  • 0

Double-posting because it keeps messing up the code box; Edit the ID numbers (in the example I've given, 504, and 505) to what you want restricted.

 

The code is unoptimized, and will probably show warnings in the console, but just tested it and it works. The original code I posted didn't give items, whoops. Fixed and added some more code in my previous response.

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.