themon Posted August 25, 2013 Posted August 25, 2013 (edited) User will get their Daily Hourly Bonus by every hourhttp://www.mediafire.com/?41ody4opst2ipzr hourlybonus.txt hourlybonus Array Version.txt Edited October 17, 2013 by themon Quote
Stolao Posted September 4, 2013 Posted September 4, 2013 Ok there are a few things about your script id like to advise you on, Firstly You use $DLogin , which is a global variable, once one person claims rewards no one else on server will be able to till following day Instead try using an account variable #DLogin and using an sql data wipe at 00:00 like so OnClock0000: set $DLogin,0; query_sql("DELETE FROM `global_reg_value` WHERE `str` = '#DLogin'"); set .@size, query_sql("select account_id from `char` where online = 1", .@aid); for(set .@i,0; .@i<.@size; set .@i,.@i+1) { if(attachrid(.@aid[.@i])){ set #DLogin,0; } } Announce "You can now claim your Daily Bonus!",8; end; Secondly Don't use goto, goto goto for the same code with a variable difference, instead make the script dynamic using arrays example if(#DLogin == 1){ mes "You had already received your gift today."; mes "Please! come back again tomorrow."; emotion e_bzz; close; } mes "Im glad to give you your Daily Bonus!"; next; switch(rand(5)){ // 1/rand will be items, rest will be zeny case 0: //Items // Card, Enchant, Healing, All items setarray .@Plow, 4001, 4700, 401, 501; setarray .@Phigh,4555, 4871, 599, 21005; set .@x, rand(getarraysize(.Plow)); set .@p, rand(.Plow[.@x],.PHigh[.@x]); while(getitemname(.@p) == "null"){ set .@p, rand(.Plow[.@x],.PHigh[.@x]); } if (checkweight(@claim,1) == 0 ){ mes "Sorry you are overweight!"; emotion e_bzz; close; } getitem .@p,1; Announce "" + strcharinfo(0) + " got " + getitemname(.@p) + "",8; break; default: //Zeny setarray .@x,5,10,50,100,500,1000,5000,100000,1000000; set .@p, .@x[rand(getarraysize(.@x))] * rand(1,50); set Zeny,zeny + .@p; Announce "" + strcharinfo(0) + " got " + .@p + "z!",8; break; } emotion e_thx; set #DLogin,1; close; Hope this helps~ Quote
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.