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

CS:GO Flag with Expire [REQUEST PLUGIN]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MonsteQ
Member
Join Date: May 2018
Location: Hungary
Old 07-02-2018 , 16:15   CS:GO Flag with Expire [REQUEST PLUGIN]
Reply With Quote #1

Hy guys!

I got a source code to one simple plugin from: mug1wara

But, he isn't have more time to write that plugin.

Please help me!

I want:
- MySQL Support
- Time expire - sm_addflagwithexpire <steamid> <flag> <day>
- and Add more flags (example: sm_addflagwithexpire <steamid> <abced> <day>

Source Code:
PHP Code:
#include <sourcemod> 

#pragma semicolon 1 

char g_sSteamid[32]; 

public 
void OnPluginStart() 

    
RegAdminCmd("sm_addflagwithexpire"Cmd_AddFlagWithExpireADMFLAG_ROOT); 


public 
Action Cmd_AddFlagWithExpire(int iClientint iArgs

    if (
IsValidClient(iClient)) 
    { 
        if (
iArgs 0
        { 
            
PrintToChat(iClient"[SM] Usage: sm_addflagwithexpire <steamid> <flag>"); 
             
            return 
Plugin_Handled
        } 
         
        
GetClientAuthId(iClientAuthId_Steam2g_sSteamidsizeof(g_sSteamid)); 
         
        
char sFlag[256]; 
        
GetCmdArgString(sFlagsizeof(sFlag)); 
         
        
StripQuotes(sFlag); 
         
        
char szFile[256]; 
        
BuildPath(Path_SMszFilesizeof(szFile), "configs/admins_simple.ini"); 
         
        
Handle hFile OpenFile(szFile"at"); 
         
        
WriteFileLine(hFile"\"%s\" \"%s\""g_sSteamidsFlag); 
         
        
char sDay[365]; 
        
GetCmdArgString(sDaysizeof(sDay)); 
         
        
StripQuotes(sDay); 
         
        
StringToFloat(sDay); 
         
        
CreateTimer(86400.0 view_as<float>(sDay[sizeof(sDay)]), Timer_RemoveiClientTIMER_FLAG_NO_MAPCHANGE); 
         
        
CloseHandle(hFile); 
    } 
     
    return 
Plugin_Continue


public 
Action Timer_Remove(Handle hTimerint iClient

    if (
IsValidClient(iClient)) 
    { 
        
char szFile[256]; 
        
BuildPath(Path_SMszFilesizeof(szFile), "configs/admins_simple.ini"); 
         
        
Handle hFile OpenFile(szFile"r"); 
         
        
char sLine[4096]; 
         
        
ReadFileLine(hFilesLinesizeof(sLine)); 
         
        if (
StrContains(sLineg_sSteamid)) 
        { 
            
hFile OpenFile(szFile"w"); 
             
            
WriteFileLine(hFile" "); 
        } 
    } 


stock bool IsValidClient(int iClient

    if (!(
iClient <= MaxClients) || !IsClientInGame(iClient) || IsFakeClient(iClient)) 
    { 
        return 
false
    } 
     
    return 
true

MonsteQ is offline
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 07-02-2018 , 19:57   Re: CS:GO Flag with Expire [REQUEST PLUGIN]
Reply With Quote #2

Stop double posting.

Anyway try this.

sm_remove_ta <steamid>
sm_give_ta <steamid> <flag(s)> <duration in days>

It doesn't have MySQL support but why do you need MySQL support anyway if I may ask?
Attached Files
File Type: sp Get Plugin or Get Source (sm_expire_admins.sp - 288 views - 7.8 KB)
__________________
Rohanlogs is offline
MonsteQ
Member
Join Date: May 2018
Location: Hungary
Old 07-03-2018 , 05:18   Re: CS:GO Flag with Expire [REQUEST PLUGIN]
Reply With Quote #3

Quote:
Originally Posted by Rohanlogs View Post
Stop double posting.

Anyway try this.

sm_remove_ta <steamid>
sm_give_ta <steamid> <flag(s)> <duration in days>

It doesn't have MySQL support but why do you need MySQL support anyway if I may ask?
MySQL, because if I'm going out from home, and I should edit the admins and VIPs (flags). But I don't want yet.

Thanks, this is a good plugin. Solved Thread.
MonsteQ 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 01:29.


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