Jump to content
  • 0

Vip system problem.


Mihael

Question


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  130
  • Reputation:   70
  • Joined:  09/03/14
  • Last Seen:  

Hi everyone, I'm using this vip system:

function	script	getPremium	{
	set .@ticks, getarg(0);
	if (.@ticks <= 0) {
		debugmes "getPremium - tried to set a timer in the past";
		end;
}
	set #prmm, ((#prmm > gettimetick(2))? #prmm : gettimetick(2)) + .@ticks;
	doevent "login::OnPCLoginEvent";
	return;
 }

-	script	login	-1,{
OnPCLoginEvent:
	if (prmm > gettimetick(2)) {
	dispbottom "Your Premium Service will expire after " + callfunc("Time2Str",prmm);
	//sc_start SC_EXPBOOST,(( prmm - gettimetick(2) ) * 1000 ),200;
	//sc_start SC_JEXPBOOST,(( prmm - gettimetick(2) ) * 1000 ),200;
	//sc_start SC_ITEMBOOST,(( prmm - gettimetick(2) ) * 1000 ),100;
	atcommand "@adjgroup 1 "+strcharinfo(0);
	deltimer strnpcinfo(3)+"::OnPCLoginEvent";
	if ((prmm - gettimetick(2)) < 2147483) {
		addtimer (prmm - gettimetick(2)) *1000, strnpcinfo(3)+"::OnPCLoginEvent";
	} else {
		addtimer 2147483000, strnpcinfo(3)+"::OnPCLoginEvent";
	}
} else if (prmm) {
	atcommand "@adjgroup 0 "+strcharinfo(0);
	sc_end SC_EXPBOOST;
	sc_end SC_JEXPBOOST;
	sc_end SC_ITEMBOOST;
	set prmm, 0;
	message strcharinfo(0),"[ VIP ]: -- Your account vip expired.";
}
end;
}
-	script	atcmd23	-1,{
OnAtcommand:
message strcharinfo(0),"[ VIP ]: -- You have more time vip > " + callfunc("Time2Str",prmm);
end;

OnInit:	bindatcmd "vip",strnpcinfo(3)+"::OnAtcommand"; end; 

}

and this ticket vip:

{
	Id: 32249
	AegisName: "Gold_Card"
	Name: "Ticket 7 Days VIP"
	Type: "IT_HEALING"
	Buy: 10
	Weight: 10
	Trade: {
		nodrop: true
		nocart: true
		nostorage: true
		nogstorage: true
		nomail: true
		noauction: true
	}
	Script: <"
	callfunc "getPremium", 7 * 24 * 3600;
	">
},

but he is not adding up the days of the player's vip account.

if I use the ticket several times it grants only 7 days vip, instead of adding 7 + 7 + 7 + 7 + 7 days for example.

Spoiler

rs94hZO.png

KmceMb2.png

How do I solve this?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

you set it as account variable which is "#".

set #prmm, ((#prmm > gettimetick(2))? #prmm : gettimetick(2)) + .@ticks;

but you used a character variable on this line to check.

if (prmm > gettimetick(2))

also, if you will use the vip system. use vip_status and vip_time as it will automatically changed the players group to 5.

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

 

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

look like your item db is herc's item db

are you using rAthena ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  130
  • Reputation:   70
  • Joined:  09/03/14
  • Last Seen:  

On 6/18/2019 at 2:54 PM, Haruka Mayumi said:

you set it as account variable which is "#".


set #prmm, ((#prmm > gettimetick(2))? #prmm : gettimetick(2)) + .@ticks;

but you used a character variable on this line to check.


if (prmm > gettimetick(2))

also, if you will use the vip system. use vip_status and vip_time as it will automatically changed the players group to 5.


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

 

Many thanks, I'll check it out!

On 6/18/2019 at 4:10 PM, sader1992 said:

look like your item db is herc's item db

are you using rAthena ?

Actually my emulator is a modified old rAthena. I am studying the use of some old variables in it.

Solved, ty ❤️

image.thumb.png.dd761a040ec44b6603e2a72c61853d2e.png

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