Jump to content
  • 0

Allow command when item is equipped


Althezier

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   1
  • Joined:  01/06/19
  • Last Seen:  

Hey all!

What is the best approach to do what the title says?

 

Example: Suppose there's a command @dosomething, and by default nobody can use it. Now, there's an item called AnItem that when equipped allow me to use the @dosomething command. Again, it ALLOWS me to use the command, it doesn't automatically activate it.

Edited by Althezier
Add more details
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

-	script	asdsadas	-1,{
	OnDoSmtg:
		if (!countitem(.item_id)) end;
		dispbottom "Command activated.";
		end;
	
	OnInit:
		bindatcmd "dosomething", strnpcinfo(1) + "::OnDoSmtg";
		.item_id = 5001;
		end;
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  927
  • Reputation:   169
  • Joined:  04/05/13
  • Last Seen:  

If it was bindatcommand just use countitem function

If it was source command it need to do it on src folders. (Find all by put target commands in finding box then use count item function (Not sure how to count it but you can try search in src folders))

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   1
  • Joined:  01/06/19
  • Last Seen:  

Thank you both for the answers, I think I can work with that already!

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