OnNplay Posted November 22, 2012 Posted November 22, 2012 The script will be placed in the item. Closer to this purpose is Megaphone. I want selected item will make @item for the selected account id. When the character of the account id click on it will get input box. The input box will collect the item name or item code and quantity. So the character will get the item. Quote
Ryokem Posted November 22, 2012 Posted November 22, 2012 Just call a function inside the item. Make it an usable item. { callfunc "getItem__"; },{},{} then the function itself.. function script getItem__ { mes "input the ID"; input .@id; //Code to check if the input is avaible/correct mes "input the amount"; input .@amount; //Code to check if the input is avaible/correct getitem .@id, .@amount; return; } Quote
GM Takumirai Posted November 22, 2012 Posted November 22, 2012 Ryokem i know this is offtopic but how about putting a custom item if double click a @command > @autoattack will be used but the with expiration time Quote
Ryokem Posted November 22, 2012 Posted November 22, 2012 (edited) Yeah, you can add a timer and setting that kinf of command too, exactly in the same way. Something like... function script command__ { attachnpctimer getcharid(3); atcommand "@autoattack"; initnpctimer; return; OnTimer60000: //60 seconds OnTimerQuit: atcommand "@autoattack"; end; } Note that you have to be careful to use an @command in the OnTimerQuit label, 'cause the player already logged out but it may be still able to run the command. Edited November 22, 2012 by Ryokem Quote
GM Takumirai Posted November 22, 2012 Posted November 22, 2012 so the problem in the command script is that it can be exploited?? it will delete the item right if its usable?.. thanks Quote
Ryokem Posted November 22, 2012 Posted November 22, 2012 Yeah, it will delete the item if you set that the item expires after being used. And I personally try not to use atcommand command inside scripts unless it's really the only choice I have, mostly 'cause of server runtime. Quote
GM Takumirai Posted November 22, 2012 Posted November 22, 2012 i see, is there an alternative way? Quote
OnNplay Posted November 22, 2012 Author Posted November 22, 2012 Thank you. This is really help. How about with checking account no. Example, I want it only serve account no. 2000004 other than this account no. the script will be not activated. Quote
Emistry Posted November 22, 2012 Posted November 22, 2012 Thank you. This is really help. How about with checking account no. example 2000004 if( getcharid(3) == 2000004 ){ // do what you want here... } reference getcharid Quote
OnNplay Posted November 22, 2012 Author Posted November 22, 2012 function script getItem__ {if( getcharid(3) == 2000004 ){ mes "input the ID"; input .@id; mes "input the amount"; input .@amount; getitem .@id, .@amount; return; }} //Code to check if the input is avaible/correct //Code to check if the input is avaible/correct Any one please help this fine tuning. Quote
Question
OnNplay
The script will be placed in the item. Closer to this purpose is Megaphone.
I want selected item will make @item for the selected account id.
When the character of the account id click on it will get input box.
The input box will collect the item name or item code and quantity.
So the character will get the item.
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.