Jump to content
  • 0
karazu

Give command to a player via item

Question

Hello guys, is it possible to give a player a command while just carrying this item?

Not Wearing but just carrying it in the inventory,,

Can u tell me how to make it in script please?.

If not possible how about by just wearing?

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

no need to do until that complicated

 

just put this script in

-	script	kjhfksfjhskfj	-1,{OnInit:	bindatcmd "afk", strnpcinfo(0)+"::OnCommand"; // overwrite the @afk command	end;OnCommand:	if ( !countitem(5474) ) {		message strcharinfo(0), "You must have an AFK hat to use this command";		end;	}	atcommand "@afk"; // then execute back the original command	end;}
Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

OnInit:

bindatcmd "test", strnpcinfo(0)+"::Ontest";

end;

 

Ontest:

if ( !countitem(<item ID>) end;

<blah blah here>;

end;

 

countitem for carrying, isequipped for wearing

Share this post


Link to post
Share on other sites
  • 0

OnInit:

bindatcmd "test", strnpcinfo(0)+"::Ontest";

end;

 

Ontest:

if ( !countitem(<item ID>) end;

<blah blah here>;

end;

 

countitem for carrying, isequipped for wearing

Thank you for the fast response Annie but what i mean is script in ITEM 

 

 

Share this post


Link to post
Share on other sites
  • 0

then give an example how you want it to work

 

maybe your explanation too vague

Share this post


Link to post
Share on other sites
  • 0



 

 

{	Id: 5474	AegisName: "Notice_Board"	Name: "AFK Hat"	Type: 5	Buy: 20	Weight: 700	Def: 4	Upper: 63	Loc: 256	EquipLv: 10	Refine: false	View: 471}, 

That Item will enable @afk in that character when worn. or lets say just carrying it in inventory 

Share this post


Link to post
Share on other sites
  • 0

what does the @afk command do ?

 

-> kick the player offline but still remain in the server ?

I think saw this before on some source release somewhere

Share this post


Link to post
Share on other sites
  • 0

what does the @afk command do ?

 

-> kick the player offline but still remain in the server ?

I think saw this before on some source release somewhere

Yes, I already have the SRC/Plugin, but I only want the command to be available on a player who has this item..

Share this post


Link to post
Share on other sites
  • 0

 

 

 

what does the @afk command do ?

-> kick the player offline but still remain in the server ?

I think saw this before on some source release somewhere

Yes, I already have the SRC/Plugin, but I only want the command to be available on a player who has this item..
on script put 'atcommand "@afk";' and make the item type delayed consumption(11 I guess, but check please) so it is not been used. So, double-clicking the item will cause @afk to be used.

or

modify your source to check inventory and equipped item.

Edited by Dastgir Pojee

Share this post


Link to post
Share on other sites
  • 0

 

no need to do until that complicated

 

just put this script in

-	script	kjhfksfjhskfj	-1,{OnInit:	bindatcmd "afk", strnpcinfo(0)+"::OnCommand"; // overwrite the @afk command	end;OnCommand:	if ( !countitem(5474) ) {		message strcharinfo(0), "You must have an AFK hat to use this command";		end;	}	atcommand "@afk"; // then execute back the original command	end;}

Whoahh, Thank you for this. gonna test this soon, Thank you very 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.   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.