Jump to content
  • 0
MyNoobScriptz

time left of VIP status

Question

-	script	VIP_STATUSs	-1,{
OnPCLoginEvent:
	if ( vip_status(1) ) {
			dispbottom "========================";
			dispbottom "Account Status : VIP";
			dispbottom "Expire Date : "+vip_status(2);
			dispbottom "Time left : "+vip_status(3);
			dispbottom "========================";
      end;
	}
}


prontera,135,171,6	script	VIP System	109,{

if(getgmlevel()>=60){
	mes "[^0000FFSlave-sama^000000]";
	mes "Hello, Master, would you like to proceed with your official duties or view the player menu?";
	next;
	if(select("Take me to the GM menu!:I'd like to view the player menu.")==1) {
		mes "[^0000FFSlave-sama^000000]";
		mes "Alright, Master, please entire the characters name that you'd like to edit!";
		next;
		input([email protected]$);
		if(!getcharid(0,[email protected]$)) {
			mes "[^0000FFSlave-sama^000000]";
			mes "Master, I'm sorry but that character doesn't seem to exist.";
			emotion e_sob,0;
			close;
		}
		L_Menu:
		mes "[^0000FFSlave-sama^000000]";
		mes "So you'd like to modify ^0000FF"[email protected]$+"^000000, good choice!";
		mes "What would you like to do?";
		next;
		switch(select("Modify players time.:View players vip status.:I'm leaving!")){
			case 1:
				mes "[^0000FFSlave-sama^000000]";
				mes "Input a positive value in minutes to increase VIP status and a negative value to decrease it.";
				mes "Put 0 to return.";
				next;
				input([email protected]);
				if([email protected]) goto "L_Menu";
				vip_time [email protected],[email protected]$;
				mes "[^0000FFSlave-sama^000000]";
				mes "VIP time updated!";
				next;
				goto L_Menu;
			case 2:
				mes "[^0000FFSlave-sama^000000]";
				mes vip_status(1,[email protected]$)?"^0000FF"[email protected]$+" is currently a VIP Member.^000000":"^FF0000"[email protected]$+" is not a VIP Member.^000000";
				mes [email protected]$+"'s VIP status will expire on ^FF0000"+vip_status(2,[email protected]$)+"^000000";
				mes [email protected]$+" has "+vip_status(3,[email protected]$)+" remaining.";
				next;
				goto L_Menu;
			case 3:
				mes "[^0000FFSlave-sama^000000]";
				mes "Thank you Master please come again!";
				close;
		}
	}
}

mes "Hello, "+strcharinfo(0)+(vip_status(1)||getgmlevel()>=60?"-sama":"")+", what would you like to do?";
switch (select("Purchase VIP:View VIP Status:Explain")) {
	case 1:
		mes "[^0000FFHime-sama^000000]";
		mes "Here you can purchase VIP status for a number of days.";
		next;
		set @menu, select(.purchase$)-1;
		if(#CASHPOINTS<.cost[@menu]) {
			mes "[^0000FFHime-sama^000000]";
			mes "Look, you don't have enough money, so how about... YOU STOP WASTING MY TIME!";
			emotion e_pif,0;
			close;
		}
		mes "[^0000FFHime-sama^000000]";
		mes "You're now an official member of the VIP gang for "+.time[@menu]+" day(s). ^EE82EE<3^000000";
		set #CASHPOINTS, #CASHPOINTS-.cost[@menu];
		vip_time(.time[@menu]*1440);
		emotion e_lv,0;
		close;
	case 2:
		mes "[^0000FFHime-sama^000000]";
		mes vip_status(1)?"^0000FFYou're currently a VIP Member.^000000":"^FF0000You're not a VIP Member.^000000";
		mes "You're VIP status will expire on ^FF0000"+vip_status(2)+"^000000";
		mes "You have "+vip_status(3)+" remaining.";
		close;
	case 3:
		mes "[^0000FFHime-sama^000000]";
		mes "I'm a princess I shouldn't have to explain myself to you!";
		close;
}
end;

OnInit:
	setarray .time, 1, 10, 20, 30, 40; //Time in days.
	setarray .cost, 1, 10, 20, 30, 40; //Cash?
	for(set [email protected],0; [email protected]<getarraysize(.time); set [email protected],[email protected]+1)
		set .purchase$, .purchase$+.time[[email protected]]+" day(s) for "+.cost[[email protected]]+" cash.:";
}

hi, how can change time left (156598 remaining) to day - hour - min - sec. on this script

i use last rathena version

 

sdfsdf.png

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
//////////////////////////////////////////////////////////////////////////////////
// Returns time remaining in a readable format.
// The argument is subtracted from UNIX epoch time, or 'gettimetick(2)'.
// -- callfunc "Time2Str",<tick in UNIX epoch time>
// Example:
//    // Displays "Time left: 1 day, 1 hour, 8 minutes, 20 seconds"
//    set [email protected], gettimetick(2) + 90500;
//    mes "Time left: " + callfunc("Time2Str",[email protected]);
//////////////////////////////////////////////////////////////////////////////////

 

  • Upvote 1
Link to comment
Share on other sites

  • 0
13 hours ago, Ninja said:
//////////////////////////////////////////////////////////////////////////////////
// Returns time remaining in a readable format.
// The argument is subtracted from UNIX epoch time, or 'gettimetick(2)'.
// -- callfunc "Time2Str",<tick in UNIX epoch time>
// Example:
//    // Displays "Time left: 1 day, 1 hour, 8 minutes, 20 seconds"
//    set [email protected], gettimetick(2) + 90500;
//    mes "Time left: " + callfunc("Time2Str",[email protected]);
//////////////////////////////////////////////////////////////////////////////////

 

i try to use

-	script	VIP_STATUSs	-1,{
OnPCLoginEvent:
	if ( vip_status(1) ) {
			set [email protected], gettimetick(2) + 90500;
			dispbottom "========================";
			dispbottom "Account Status : VIP";
			dispbottom "Expire Date : " + callfunc("Time2Str",[email protected]);
			dispbottom "Time left : " + callfunc("Time2Str",[email protected]);
			dispbottom "========================";
      end;
	}
}

not work!!

time left still stand 1day 1hrs 8min 20sec. and is not time left of vip status

sdfsdf.png.2f47692878a415d7f82cce60b117b8d0.png

 

please guide me to use on this script

-	script	VIP_STATUSs	-1,{
OnPCLoginEvent:
	if ( vip_status(1) ) {
			dispbottom "========================";
			dispbottom "Account Status : VIP";
			dispbottom "Expire Date : "+vip_status(2);
			dispbottom "Time left : "+vip_status(3);
			dispbottom "========================";
      end;
	}
}

Oh!! done thx

Edited by rotloso
edit problem solve
Link to comment
Share on other sites

  • 0
On 30/7/2560 at 3:25 PM, Cinquedea said:

Hello. How were you able to fix this? 

Thanks!

my code

-	script	VIP_STATUSs	-1,{
OnPCLoginEvent:
	if ( vip_status(1) ) {
		//sc_start SC_EXPBOOST,1000*60*60*24,0;
			set [email protected], vip_status(2);
			dispbottom "You're VIP.";
			dispbottom "=============================================";
			dispbottom "Account Status : VIP Account";
			dispbottom "Account Status : Get more buff on healer npc";
			dispbottom "Account Status : Exp & Job Increase 50%";
			dispbottom "Account Status : Drop Increase 20%";
			dispbottom "Time left : "+ callfunc("Time2Str",[email protected]);
			dispbottom "============================================";
		end;
	}
}

can use only vip stastus(2)

u can try it

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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.