Raised This Month: $32 Target: $400
 8% 

(CS:GO) How can I find out the remaining vip time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FunTazzy
New Member
Join Date: Jan 2023
Old 02-24-2023 , 11:56   (CS:GO) How can I find out the remaining vip time
Reply With Quote #1

I need that after the command (Example: sm_viptime), the remaining vip time for the player is displayed in the chat
How can I get this time

p.s. Vip by RIKO

Last edited by FunTazzy; 02-24-2023 at 11:59.
FunTazzy is offline
MegoltElek
Junior Member
Join Date: Dec 2020
Old 02-24-2023 , 17:53   Re: (CS:GO) How can I find out the remaining vip time
Reply With Quote #2

The plugin stores the time of expire as a timestamp.
You only need 1 sql command to get the remaining timestamp.
like this:
PHP Code:
public Action:Cmd_viptime(int clientint argc)
{
    
char query[255];
    
//get client accountid here
    
Format(querysizeof(query), "select expires-UNIX_TIMESTAMP(NOW()) from vip_users where account_id='%d'",accountid);
    
SQL_TQuery(hDatabaseT_GetRemainingVipTimequeryclient);
}


public 
void T_GetRemainingVipTime(Handle ownerHandle hndl, const String:error[], int client)
{
    if (
hndl == INVALID_HANDLE)
    {
        
LogError("Query failed! %s"error);
    }
    if (
SQL_FetchRowCount(hndl))
    {
        
int timestamp=SQL_FetchInt(hndl,0);
        
int hours=timestamp/3600;
        
timestamp-=hours*3600;
        
int minutes=timestamp/60;
        
timestamp-=minutes*60;
        
int seconds=timestamp;
        
//use the variables as you want
    
}


Last edited by MegoltElek; 02-24-2023 at 18:04. Reason: .
MegoltElek is offline
sara03
New Member
Join Date: Mar 2023
Old 03-13-2023 , 16:33   Re: (CS:GO) How can I find out the remaining vip time
Reply With Quote #3

Quote:
Originally Posted by FunTazzy View Post
I need that after the command (Example: sm_viptime), the remaining vip time for the player is displayed in the chat
How can I get this time

p.s. Vip by RIKO

same here
sara03 is offline
sara03
New Member
Join Date: Mar 2023
Old 03-21-2023 , 05:44   Re: (CS:GO) How can I find out the remaining vip time
Reply With Quote #4

I need that after the command (Example: sm_viptime), the remaining vip time for the player is displayed in the chat
How can I get this time
Appvalley https://vlc.onl
p.s. Vip by RIKO

I got this,...
sara03 is offline
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

Forum Jump


All times are GMT -4. The time now is 04:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode