Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma semicolon 1
- #include <sourcemod>
- #include <clientprefs>
- #pragma newdecls required
- public Plugin myinfo =
- {
- name = "",
- author = "",
- description = "",
- version = ""
- };
- ConVar g_cvFreeVipEnable;
- bool g_bFreeVip;
- public void OnPluginStart()
- {
- g_cvFreeVipEnable = CreateConVar("sm_nightvip_enable", "1", "");
- AutoExecConfig(true, "Charlie_FreeNightVIP");
- }
- public void OnMapStart()
- {
- if (GetConVarBool(g_cvFreeVipEnable))
- {
- char godzina_str[8];
- FormatTime(godzina_str, sizeof(godzina_str), "%H", GetTime());
- int godzina = StringToInt(godzina_str);
- if(godzina >= 22 || godzina < 8)
- g_bFreeVip = true;
- else
- g_bFreeVip = false;
- }
- }
- public void OnClientPostAdminCheck(int client)
- {
- if(IsValidPlayer(client) && GetConVarBool(g_cvFreeVipEnable) && g_bFreeVip)
- AddUserFlags(client, Admin_Custom3);
- }
- stock bool IsValidPlayer(int client)
- {
- if (!(1 <= client <= MaxClients) || !IsClientInGame(client) || IsFakeClient(client) || IsClientSourceTV(client) || IsClientReplay(client))
- return false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement