PewN Posted August 1, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Share Posted August 1, 2012 i have a request can anyone give who know more about src? like if he type @donate [ He will call a cashshop npc ] then this is my cash shop - cashshop donation -1,20200:50,20201:100 Quote Link to comment Share on other sites More sharing options...
clydelion Posted August 1, 2012 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted August 1, 2012 Index: atcommand.c =================================================================== --- atcommand.c (revision 16424) +++ atcommand.c (working copy) @@ -8580,6 +8580,19 @@ return 0; } +/*========================================== + * @donate + *------------------------------------------*/ +ACMD_FUNC(donate) +{ + struct npc_data *nd = npc_name2id("donate"); + + nullpo_retr(-1, sd); + + npc_click(sd,nd); + return 0; +} + /** * Fills the reference of available commands in atcommand DBMap **/ @@ -8590,6 +8603,7 @@ * Command reference list, place the base of your commands here **/ AtCommandInfo atcommand_base[] = { + ACMD_DEF(donate), ACMD_DEF2("warp", mapmove), ACMD_DEF(where), ACMD_DEF(jumpto), 1 Quote Link to comment Share on other sites More sharing options...
PewN Posted August 1, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted August 1, 2012 (edited) wow thx i will try it @clydelion. not showing when i type the command but my src is success! no error my cash shop -<tab>cashshop<tab>donate<tab>-1,20200:10,20201:50 Edited August 1, 2012 by bVersatile Quote Link to comment Share on other sites More sharing options...
clydelion Posted August 1, 2012 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted August 1, 2012 change npc_click(sd,nd); to clif_cashshop_show(sd,nd); Quote Link to comment Share on other sites More sharing options...
PewN Posted August 1, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted August 1, 2012 (edited) change npc_click(sd,nd); to clif_cashshop_show(sd,nd); wow Great! nice. this is my dreams command on my server thx! last request clydelion how can i do it call a script like when i type @donate [ he will callfunc a npc ] like this function<tab>script<tab>donate<tab>{ switch(select("Upper:Middle:Lower")){ case 1: close2; callshop "donate"; bl;ahlbah } Edited August 1, 2012 by bVersatile Quote Link to comment Share on other sites More sharing options...
clydelion Posted August 1, 2012 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted August 1, 2012 can you upload the whole script? Didn't really get your point. Quote Link to comment Share on other sites More sharing options...
Euphy Posted August 1, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted August 1, 2012 Use atcommand events, if you're updated. *bindatcmd "command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>};*bindatcmd("command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}); This command will bind a NPC event label to an atcommand. Upon execution of the atcommand, the user will invoke the NPC event label. Example: When a user types the command "@test", an angel effect will be shown. - script atcmd_example -1,{ OnInit: bindatcmd("test","atcmd_example::OnAtcommand"); end; OnAtcommand: specialeffect2 338; end; } Quote Link to comment Share on other sites More sharing options...
clydelion Posted August 1, 2012 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted August 1, 2012 Didn't know that Euphy. That's a better way though. Cool. Quote Link to comment Share on other sites More sharing options...
PewN Posted August 1, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted August 1, 2012 (edited) here when he type @donate [ callfunc "donate"; ] http://pastebin.com/raw.php?i=vk8M1tpE Edited August 1, 2012 by bVersatile Quote Link to comment Share on other sites More sharing options...
clydelion Posted August 1, 2012 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted August 1, 2012 - script donate -1,{ OnCommand: switch(select("Upper:Mid:Lower")){ case 1: close2; callshop "dupper",1; end; case 2: close2; callshop "dmid",1; end; case 3: close2; callshop "dlow",1; end; } } change the npc call part in atcommand.c to npc_event(sd,"donate::OnCommand",0); Quote Link to comment Share on other sites More sharing options...
PewN Posted August 1, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted August 1, 2012 - script donate -1,{ OnCommand: switch(select("Upper:Mid:Lower")){ case 1: close2; callshop "dupper",1; end; case 2: close2; callshop "dmid",1; end; case 3: close2; callshop "dlow",1; end; } } change the npc call part in atcommand.c to npc_event(sd,"donate::OnCommand",0); what i will change here? struct npc_data *nd = npc_name2id("donate"); or this clif_cashshop_show(sd,nd); ? Quote Link to comment Share on other sites More sharing options...
clydelion Posted August 1, 2012 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted August 1, 2012 the clif_cashshop_show(sd,nd); Quote Link to comment Share on other sites More sharing options...
PewN Posted August 1, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted August 1, 2012 (edited) how about this? struct npc_data *nd = npc_name2id("donate"); Edited August 1, 2012 by bVersatile Quote Link to comment Share on other sites More sharing options...
Euphy Posted August 1, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted August 1, 2012 @clydelion: So the way to do it without src would be~ - script donate -1,{ OnInit: bindatcmd("donate","donate::OnCommand"); end; OnCommand: switch(select("Upper:Mid:Lower")){ case 1: close2; callshop "dupper",1; end; case 2: close2; callshop "dmid",1; end; case 3: close2; callshop "dlow",1; end; } } Quote Link to comment Share on other sites More sharing options...
clydelion Posted August 1, 2012 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted August 1, 2012 @Euphy Do you still need to add @donate to src then it binds on it or bindatcmd creates a new command? Quote Link to comment Share on other sites More sharing options...
PewN Posted August 1, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted August 1, 2012 @clydelion: So the way to do it without src would be~ - script donate -1,{ OnInit: bindatcmd("donate","donate::OnCommand"); end; OnCommand: switch(select("Upper:Mid:Lower")){ case 1: close2; callshop "dupper",1; end; case 2: close2; callshop "dmid",1; end; case 3: close2; callshop "dlow",1; end; } } i will use it on other commands thx euphy Quote Link to comment Share on other sites More sharing options...
Euphy Posted August 1, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted August 1, 2012 Do you still need to add @donate to src then it binds on it or bindatcmd creates a new command? You don't need any src edits. It's ToastOfDoom's command, you can read more about it here: http://www.eathena.ws/board/index.php?showtopic=272578 Quote Link to comment Share on other sites More sharing options...
PewN Posted August 1, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted August 1, 2012 @Euphy Do you still need to add @donate to src then it binds on it or bindatcmd creates a new command? nothing happens clyd @Euphy Do you still need to add @donate to src then it binds on it or bindatcmd creates a new command? nothing happens clyd Quote Link to comment Share on other sites More sharing options...
clydelion Posted August 1, 2012 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted August 1, 2012 (edited) try Euphy's suggestion -<tab>script<tab>donate<tab>-1,{ OnInit: bindatcmd("donate","donate::OnCommand"); end; OnCommand: switch(select("Upper:Mid:Lower")){ case 1: close2; callshop "dupper",1; end; case 2: close2; callshop "dmid",1; end; case 3: close2; callshop "dlow",1; end; } } remove donate in atcommand.c Edited August 1, 2012 by clydelion Quote Link to comment Share on other sites More sharing options...
PewN Posted August 1, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted August 1, 2012 i love yours Quote Link to comment Share on other sites More sharing options...
clydelion Posted August 1, 2012 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted August 1, 2012 It works the same way xD Quote Link to comment Share on other sites More sharing options...
PewN Posted August 2, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.04 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted August 2, 2012 (edited) try Euphy's suggestion -<tab>script<tab>donate<tab>-1,{ OnInit: bindatcmd("donate","donate::OnCommand"); end; OnCommand: switch(select("Upper:Mid:Lower")){ case 1: close2; callshop "dupper",1; end; case 2: close2; callshop "dmid",1; end; case 3: close2; callshop "dlow",1; end; } } remove donate in atcommand.c cuz i want if he type @commands the donate there will show right! It works the same way xD not working. when i type @donate. unknown command this is what i said it error on bindatcmd im using it on rathena trunk 16113 i download the latest ra trunk 16538. and i got a problem. the call shop. call an other shop not my shop. i already change it but it the same:( Edited August 2, 2012 by bVersatile Quote Link to comment Share on other sites More sharing options...
Euphy Posted August 2, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted August 2, 2012 When you update, you have to recompile, too... Quote Link to comment Share on other sites More sharing options...
Question
PewN
i have a request
can anyone give who know more about src?
like if he type @donate [ He will call a cashshop npc ]
then this is my cash shop
- cashshop donation -1,20200:50,20201:100
Link to comment
Share on other sites
22 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.