SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 03/02/2020, 07:59 AM   #1
Istrator
Big Clucker
 
Join Date: Dec 2017
Posts: 50
Reputation: 0
Default VIP Timer Help!

I'm making a timer on my VIP System but the problem is: when the date is January 30 and I try to purchase a VIP on it, it makes the VIP Expiry to March 30 instead of February 29/28 or March 1. Please help me, it will mean a lot!

Hint:
smonth = number of months for the VIP
lmonth = used for getdate(lyear, lmonth, lday);
lday = used for getdate(lyear, lmonth, lday);
vMonth = Month number where the VIP Expires
vDay = Day number where the VIP Expires
Code:
if(smonth == 1)//1 month VIP
{
	if(lmonth == 1 && lday == 30)//January 30
	{
		pInfo[targetid][vMonth] = 3;//Making it March
		pInfo[targetid][vDay] = 1;//Making it 1
	}
}
Istrator is offline   Reply With Quote
Old 03/02/2020, 08:09 AM   #2
OsmanMalagic
Little Clucker
 
Join Date: Jul 2016
Location: EX-YU
Posts: 34
Reputation: 51
Default Re: VIP Timer Help!

Quote:
Originally Posted by Istrator View Post
I'm making a timer on my VIP System but the problem is: when the date is January 30 and I try to purchase a VIP on it, it makes the VIP Expiry to March 30 instead of February 29/28 or March 1. Please help me, it will mean a lot!

Hint:
smonth = number of months for the VIP
lmonth = used for getdate(lyear, lmonth, lday);
lday = used for getdate(lyear, lmonth, lday);
vMonth = Month number where the VIP Expires
vDay = Day number where the VIP Expires
Code:
if(smonth == 1)//1 month VIP
{
	if(lmonth == 1 && lday == 30)//January 30
	{
		pInfo[targetid][vMonth] = 3;//Making it March
		pInfo[targetid][vDay] = 1;//Making it 1
	}
}
Did you try this ?

PHP Code:
if(smonth == 1)//1 month VIP
{
    if(
lmonth == && lday == 30)//January 30
    
{
        
lday 29// 29 days
        
pInfo[targetid][vMonth] = 2;//Making it February
        
pInfo[targetid][vDay] = 1;//Making it 1
    
}

OsmanMalagic is offline   Reply With Quote
Old 03/02/2020, 08:18 AM   #3
Istrator
Big Clucker
 
Join Date: Dec 2017
Posts: 50
Reputation: 0
Default Re: VIP Timer Help!

Quote:
Originally Posted by OsmanMalagic View Post
Did you try this ?

PHP Code:
if(smonth == 1)//1 month VIP
{
    if(
lmonth == && lday == 30)//January 30
    
{
        
lday 29// 29 days
        
pInfo[targetid][vMonth] = 2;//Making it February
        
pInfo[targetid][vDay] = 1;//Making it 1
    
}

Thanks for helping, because of you it works now! +REP'ed!
Istrator is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timer ID stored in a variable gets wiped when timer hits ? NeXoR Scripting Help 2 25/03/2017 07:22 PM
Performance Question , Per Player Timer vs Timer that loops through all players BiosMarcel Scripting Help 14 12/12/2016 09:50 AM
If /foodsearch doesn't find item, set wait timer (TIMER HELP) Josh_Main Scripting Help 7 14/09/2016 04:13 PM
Which is better Per Player Timer or Global timer? (issue with timer) Dokins Scripting Help 4 07/06/2016 09:50 AM
Slice's Timer Fix include --> timer public function isn't getting called Riwerry Scripting Help 0 02/01/2016 03:50 PM


All times are GMT. The time now is 12:20 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.