dantoki Posted November 12, 2021 Posted November 12, 2021 Hello Guys is someone have a coin exchanger with limitation every day? Example players can change coin for only 50 every day, it will reset every 12:00am. 10,000,000z + 1 DAILY_POINTS = 1 Platinum Coin (677). Quote
0 sader1992 Posted November 12, 2021 Posted November 12, 2021 this is a reference for you if(getd("#wqeqwe_" + gettime(DT_YYYYMMDD)) < .day_limit){ .@left = .day_limit - getd("#wqeqwe_" + gettime(DT_YYYYMMDD)); mes "Input how many"; input .@count,0,.@left; delitem .@coin,.@count; getitem .@new_coin,.@count; setd("#wqeqwe_" + gettime(DT_YYYYMMDD),getd("#wqeqwe_" + gettime(DT_YYYYMMDD)) + .@count); end; } mes "You cannot exchange anymore today!"; end; Quote
0 dantoki Posted November 14, 2021 Author Posted November 14, 2021 On 11/13/2021 at 12:57 AM, sader1992 said: this is a reference for you if(getd("#wqeqwe_" + gettime(DT_YYYYMMDD)) < .day_limit){ .@left = .day_limit - getd("#wqeqwe_" + gettime(DT_YYYYMMDD)); mes "Input how many"; input .@count,0,.@left; delitem .@coin,.@count; getitem .@new_coin,.@count; setd("#wqeqwe_" + gettime(DT_YYYYMMDD),getd("#wqeqwe_" + gettime(DT_YYYYMMDD)) + .@count); end; } mes "You cannot exchange anymore today!"; end; i done it but, maintown,193,173,5 script Coin Trader 117,{ function int__; do{ callsub exchange_rate; .@menu = select( "Zeny to Coin","Coin to Zeny","Close" ); switch( .@menu ){ Case 1: mes "Convert Zeny to which Coins ?"; .@coin = select( implode( .coin_name$,":" ) ) - 1; if( Zeny < .value[.@coin] ){ mes "^FF0000[ERROR]^000000 You didnt have enough zeny."; }else{ .@maximum = Zeny / .value[.@coin]; mes "You can get maximum of ^FF0000"+int__( .@maximum )+" x "+getitemname( .coin_id[.@coin] )+"^000000"; if(getd("#wqeqwe1_" + gettime(DT_YYYYMMDD)) < .day_limit){ .@left = .day_limit - getd("#wqeqwe1_" + gettime(DT_YYYYMMDD)); input .@amount,0,.@maximum; if( .@amount ) if( checkweight( .coin_id[.@coin],.@amount ) ){ .@total = ( .@amount * .value[.@coin] ); Zeny -= .@total; getitem .coin_id[.@coin],.@amount; setd("#wqeqwe1_" + gettime(DT_YYYYMMDD),getd("#wqeqwe1_" + gettime(DT_YYYYMMDD)) + .@amount); message strcharinfo(0),"Exchanged "+int__( .@total )+" Zeny to "+int__( .@amount )+" "+getitemname( .coin_id[.@coin] )+"^000000"; } } else{ mes "^FF0000[ERROR]^000000 You cant take this much."; } } break; Case 2: mes "Convert which Coins to Zeny ?"; .@coin = select( implode( .coin_name$,":" ) ) - 1; if( !countitem( .coin_id[.@coin] ) ){ mes "^FF0000[ERROR]^000000 You didnt have any "+getitemname( .coin_id[.@coin] )+"."; }else if( ( .max_zeny - Zeny ) < .value[.@coin] ){ mes "^FF0000[ERROR]^000000 You cant exchange this Coin as it will exceed the Zeny limit."; }else{ .@maximum = (( .max_zeny - Zeny ) / .value[.@coin] ); if( .@maximum > countitem( .coin_id[.@coin] ) ) .@maximum = countitem( .coin_id[.@coin] ); mes "You can exchange maximum of ^FF0000"+int__( .@maximum )+" x "+getitemname( .coin_id[.@coin] )+"^000000 to zeny"; input .@amount,0,.@maximum; if( .@amount ){ .@total = ( .@amount * .value[.@coin] ); Zeny += .@total; delitem .coin_id[.@coin],.@amount; message strcharinfo(0),"Exchanged "+int__( .@amount )+" "+getitemname( .coin_id[.@coin] )+" to "+int__( .@total )+" Zeny^000000"; } } break; default: break; } next; }while( .@menu != 3 ); mes "Thank you."; close; exchange_rate: mes "Exchange Rate :"; for( .@i = 0; .@i < .coin_size; .@i++ ) mes "^777777 > "+.coin_name$[.@i]+" - "+int__( .value[.@i] )+" z^000000"; return; OnInit: // server max zeny .max_zeny = 1000000000; .day_limit = 50; // coin list + name + value setarray .coin_name$,"Platinum Coin"; setarray .coin_id,677; setarray .value,10000000; .coin_size = getarraysize( .coin_name$ ); end; // credits to annieruru function int__ { set .@num, atoi(""+getarg(0)); if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0); set .@l, getstrlen(""+.@num); for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 ) { set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) + .@num$; if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set .@num$, ","+ .@num$; } return .@num$; } } yeah it stops when i already exchange more than 50, the problem is if i change 1st time of the day by 49 i records 49 and again if i change again 50 total of 99 it still accepts it. Quote
0 sader1992 Posted November 14, 2021 Posted November 14, 2021 17 hours ago, qtdan said: yeah it stops when i already exchange more than 50, the problem is if i change 1st time of the day by 49 i records 49 and again if i change again 50 total of 99 it still accepts it. I didn't understand but I guess you are talking about the .@left look how I used it in the example above, you assigned it in your script but you never used it Quote
Question
dantoki
Hello Guys is someone have a coin exchanger with limitation every day?
Example players can change coin for only 50 every day, it will reset every 12:00am.
10,000,000z + 1 DAILY_POINTS = 1 Platinum Coin (677).
3 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.