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

GAG Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
deadbunny
Member
Join Date: Apr 2013
Old 12-19-2015 , 11:20   GAG Plugin
Reply With Quote #1

Hello and merry Christmas to all!
I need a working gag plugin for my csgo server, without database.
I searched and I found too many results to sort it out.
Can i have one, please?
Thanks!
deadbunny is offline
AeroAcrobat
AlliedModders Donor
Join Date: Apr 2011
Location: lives in a circus
Old 12-20-2015 , 01:23   Re: GAG Plugin
Reply With Quote #2

Build-in Sourcemod.
!gag deadbunny

Unless you're looking for something completly different ...
__________________
AeroAcrobat is offline
pubhero
Veteran Member
Join Date: Aug 2012
Location: Central Europe
Old 12-20-2015 , 04:25   Re: GAG Plugin
Reply With Quote #3

If i know well, the sm_gag command not working correctly if the target log out and in again.
pubhero is offline
deadbunny
Member
Join Date: Apr 2013
Old 12-20-2015 , 06:18   Re: GAG Plugin
Reply With Quote #4

You know well.
Also, you cannot gag some1 with a defined amount of time with sm_gag.
deadbunny is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 12-20-2015 , 07:52   Re: GAG Plugin
Reply With Quote #5

I can do that. Do you still need it ?
__________________
Want to check my plugins ?
Arkarr is offline
deadbunny
Member
Join Date: Apr 2013
Old 12-20-2015 , 09:37   Re: GAG Plugin
Reply With Quote #6

Yes, please.
deadbunny is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 12-20-2015 , 10:22   Re: GAG Plugin
Reply With Quote #7

Quote:
Originally Posted by deadbunny View Post
Yes, please.
Try this (require simple chat processor):
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <clientprefs>
#include <scp>

#define PLUGIN_AUTHOR "Arkarr"
#define PLUGIN_VERSION "1.00"

Handle ClientCookie_GagStatus;
bool clientGaged[MAXPLAYERS+1];
bool timed[MAXPLAYERS+1];

public 
Plugin myinfo 
{
    
name "[ANY] Cookie Gag",
    
author PLUGIN_AUTHOR,
    
description "Gag players and remember about their gag status.",
    
version PLUGIN_VERSION,
    
url "http://www.sourcemode.net"
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_cgag"CMD_CGag"Gag a client using cookies to remember there status."ADMFLAG_CHAT);
    
RegConsoleCmd("sm_cungag"CMD_CUngag"Gag a client using cookies to remember there status."ADMFLAG_CHAT);
    
    
ClientCookie_GagStatus RegClientCookie("sm_cookiegag_client_status""The status of the gag."CookieAccess_Private);
    
    for (new 
MaxClients0; --i)
    {
        if (!
AreClientCookiesCached(i))
        {
            continue;
        }
        
        
OnClientCookiesCached(i);
       }
    
LoadTranslations("common.phrases");
}
 
public 
void OnClientConnected(client)
{
    
PrintToServer("%N connected and his gag status is : %b"clientclientGaged[client]);
}

public 
void OnClientDisconnect(client)
{
    if(
clientGaged[client] && !timed[client])
        
SetClientCookie(clientClientCookie_GagStatus"GAGED");
    else
        
SetClientCookie(clientClientCookie_GagStatus"UNGAGED");
}

public 
void OnClientCookiesCached(client)
{
    
char statusValue[8];
    
GetClientCookie(clientClientCookie_GagStatusstatusValuesizeof(statusValue));
    
    
clientGaged[client] = StrEqual(statusValue"GAGED");

   
public 
Action OnChatMessage(&authorHandle:recipientsString:name[], String:message[])
{
    if(
clientGaged[author])
        return 
Plugin_Stop;
        
    return 
Plugin_Continue;
}

public 
Action CMD_CGag(clientargs)
{
    
char length[10];
    
char strTarget[20];
    
float time 0.0;
    
    if(
args == 0)
    {
        
ReplyToCommand(client"Usage : sm_cgag [TARGET] <time>");
        
        return 
Plugin_Handled;
    }

    
GetCmdArg(1strTargetsizeof(strTarget));
    
int target FindTarget(clientstrTargettrue);
    
    if(
args >= 2)
    {
        
GetCmdArg(2lengthsizeof(length));
        
time StringToFloat(length);
    }
    
    if(
target != -1)
    {
        
clientGaged[target] = true;
        
        if(
time != 0.0)
        {
            
timed[target] = true;
            
CreateTimer(timeTMR_UngagClientclient);
            
ReplyToCommand(client"%N gaged for %.0f sucessfully !"targettime);
        }
        else
        {
            
ReplyToCommand(client"%N gaged sucessfully !"target);
        }
    }
        
    return 
Plugin_Handled;
}

public 
Action CMD_CUngag(clientargs)
{
    
char strTarget[20];
    
    if(
args == 0)
    {
        
ReplyToCommand(client"Usage : sm_cgag [TARGET] <time>");
        
        return 
Plugin_Handled;
    }

    
GetCmdArg(1strTargetsizeof(strTarget));
    
int target FindTarget(clientstrTargettrue);
    
    if(
target != -1)
    {
        
clientGaged[target] = false;
        
ReplyToCommand(client"%N ungaged sucessfully !"target);
    }
        
    return 
Plugin_Handled;
}
    
public 
Action TMR_UngagClient(Handle tmrany client)
{
    
clientGaged[client] = false;
    
timed[client] = false;
    
    return 
Plugin_Continue;

__________________
Want to check my plugins ?

Last edited by Arkarr; 12-22-2015 at 07:01.
Arkarr is offline
deadbunny
Member
Join Date: Apr 2013
Old 12-20-2015 , 10:32   Re: GAG Plugin
Reply With Quote #8

Perfect.
Ty.
I would need a team balancer plugin, working and good. Do you have any? Also, how can I disable when the print on the server "Player joined x side" ?
deadbunny is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 12-20-2015 , 10:34   Re: GAG Plugin
Reply With Quote #9

Quote:
Originally Posted by deadbunny View Post
Perfect.
Ty.
I would need a team balancer plugin, working and good. Do you have any? Also, how can I disable when the print on the server "Player joined x side" ?
Do I look like google ? All your requests are on the forum, just search a bit, damn it !
__________________
Want to check my plugins ?
Arkarr is offline
deadbunny
Member
Join Date: Apr 2013
Old 12-20-2015 , 10:38   Re: GAG Plugin
Reply With Quote #10

Haha, okay, sorry.
I'm a bit noob at this, where can I find the scp include?
deadbunny 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 08:50.


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