Jump to content
  • 0

time left of VIP status


MyNoobScriptz

Question


  • Group:  Members
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  74
  • Reputation:   3
  • Joined:  05/01/15
  • Last Seen:  

-	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(.@character$);
		if(!getcharid(0,.@character$)) {
			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"+.@character$+"^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(.@time);
				if(!.@time) goto "L_Menu";
				vip_time .@time,.@character$;
				mes "[^0000FFSlave-sama^000000]";
				mes "VIP time updated!";
				next;
				goto L_Menu;
			case 2:
				mes "[^0000FFSlave-sama^000000]";
				mes vip_status(1,.@character$)?"^0000FF"+.@character$+" is currently a VIP Member.^000000":"^FF0000"+.@character$+" is not a VIP Member.^000000";
				mes .@character$+"'s VIP status will expire on ^FF0000"+vip_status(2,.@character$)+"^000000";
				mes .@character$+" has "+vip_status(3,.@character$)+" 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 .@a,0; .@a<getarraysize(.time); set .@a,.@a+1)
		set .purchase$, .purchase$+.time[.@a]+" day(s) for "+.cost[.@a]+" 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

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

//////////////////////////////////////////////////////////////////////////////////
// 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 .@Timer, gettimetick(2) + 90500;
//    mes "Time left: " + callfunc("Time2Str",.@Timer);
//////////////////////////////////////////////////////////////////////////////////

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  74
  • Reputation:   3
  • Joined:  05/01/15
  • Last Seen:  

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 .@Timer, gettimetick(2) + 90500;
//    mes "Time left: " + callfunc("Time2Str",.@Timer);
//////////////////////////////////////////////////////////////////////////////////

 

i try to use

-	script	VIP_STATUSs	-1,{
OnPCLoginEvent:
	if ( vip_status(1) ) {
			set .@Timer, gettimetick(2) + 90500;
			dispbottom "========================";
			dispbottom "Account Status : VIP";
			dispbottom "Expire Date : " + callfunc("Time2Str",.@Timer);
			dispbottom "Time left : " + callfunc("Time2Str",.@Timer);
			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

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  31
  • Reputation:   0
  • Joined:  02/05/14
  • Last Seen:  

On 7/14/2017 at 11:11 AM, rotloso said:

Oh!! done thx

Hello. How were you able to fix this? 

Thanks!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  74
  • Reputation:   3
  • Joined:  05/01/15
  • Last Seen:  

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 .@Timer, 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",.@Timer);
			dispbottom "============================================";
		end;
	}
}

can use only vip stastus(2)

u can try it

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  09/29/21
  • Last Seen:  

can u share this script and SQL please

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