Posts: 158
	Threads: 50
	Joined: Jul 2016
	
Reputation: 
0
	 
	
	
		Hello guys, I have made a VIP system, I made it to give the player one month of vip when i /setvip him. I have already tested it. It said: expires in blablablabla 59 seconds then 56 seconds. Now, how to remove the player's vip lvl when it expires? Help please.
pInfo[playerid][VIPExpire] < Stores the expiry time. (Gettime + one month)
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 158
	Threads: 50
	Joined: Jul 2016
	
Reputation: 
0
	 
	
	
		I mean "how to remove his vip lvl when the vip expires" = How to check if the gettime is bigger than his VIPExpire, and if it is bigger = pInfo[playerid][VIP] = 0.
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 1,506
	Threads: 13
	Joined: Jun 2015
	
	
 
	
	
		Something like this can work.
PHP код:
funktion(playerid)
{
    if(/*get vip expire time*/ < getdate)
    {
        remove his vip level
    }
    else
    {
        new string[100], format(string, sizeof(string), "Your VIP level will expire on %d", vip level variable);
        SendClientMessage(playerid, -1, string);
    }
} 
 
	
		
	
 
 
	
	
	
		
	Posts: 1,506
	Threads: 13
	Joined: Jun 2015
	
	
 
	
	
		Use the function when a player connects or use a timer of 10 minutes thats a public or a global timer and loop through all the players and execute the function.
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 1,506
	Threads: 13
	Joined: Jun 2015
	
	
 
	
	
		Shinja, do you even know OnPlayerUpdate is called frequently and will cause lag, I am sure he wants to send a message to client when he removes the vip level, and if he sends the message in the OPU, it will spam the chat.