Jump to content
  • 0

Credit Exchange with Timer


Aeia

Question


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  63
  • Reputation:   1
  • Joined:  09/18/12
  • Last Seen:  

Hello everyone,

I would like to ask for a request on how will I add a timer for the credits exchange.

If the user will exchange their zeny to credits, there'll be a delay before the user can exchange his zeny to credits again.

But if the user will exchange their credits to zeny, there'll be no delay on exchange.

The delay on exchange will be applied on the whole account.

The duration of the exchange delay is for 12hours. ( So the user can only exchange a maximum of 200Credits(2billion) every 12hours )

If ever the user exchange only 300m, he/she will still need to wait for 12hours before he/she can exchange again.

 

Here's the script ( From DaemonSpade )
 

prontera,158,192,3	script	Credit Exchanger	504,{

//====================================[Customization Area]==========================//
		set .npcname$,"^0000EE[Credit Exchanger]^000000"; //NPC Name
		set .coinname$,"^0000EECredit^000000"; //Name of Item as Coin Used
		set .CoinID,30005; // Credit ID Set to Red Potion
		set .zeny,10000000; // Credit Price Set by 10,000,000 or 10m
		set .capzeny,2000000000; //Zeny Capacity Set by 2,000,000,000 or 2b
//==============================================================================//
// Check Line 89 To Edit The Chat/Pub Name Like This:
//		waitingroom "Credit Exchanger",0;
//==============================================================================//

		PlayerMode:
		mes .npcname$;
		mes "Hello there "+strcharinfo(0);
		mes "Rule's Of Exchange";
		mes "1 ^0000EE"+.coinname$+"^000000 is [^0000EE"+.zeny+"z^000000]";
		mes "Zeny Exchange Capacity is [^0000EE"+.capzeny+"z^000000]";
		switch(select("(Credits) to (Zeny):(Zeny) to (Credits)")) {
	Case 1:
		next;
		mes .npcname$;	
		mes "How many Credits to exchange?";
		mes "Put The Credit Amount";
		mes "Put  ^0000EE[0]^000000 to Cancel";
		mes "1 ^0000EE"+.coinname$+"^000000 is [^0000EE"+.zeny+"z^000000]";
		mes "Zeny Exchange Capacity is [^0000EE"+.capzeny+"z^000000]";
		next;
		do{
		input @Credit,0,countitem(.CoinID);
		if( @Credit < 1 ) close;
		}while( ( ( @Credit * .zeny ) + Zeny ) > .capzeny );
		next;
		mes .npcname$;
		mes "Thanks";
		delitem .CoinID,@Credit;
		set Zeny, Zeny + ( @Credit * .zeny );
		dispbottom "Zeny Exchange Finished";
		close;

	Case 2:
		next;
		mes .npcname$;	
		mes "How much Credit you like to Gain?";
		mes "Put The Credit Amount";
		mes "Put  ^0000EE[0]^000000 to Cancel";
		mes "1 ^0000EE"+.coinname$+"^000000 is [^0000EE"+.zeny+"z^000000]";
		mes "Zeny Exchange Capacity is [^0000EE"+.capzeny+"z^000000]";
		next;
		input @Credit,0,( Zeny / .zeny );
		if( @Credit < 1 ) close;
		next;
		mes .npcname$;
		mes "Thanks.";
		set Zeny, Zeny - ( @Credit * .zeny);
		getitem .CoinID,@Credit;
		dispbottom "Credit Exchange Finished";
		close;
		end;
	}
close;
}

Thank you in advance!

Edited by Aeia
Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  1479
  • Reputation:   172
  • Joined:  12/14/11
  • Last Seen:  

[paste=1lc4qc68ig0]

 

known bug: if player a's ban will be lifted on 13:25 PM, and he's online since 13:00 PM, when the time is at least 13:27 PM, he will still be banned. to fix this: ask him to relogin.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...