server crash when compile under MSVChttps://www.eathena.ws/board/index.php?s=&showtopic=272409&view=findpost&p=1492260out of curiosity ...
@Annie
return atoi( gettime(GETTIME_YEAR) + gettimestr("%m%d", 5) );why not use this?any drawback ??Code:return atoi( gettimestr("%Y%m%d", 9) );
---------------------------Microsoft Visual C++ Debug Library---------------------------Debug Assertion Failed!Program: D:RagnarokHerculesmap-server.exeFile: f:ddvctoolscrt_bldself_x86crtsrcstrftime.cLine: 798Expression: ( "Invalid format directive" , 0 )For information on how your program can cause an assertionfailure, see the Visual C++ documentation on asserts.(Press Retry to debug the application)---------------------------Abort Retry Ignore ---------------------------
Yes, but can you make it automatically that players can receive "point" or "item" at 00:00?@@Angelmelody
all right I open an issue in github
https://github.com/HerculesWS/Hercules/issues/1006
@@chiba222
EDITED: the full script already posted on post#2 isn't it ?
Sorry my post was unclear.set buyVIP, 0;and what is this mean ?you never say anything about VIP in your post
also, its bad idea to give items automatically in utility script
event script is 1 thing, since players usually under 90% weight (to whack monsters/pvp), thus can skip the *checkweight check
but in utility script has to use *checkweight script command every time
if you give items to player automatically at certain time without any notification,
like just give 10 berry at 12am automatically,
if the player at the time are adjusting equipment, using storage, ... etc
and caused overweight, the item will fall on the floor
Thank you.- script asdf 1_F_MARIA,{OnClock0000: getmemberaid ALL_CLIENT; for ( .@i = 0; .@i < $@onlinecount; ++.@i ) { attachrid $@onlineaid[.@i]; M_point = 3; buyVIP = 0; } query_sql "update char_reg_num_db set `value` = 3 where `key` = 'M_point'"; query_sql "insert ignore into char_reg_num_db select char_id, 'M_point', 0, 3 from `char` where account_id != 1"; query_sql "delete from char_reg_num_db where `key` = 'buyVIP'"; end;}you should know this kind of script is performance killer script
unless you really tell how that "M_point" and "buyVIP" come from,
then you can stick to this script that lags every time it runs
function script F_today {
return atoi( gettimestr( "%Y%m%d", 9 ) );
}
prontera,162,185,3 script VIPservice 1_F_MARIA,{
mes "[VIPservice]";
mes "Everyday only allow to buy 1 time";
next;
switch( select( "Exp rate x3", "Drop rate x3", "Cancel" ) ) {
case 1:
if ( callfunc("F_today") == buyexp ) {
mes "[VIPservice]";
mes "You have reached the purchasee limited";
mes "Please try it tomorrow.";
close;
}
buyexp = callfunc("F_today");
mes "Done. Enjoy your Exp rate x3";
sc_start SC_CASH_PLUSEXP, 30*60*1000, 300;
close;
case 2:
if ( callfunc("F_today") == buydrop ) {
mes "[VIPservice]";
mes "You have reached the purchasee limited";
mes "Please try it tomorrow.";
close;
}
buydrop = callfunc("F_today");
mes "Done. Enjoy your Drop rate x3";
sc_start SC_CASH_RECEIVEITEM, 30*60*1000, 300;
close;
default:
}
close;
}

Thank you so much!you know what ?
I'm going to show you the simplest way how to do this
function script F_today { return atoi( gettimestr( "%Y%m%d", 9 ) );}prontera,162,185,3 script VIPservice 1_F_MARIA,{ mes "[VIPservice]"; mes "Everyday only allow to buy 1 time"; next; switch( select( "Exp rate x3", "Drop rate x3", "Cancel" ) ) { case 1: if ( callfunc("F_today") == buyexp ) { mes "[VIPservice]"; mes "You have reached the purchasee limited"; mes "Please try it tomorrow."; close; } buyexp = callfunc("F_today"); mes "Done. Enjoy your Exp rate x3"; sc_start SC_CASH_PLUSEXP, 30*60*1000, 300; close; case 2: if ( callfunc("F_today") == buydrop ) { mes "[VIPservice]"; mes "You have reached the purchasee limited"; mes "Please try it tomorrow."; close; } buydrop = callfunc("F_today"); mes "Done. Enjoy your Drop rate x3"; sc_start SC_CASH_RECEIVEITEM, 30*60*1000, 300; close; default: } close;}abuse the battle manual and bubble gum cash item statushttps://github.com/HerculesWS/Hercules/blob/master/db/sc_config.txt#L162
93 = 64+16+8+4+1
= cannot be dispel, doesn't remove on death, persist after logout ...
PLUS ++
it also show the status icon on the client
screenRuru_Server041.jpg![]()
We use essential cookies to make this site work, and optional cookies to enhance your experience.