Jump to content
  • 0

Oficial VIP remaining time display


Profile

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  04/15/17
  • Last Seen:  

Hi, I have been trying to figure out how to display to users their remaining VIP account time.

However, I wasn't able to figure out how to do it.

From what I see, VIP time is stored in the login database as "vip_time", however, the numbers which are displayed there are confusing.

I have managed to create a script to "Add VIP time" using:

atcommand "@vip +24h "+strcharinfo(0)+"";

But how can I display how much VIP time is left for the account each time the user logs in?

I noticed that whenever I use the script above, it bottomdisplays my VIP time remaining, where can I find this code? Is it possible to modify the text it currently displays?

vip.png.b68aec10876e459eb7f98ce4ec16cc65.png

Thanks!

Edited by Profile
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  76
  • Reputation:   4
  • Joined:  11/15/11
  • Last Seen:  

callfunc ("Time2Str",vip_status(2))

use this on the time left part

Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  04/15/17
  • Last Seen:  

I have solved the issue after playing with the code for a while.

Here is my solution:

-	script	VIP_TIME	-1,{
OnPCLoginEvent:
		if (vip_status(1)) {
			dispbottom "Your VIP expires on : "+vip_status(2);
			dispbottom "Time left : "+vip_status(3);
			end;
		}
	}

Is it possible to change the time/date format?

This is how it is currently:

vip2.png.88eb52ce98eed7e1c4518fcb901dc25f.png

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  75
  • Reputation:   7
  • Joined:  08/10/17
  • Last Seen:  

Spoiler
---------------------------------------
   
  *vip_status(<type>,{"<character name>"})
   
  Returns various information about a player's VIP status.
   
  Valid types:
  VIP_STATUS_ACTIVE - VIP status: true if the player is a VIP or false if not
  VIP_STATUS_EXPIRE - VIP expire timestamp if the player is VIP or 0 if not
  VIP_STATUS_REMAINING - VIP time remaining in seconds
   
  NOTE: This command is only available if the VIP System is enabled.
   
  ---------------------------------------
   
  *vip_time <time>,{"<character name>"};
   
  Changes a player's VIP time (in minutes). A positive value will increase time, and a
  negative value will decrease time.
   
  NOTE: This command is only available if the VIP System is enabled.
   
  ---------------------------------------

source: https://github.com/rathena/rathena/blob/master/doc/script_commands.txt

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  04/15/17
  • Last Seen:  

36 minutes ago, SpiritD said:
  Reveal hidden contents
---------------------------------------
   
  *vip_status(<type>,{"<character name>"})
   
  Returns various information about a player's VIP status.
   
  Valid types:
  VIP_STATUS_ACTIVE - VIP status: true if the player is a VIP or false if not
  VIP_STATUS_EXPIRE - VIP expire timestamp if the player is VIP or 0 if not
  VIP_STATUS_REMAINING - VIP time remaining in seconds
   
  NOTE: This command is only available if the VIP System is enabled.
   
  ---------------------------------------
   
  *vip_time <time>,{"<character name>"};
   
  Changes a player's VIP time (in minutes). A positive value will increase time, and a
  negative value will decrease time.
   
  NOTE: This command is only available if the VIP System is enabled.
   
  ---------------------------------------

source: https://github.com/rathena/rathena/blob/master/doc/script_commands.txt

I did check it out, still didn't help much...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  75
  • Reputation:   7
  • Joined:  08/10/17
  • Last Seen:  

57 minutes ago, Profile said:

I did check it out, still didn't help much...

Can you post a little more information? Post the script you are using, any error message, etc.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  05/22/23
  • Last Seen:  

On 16/09/2017 at 18:22, Profile said:

Eu resolvi o problema depois de brincar com o código por um tempo.

Aqui está a minha solução:



		  
		
	

É possível alterar o formato de hora/data?

Atualmente é assim:

vip2.png.88eb52ce98eed7e1c4518fcb901dc25f.png

Ola amigo, sou novato na area estou aprendendo, ai como eu adiciono ao meu servidor? tipo como eu crio um comando pro player ver o time vip?

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