guihleao 0 Posted September 19, 2015 (edited) Hello everyone, I need help setting the Cash Points for multiple servers. I have 3 map and char servers that use 1 login-server. How can I make all of these 3 map-servers read the same #CASHPOINTS variable? Thanks in advance! Edited September 19, 2015 by guihleao Quote Share this post Link to post Share on other sites
0 guihleao 0 Posted September 19, 2015 (edited) Okay, but that's in a script. I meant by the whole cash system. I believe I have to change the pc.c file, so that the Cash Shop and the command @cash read the new ## variable. I'm not sure if I should change only this file... For example, In pc.c // Cash shop sd->cashPoints = pc_readaccountreg(sd,script->add_str("#CASHPOINTS")); sd->kafraPoints = pc_readaccountreg(sd,script->add_str("#KAFRAPOINTS")); I think I should change to: // Cash shop sd->cashPoints = pc_readaccountreg(sd,script->add_str("##CASHPOINTS")); sd->kafraPoints = pc_readaccountreg(sd,script->add_str("##KAFRAPOINTS")); But I also think I need to change the " pc_readaccountreg" to read the global account, also there are some other modifications in this file I'd need to do. Am I right or just tripping? Thanks! Edited September 19, 2015 by guihleao Quote Share this post Link to post Share on other sites
0 evilpuncker 504 Posted September 19, 2015 "##" - A permanent global account variable stored by the login server. The only difference you will note from normal # variables is when you have multiple char-servers connected to the same login-server. The # variables are unique to each char-server, while the ## variables are shared by all these char-servers. Quote Share this post Link to post Share on other sites
0 guihleao 0 Posted September 19, 2015 (edited) Oh thanks! But how can I apply it to the cash system? For example, when I use the @cash command, or when I sell items through the Cash Shop... Does it need a source modification or do we have a setting somewhere? Edited September 19, 2015 by guihleao Quote Share this post Link to post Share on other sites
0 Emistry 145 Posted September 19, 2015 /* custom npc trader */prontera,153,152,1 trader TestCustom2 4_F_EDEN_OFFICER,{ OnInit: tradertype(NST_CUSTOM); sellitem Red_Potion,2; end;/* allows currency to be ##CASHPOINTS */OnCountFunds: setcurrency( ##CASHPOINTS ); end;/* receives @price (total cost) */OnPayFunds: if( ##CASHPOINTS < @points ) end; ##CASHPOINTS -= @points; purchaseok(); end;} https://github.com/HerculesWS/Hercules/blob/master/doc/sample/npc_trader_sample.txt Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted September 20, 2015 pc_readaccountreg2 Although it's for sake of readability Borh function calls the same thing and shouldn't matter.. Quote Share this post Link to post Share on other sites
0 guihleao 0 Posted September 20, 2015 pc_readaccountreg2 Although it's for sake of readability Borh function calls the same thing and shouldn't matter.. So I can just change it to ##CASHPOINTS ? Quote Share this post Link to post Share on other sites
0 guihleao 0 Posted September 20, 2015 Okay, I'll try it, thanks! Quote Share this post Link to post Share on other sites
0 kyeme 71 Posted September 20, 2015 I hope dev implement cashpoints in multiple serv http://herc.ws/board/tracker/issue-8715-official-cash-points/?gopid=25470#entry25470 Quote Share this post Link to post Share on other sites
0 guihleao 0 Posted September 21, 2015 That worked so far guys, thanks for helping! I hope dev implement cashpoints in multiple serv http://herc.ws/board/tracker/issue-8715-official-cash-points/?gopid=25470#entry25470 I totally agree! Quote Share this post Link to post Share on other sites
Hello everyone, I need help setting the Cash Points for multiple servers. I have 3 map and char servers that use 1 login-server. How can I make all of these 3 map-servers read the same #CASHPOINTS variable?
Thanks in advance!
Edited by guihleaoShare this post
Link to post
Share on other sites