Raised This Month: $51 Target: $400
 12% 

Vip Riko module Time vip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alex2001
Member
Join Date: May 2019
Old 05-26-2019 , 17:59   Vip Riko module Time vip
Reply With Quote #1

hi.
if i set start time at 19 and end 08..sometimes work sometimes dosent work.. i dont understand this plugin.
alex2001 is offline
Pilo
AlliedModders Donor
Join Date: Jan 2019
Location: Israel
Old 05-26-2019 , 18:24   Re: Vip Riko module Time vip
Reply With Quote #2

Attach the plugin code please.
__________________

Taking Private(PAID) Plugins In PM
Feel free to Donate with PayPal
Feel free to message me in Discord Pilo#8253
Total donated : 25$
Pilo is offline
alex2001
Member
Join Date: May 2019
Old 05-27-2019 , 09:45   Re: Vip Riko module Time vip
Reply With Quote #3

Quote:
#pragma semicolon 1
#include <sourcemod>
#include <vip_core>

public Plugin:myinfo =
{
name = "[VIP] Time VIP",
author = "R1KO",
version = "1.0.0"
};

new String:g_sGroup[64];
new String:g_sStartTime[64];
new String:g_sEndTime[64];
new bool:g_bGive;

public OnPluginStart()
{
new Handle:hCvar = CreateConVar("sm_vip_time_group", "vip", "Группа VIP-статуса");
HookConVarChange(hCvar, OnGroupChange);
GetConVarString(hCvar, g_sGroup, sizeof(g_sGroup));

hCvar = CreateConVar("sm_vip_time_start", "00:00", "Начало времени");
HookConVarChange(hCvar, OnStartTimeChange);
GetConVarString(hCvar, g_sStartTime, sizeof(g_sStartTime));

hCvar = CreateConVar("sm_vip_time_end", "05:00", "Конец времени");
HookConVarChange(hCvar, OnEndTimeChange);
GetConVarString(hCvar, g_sEndTime, sizeof(g_sEndTime));

AutoExecConfig(true, "time_vip", "vip");
}

public OnGroupChange(Handle:hCvar, const String:sOldValue[], const String:sNewValue[]) strcopy(g_sGroup, sizeof(g_sGroup), sNewValue);
public OnStartTimeChange(Handle:hCvar, const String:sOldValue[], const String:sNewValue[]) strcopy(g_sStartTime, sizeof(g_sStartTime), sNewValue);
public OnEndTimeChange(Handle:hCvar, const String:sOldValue[], const String:sNewValue[]) strcopy(g_sEndTime, sizeof(g_sEndTime), sNewValue);

public OnMapStart()
{
g_bGive = false;

Timer_CheckTime(INVALID_HANDLE);

CreateTimer(60.0, Timer_CheckTime, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

#define HOURS 0
#define MINUTES 1

public Action:Timer_CheckTime(Handle:hTimer)
{
decl String:sTime[64], iCurrentTime[2], iStartTime[2], iEndTime[2];
FormatTime(sTime, sizeof(sTime), "%H:%M");
GetIntDate(sTime, iCurrentTime);

strcopy(sTime, sizeof(sTime), g_sStartTime);
GetIntDate(sTime, iStartTime);

strcopy(sTime, sizeof(sTime), g_sEndTime);
GetIntDate(sTime, iEndTime);

g_bGive = false;

if(iCurrentTime[HOURS] == iStartTime[HOURS])
{
if(iCurrentTime[MINUTES] > iStartTime[MINUTES])
{
g_bGive = true;
return Plugin_Continue;
}
}

if(iCurrentTime[HOURS] > iStartTime[HOURS])
{
if(iCurrentTime[HOURS] < iEndTime[HOURS])
{
g_bGive = true;
return Plugin_Continue;
}
else if(iCurrentTime[HOURS] == iEndTime[HOURS])
{
if(iCurrentTime[MINUTES] < iStartTime[MINUTES])
{
g_bGive = true;
return Plugin_Continue;
}
}
}

return Plugin_Continue;
}

GetIntDate(String:sTime[], iDate[2])
{
iDate[1] = StringToInt(sTime[3]);
sTime[2] = 0;
iDate[0] = StringToInt(sTime);
}

public OnClientPutInServer(iClient)
{
if (g_bGive && !IsFakeClient(iClient))
{
CreateTimer(4.0, Timer_Delay, GetClientUserId(iClient), TIMER_FLAG_NO_MAPCHANGE);
}
}

public Action:Timer_Delay(Handle:hTimer, any:UserID)
{
new iClient = GetClientOfUserId(UserID);
if(iClient && VIP_IsClientVIP(iClient) == false)
{
VIP_SetClientVIP(iClient, 0, AUTH_STEAM, g_sGroup, false);
}
}

alex2001 is offline
CrazySkull2k
Member
Join Date: Feb 2017
Old 05-30-2019 , 07:43   Re: Vip Riko module Time vip
Reply With Quote #4

I have this plugin aswell. Thing about it is if you get past 00:00, it doesn't work anymore, so you need to have two times. In your case 19:00 - 23:59 and 00:00 - 08:00.
Also, R1ko himself said the plugin is faulty, he posted the fixed one in the comments Link
CrazySkull2k is offline
alex2001
Member
Join Date: May 2019
Old 05-30-2019 , 11:08   Re: Vip Riko module Time vip
Reply With Quote #5

i dont find.. can you give me a ss with comment or something else..

Last edited by alex2001; 05-30-2019 at 12:48.
alex2001 is offline
CrazySkull2k
Member
Join Date: Feb 2017
Old 05-31-2019 , 04:49   Re: Vip Riko module Time vip
Reply With Quote #6

Quote:
Originally Posted by alex2001 View Post
i dont find.. can you give me a ss with comment or something else..
I did, click on Link on my comment above
CrazySkull2k is offline
alex2001
Member
Join Date: May 2019
Old 05-31-2019 , 05:56   Re: Vip Riko module Time vip
Reply With Quote #7

and,,, this dosent help me
alex2001 is offline
freak.exe_uLow
AlliedModders Donor
Join Date: Jul 2012
Location: Germany
Old 06-01-2019 , 02:20   Re: Vip Riko module Time vip
Reply With Quote #8

Quote:
Originally Posted by alex2001 View Post
and,,, this dosent help me
this is the file (PSSS: you have to compile it yourself)
Attached Files
File Type: sp Get Plugin or Get Source (VIP_TimeVIP_1.0.0e.sp - 223 views - 2.1 KB)

Last edited by freak.exe_uLow; 06-01-2019 at 02:21.
freak.exe_uLow is offline
Reply



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 13:21.


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