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

[REQ] Flag For Specified Time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ApoziX
Member
Join Date: Sep 2018
Old 09-22-2018 , 17:11   [REQ] Flag For Specified Time
Reply With Quote #1

Hello,

Someone Can Help Me, I need to add restriction for !trial If User Did the command 1 time then the next time he could do the cmd again will be in 5 days

Thanks For Helpers +rep
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <tf2>
#include <tf2_stocks>

new Handle:trial_time  INVALID_HANDLE;

public 
Plugin:myinfo =
{
    
name "Premium Membership Trial",
    
author "Mortdredd",
    
description "Allows users to Trial Premium membership",
    
version "0.2",
    
url "http://www.sourcemod.net/"
}
 
public 
OnPluginStart()
{
    
// Check Game //
    
decl String:game[32];
    
GetGameFolderName(gamesizeof(game));
    if(
StrEqual(game"tf"))
    {
        
LogMessage("Premium Members Trial Mod loaded successfully.");
    }
    else
    {
        
SetFailState("Team Fortress 2 Only.");
    }
    
    
// Premium Member Commands //
    
RegConsoleCmd("trial"Command_trial);
    
    
//Create CVARS//
    
CreateConVar("PremiumTrial_version",    "0.4""Premium Trial Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
trial_time CreateConVar("trial_duration""1800""How long Trial lasts in seconds");
}

public 
Action:Command_trial(clientargs)
{
    new 
AdminId:admin CreateAdmin("Donator");
    
SetAdminFlag(adminAdmin_Custom6true);
    
SetAdminImmunityLevel(admin5);
    
SetUserAdmin(clientadmin);
    
PrintCenterText(client"[VIP] YOUR 30 MINUTE TRIAL BEGINS NOW")
    
CreateTrial(client)
}

CreateTrial(client)
{
    new 
Float:Duration GetConVarFloat(trial_time);
    
CreateTimer(DurationTimer_Regenclient); 
}

public 
Action:Timer_Regen(Handle:timerany:value)
{
    new 
AdminId:admin
    RemoveAdmin
(admin)

__________________
Looking To Start A TF2 Community
My Discord | My Steam

Last edited by ApoziX; 09-22-2018 at 17:32.
ApoziX is offline
Vaggelis
Senior Member
Join Date: May 2017
Old 09-22-2018 , 17:54   Re: [REQ] Flag For Specified Time
Reply With Quote #2

You gonna need a database for that thing
Vaggelis is offline
ApoziX
Member
Join Date: Sep 2018
Old 09-22-2018 , 18:11   Re: [REQ] Flag For Specified Time
Reply With Quote #3

Quote:
Originally Posted by Vaggelis View Post
You gonna need a database for that thing
I do have
__________________
Looking To Start A TF2 Community
My Discord | My Steam
ApoziX 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 15:12.


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