Give command to a player via item

karazu

New member
Messages
1,115
Points
0
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?

 
OnInit:

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

end;

Ontest:

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

<blah blah here>;

end;

countitem for carrying, isequipped for wearing

 
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 

 
then give an example how you want it to work

maybe your explanation too vague

 
{ 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 

 
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

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

 
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.

 
Last edited by a moderator:
no need to do until that complicated

just put this script in

Code:
-	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;}
 
Last edited by a moderator:
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

 
Back
Top