Need Help Daily Reward Auto Restart when 6Am

ahmadshidqi

New member
Messages
48
Points
0
Can you help me? i want to make a script.. "every 6am the script auto reset"

my script

Code:
-	script	dailyrewards	-1,{OnPCLoginEvent:getmapxy .@map$, .@x, .@y, 0;if ( .@map$=="invek" ) {if( #Daily != gettime(5) ){set .@point_amt, 25;set #CASHPOINTS, #CASHPOINTS + .@point_amt;dispbottom "Gained Daily Cash 25...";dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints";set #Daily,gettime(5);}}end;}
 
Last edited by a moderator:
Please help my script
default_wink.png


 
Last edited by a moderator:
I wouldn't break my mind and simply use a SQL query:

- script dailyrewards -1,{OnPCLoginEvent: getmapxy .@map$, .@x, .@y, 0; if ( .@map$=="invek" ) { if( #Daily != gettime(5) ) { set .@point_amt, 25; set #CASHPOINTS, #CASHPOINTS + .@point_amt; dispbottom "Gained Daily Cash 25..."; dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints"; set #Daily,gettime(5); } } end;OnHour06: query_sql("DELETE FROM `acc_reg_num_db` WHERE `key` = '#Daily'"); end;}  Be warned I didn't test this script, so this may cause unwanted deletion of vars. Try it first on a test server with a backup of your DB.

 
Last edited by a moderator:
I wouldn't break my mind and simply use a SQL query:

- script dailyrewards -1,{OnPCLoginEvent: getmapxy .@map$, .@x, .@y, 0; if ( .@map$=="invek" ) { if( #Daily != gettime(5) ) { set .@point_amt, 25; set #CASHPOINTS, #CASHPOINTS + .@point_amt; dispbottom "Gained Daily Cash 25..."; dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints"; set #Daily,gettime(5); } } end;OnHour06: query_sql("DELETE FROM `acc_reg_num_db` WHERE `key` = '#Daily'"); end;}  Be warned I didn't test this script, so this may cause unwanted deletion of vars. Try it first on a test server with a backup of your DB.
stil not worki sir :'(

 
Last edited by a moderator:
try this

Code:
/*create table itemperacc (`account_id` int(11) unsigned NOT NULL primary key) engine = innodb;*/-	script	dailyrewards	-1,{OnPCLoginEvent:	getmapxy .@map$, .@x, .@y, 0; 	if ( .@map$=="invek" ) {		if ( !query_sql( "select account_id  from `itemperacc` where account_id ="+ getcharid(3) , .@acc ) ) {			set #CASHPOINTS, #CASHPOINTS + .@point_amt;			dispbottom "Gained Daily Cash 25...";			dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints";			 query_sql "insert into `itemperacc` values ( "+getcharid(3)+" )";		}	}	end;OnHour06:	query_sql "truncate itemperacc";	end;}
 
Last edited by a moderator:
try this

/*create table itemperacc (`account_id` int(11) unsigned NOT NULL primary key) engine = innodb;*/- script dailyrewards -1,{OnPCLoginEvent: getmapxy .@map$, .@x, .@y, 0; if ( .@map$=="invek" ) { if ( !query_sql( "select account_id from `itemperacc` where account_id ="+ getcharid(3) +", .@acc ) ) { set #CASHPOINTS, #CASHPOINTS + .@point_amt; dispbottom "Gained Daily Cash 25..."; dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints"; query_sql "insert into `itemperacc` values ( "+getcharid(3)+" )"; } } end;OnHour06: query_sql "truncate itemperacc"; end;}
error script sir...

Untitled_zps4bfc866b.png


 
fixed typo, try again

Code:
/*create table itemperacc (`account_id` int(11) unsigned NOT NULL primary key) engine = innodb;*/-	script	dailyrewards	-1,{OnPCLoginEvent:	getmapxy .@map$, .@x, .@y, 0; 	if ( .@map$=="invek" ) {		if ( !query_sql( "select account_id  from `itemperacc` where account_id ="+ getcharid(3) , .@acc ) ) {			set #CASHPOINTS, #CASHPOINTS + .@point_amt;			dispbottom "Gained Daily Cash 25...";			dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints";			 query_sql "insert into `itemperacc` values ( "+getcharid(3)+" )";		}	}	end;OnHour06:	query_sql "truncate itemperacc";	end;}
 
fixed typo, try again

/*create table itemperacc (`account_id` int(11) unsigned NOT NULL primary key) engine = innodb;*/- script dailyrewards -1,{OnPCLoginEvent: getmapxy .@map$, .@x, .@y, 0; if ( .@map$=="invek" ) { if ( !query_sql( "select account_id from `itemperacc` where account_id ="+ getcharid(3) , .@acc ) ) { set #CASHPOINTS, #CASHPOINTS + .@point_amt; dispbottom "Gained Daily Cash 25..."; dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints"; query_sql "insert into `itemperacc` values ( "+getcharid(3)+" )"; } } end;OnHour06: query_sql "truncate itemperacc"; end;}
thanks sir... after i test this script i report again
default_wink.png
..

 
Back
Top