ajaytrix Posted August 15, 2013 Posted August 15, 2013 - script trial -1,{ OnInit: bindatcmd "test",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: addrid(1); end; } Is this correct? I want to make @test command by using "addrid" to give items to all players within the map, server,guild,party, just like @itemmap. Anyone help me with this one? Quote
Capuche Posted August 15, 2013 Posted August 15, 2013 It's better to check if the item id exist and if the amount > 0 also about getitem the values must be integer values A sample - script trial -1,{ OnInit: bindatcmd "test",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: if ( .@atcmd_numparameters != 2 ) { message .@myname$, "Usage: "+ .@atcmd_command$ +" <item id> <amount>"; end; } .atoi_id = atoi( .@atcmd_parameters$[0] ); .atoi_amount = atoi( .@atcmd_parameters$[1] ); .@myname$ = strcharinfo(0); if ( getiteminfo( .atoi_id,0 ) == -1 ) { message .@myname$, "Requesting to send an non-existing item ("+ .atoi_id +"). "+ .@atcmd_command$ +" failed."; end; } else if ( .atoi_amount < 1 ) { message .@myname$, "You can't send "+ .atoi_amount +" item. "+ .@atcmd_command$ +" failed."; end; } addrid(1); getitem .atoi_id, .atoi_amount; end; } getiteminfo + atoi EDIT : fix an error Quote
Patskie Posted August 15, 2013 Posted August 15, 2013 - script trial -1,{ OnInit: bindatcmd "test",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: addrid(1); getitem <id>,<amount>; end; } Quote
ajaytrix Posted August 15, 2013 Author Posted August 15, 2013 - script trial -1,{ OnInit: bindatcmd "test",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: addrid(1); getitem <id>,<amount>; end; } I don't know what to put in line 7. the "<" What should I put sir? Quote
Yoona Posted August 15, 2013 Posted August 15, 2013 it should be like this getitem 501,100; it gives 100pcs Apple's on all the players on the map Quote
ajaytrix Posted August 15, 2013 Author Posted August 15, 2013 http://rathena.org/wiki/Getitem it should be like this getitem 501,100; it gives 100pcs Apple's on all the players on the map So meaning @test is just for only specific items? I cannot make it in game like: @test 607 1 @test 671 1 Quote
Patskie Posted August 15, 2013 Posted August 15, 2013 http://rathena.org/wiki/Getitem >>it should be like this getitem 501,100; it gives 100pcs Apple's on all the players on the map So meaning @test is just for only specific items? I cannot make it in game like: @test 607 1 @test 671 1 If you want it that way, you can try this : // @test <item id> <amount> - script trial -1,{ OnInit: bindatcmd "test",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: if ( .@atcmd_numparameters != 2 ) end; addrid(1); getitem .@atcmd_parameters$[0], .@atcmd_parameters$[1]; end; } Quote
ajaytrix Posted August 18, 2013 Author Posted August 18, 2013 - script trial -1,{ OnInit: bindatcmd "test",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: if ( .@atcmd_numparameters != 2 ) { message .@myname$, "Usage: "+ .@atcmd_command$ +" <item id> <amount>"; end; } .atoi_id = atoi( .@atcmd_parameters$[0] ); .atoi_amount = atoi( .@atcmd_parameters$[1] ); .@myname$ = strcharinfo(0); if ( getiteminfo( .atoi_id,0 ) == -1 ) { message .@myname$, "Requesting to send an non-existing item ("+ .atoi_id +"). "+ .@atcmd_command$ +" failed."; end; } else if ( .atoi_amount < 1 ) { message .@myname$, "You can't send "+ .atoi_amount +" item. "+ .@atcmd_command$ +" failed."; end; } addrid(1); getitem .atoi_id, .atoi_amount; end; } @sir Capuche, can you please put a getgmlevel command? Quote
Emistry Posted August 18, 2013 Posted August 18, 2013 OnAtcommand: if( getgmlevel() < 90 ) end; Quote
ajaytrix Posted August 18, 2013 Author Posted August 18, 2013 Thank you for Ma'am Yoona Sir Patskie Sir EmistryAnd specially Sir Capuche Thank you again! Quote
Capuche Posted August 18, 2013 Posted August 18, 2013 or *bindatcmd "command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; bindatcmd "test",strnpcinfo(3)+"::OnAtcommand",60,60; Quote
Yoona Posted September 3, 2013 Posted September 3, 2013 or *bindatcmd "command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; bindatcmd "test",strnpcinfo(3)+"::OnAtcommand",60,60; Excuse me Capuche, i tried to use the script but i have a question.. why is it that when i tried to use it again? its not working anymore.. just once? Quote
Capuche Posted September 4, 2013 Posted September 4, 2013 I don't understand your question. May you reformulate it? Quote
Yoona Posted September 4, 2013 Posted September 4, 2013 I don't understand your question. May you reformulate it? oh, sorry:) My question, why is it that when i use the command for the second time it wont work Quote
Capuche Posted September 4, 2013 Posted September 4, 2013 Try the final version. Check if you have any error on your mapserv. - script trial -1,{ OnInit: bindatcmd "test",strnpcinfo(3)+"::OnAtcommand",60,60; end; OnAtcommand: if ( .@atcmd_numparameters != 2 ) { message .@myname$, "Usage: "+ .@atcmd_command$ +" <item id> <amount>"; end; } .atoi_id = atoi( .@atcmd_parameters$[0] ); .atoi_amount = atoi( .@atcmd_parameters$[1] ); .@myname$ = strcharinfo(0); if ( getiteminfo( .atoi_id,0 ) == -1 ) { message .@myname$, "Requesting to send an non-existing item ("+ .atoi_id +"). "+ .@atcmd_command$ +" failed."; end; } else if ( .atoi_amount < 1 ) { message .@myname$, "You can't send "+ .atoi_amount +" item. "+ .@atcmd_command$ +" failed."; end; } addrid(1); getitem .atoi_id, .atoi_amount; end; } Quote
Question
ajaytrix
Is this correct? I want to make @test command by using "addrid" to give items to all players within the map, server,guild,party, just like @itemmap.
Anyone help me with this one?
16 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.