ajaytrix Posted August 15, 2013 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 84 Reputation: 0 Joined: 03/29/12 Last Seen: February 15, 2017 Share 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 Link to comment Share on other sites More sharing options...
Capuche Posted August 15, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
Yoona Posted August 15, 2013 Group: Members Topic Count: 153 Topics Per Day: 0.03 Content Count: 567 Reputation: 18 Joined: 04/15/13 Last Seen: April 21, 2016 Share Posted August 15, 2013 yes, check the guide here. Quote Link to comment Share on other sites More sharing options...
Patskie Posted August 15, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 4 hours ago Share Posted August 15, 2013 - script trial -1,{ OnInit: bindatcmd "test",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: addrid(1); getitem <id>,<amount>; end; } Quote Link to comment Share on other sites More sharing options...
ajaytrix Posted August 15, 2013 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 84 Reputation: 0 Joined: 03/29/12 Last Seen: February 15, 2017 Author Share 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 Link to comment Share on other sites More sharing options...
Yoona Posted August 15, 2013 Group: Members Topic Count: 153 Topics Per Day: 0.03 Content Count: 567 Reputation: 18 Joined: 04/15/13 Last Seen: April 21, 2016 Share 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 Link to comment Share on other sites More sharing options...
Patskie Posted August 15, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 4 hours ago Share Posted August 15, 2013 http://rathena.org/wiki/Getitem Quote Link to comment Share on other sites More sharing options...
ajaytrix Posted August 15, 2013 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 84 Reputation: 0 Joined: 03/29/12 Last Seen: February 15, 2017 Author Share 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 Link to comment Share on other sites More sharing options...
Patskie Posted August 15, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 4 hours ago Share 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 Link to comment Share on other sites More sharing options...
ajaytrix Posted August 18, 2013 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 84 Reputation: 0 Joined: 03/29/12 Last Seen: February 15, 2017 Author Share 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 Link to comment Share on other sites More sharing options...
Emistry Posted August 18, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Thursday at 04:49 PM Share Posted August 18, 2013 OnAtcommand: if( getgmlevel() < 90 ) end; Quote Link to comment Share on other sites More sharing options...
ajaytrix Posted August 18, 2013 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 84 Reputation: 0 Joined: 03/29/12 Last Seen: February 15, 2017 Author Share Posted August 18, 2013 Thank you for Ma'am Yoona Sir Patskie Sir EmistryAnd specially Sir Capuche Thank you again! Quote Link to comment Share on other sites More sharing options...
Capuche Posted August 18, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted August 18, 2013 or *bindatcmd "command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; bindatcmd "test",strnpcinfo(3)+"::OnAtcommand",60,60; Quote Link to comment Share on other sites More sharing options...
Yoona Posted September 3, 2013 Group: Members Topic Count: 153 Topics Per Day: 0.03 Content Count: 567 Reputation: 18 Joined: 04/15/13 Last Seen: April 21, 2016 Share 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 Link to comment Share on other sites More sharing options...
Capuche Posted September 4, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted September 4, 2013 I don't understand your question. May you reformulate it? Quote Link to comment Share on other sites More sharing options...
Yoona Posted September 4, 2013 Group: Members Topic Count: 153 Topics Per Day: 0.03 Content Count: 567 Reputation: 18 Joined: 04/15/13 Last Seen: April 21, 2016 Share 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 Link to comment Share on other sites More sharing options...
Capuche Posted September 4, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
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?
Link to comment
Share on other sites
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.