karazu 33 Posted February 15, 2014 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? Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted February 15, 2014 (edited) 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 February 15, 2014 by AnnieRuru Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted February 15, 2014 OnInit: bindatcmd "test", strnpcinfo(0)+"::Ontest"; end; Ontest: if ( !countitem(<item ID>) end; <blah blah here>; end; countitem for carrying, isequipped for wearing Quote Share this post Link to post Share on other sites
0 karazu 33 Posted February 15, 2014 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 Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted February 15, 2014 then give an example how you want it to work maybe your explanation too vague Quote Share this post Link to post Share on other sites
0 karazu 33 Posted February 15, 2014 { 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 Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted February 15, 2014 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 Quote Share this post Link to post Share on other sites
0 karazu 33 Posted February 15, 2014 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.. Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted February 15, 2014 (edited) 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 February 15, 2014 by Dastgir Pojee Quote Share this post Link to post Share on other sites
0 karazu 33 Posted February 15, 2014 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 Quote Share this post Link to post Share on other sites
0 karazu 33 Posted February 16, 2014 working, Thank you! Quote Share this post Link to post Share on other sites
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