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

[L4D2] Set a flag for a command


Post New Thread Reply   
 
Thread Tools Display Modes
rcarm
Member
Join Date: Feb 2010
Old 05-10-2010 , 14:18   Re: [L4D2] Set a flag for a command
Reply With Quote #21

PHP Code:
public OnPluginStart()
{
    
AddCommandListener(Command_Ping"ping");
}

public 
Action:Command_Ping(client, const String:name[], argc)
{

    for(new 
1MaxClientsi++)
    {
        if(!
IsClientAuthorized(i))
            continue;
        
        new 
flags GetUserFlagBits(i);
            
        if(
flags ADMFLAG_KICK)
            
PrintPings(i)
    }

    return 
Plugin_Handled;
}

stock PrintPings(client)
{

    
PrintToConsole(client"Client ping times:");
    for(new 
1MaxClientsi++)
    {
        if(!
IsClientConnected(i))
            continue;

        
decl String:buffer[255]
        new 
ping GetClientLatency(clientNetFlow_Both);
        
Format(buffersizeof(buffer), "%d : %N"pingclient);
        
PrintToConsole(clientbuffer);
    }

Note that this will send it to everyone who has the kick flag everytime someone types "ping" in console.
rcarm is offline
Marchello
Senior Member
Join Date: Jan 2010
Old 05-10-2010 , 15:15   Re: [L4D2] Set a flag for a command
Reply With Quote #22

Quote:
Originally Posted by rcarm View Post
Note that this will send it to everyone who has the kick flag everytime someone types "ping" in console.
Thx, but didn't work out. Nothing was set for the "ping" command. Without admin rights or with it was possible to type ping and get pings.
Marchello is offline
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 05-10-2010 , 16:26   Re: [L4D2] Set a flag for a command
Reply With Quote #23

PHP Code:
public OnPluginStart()
{
    
AddCommandListener(Command_Ping"ping");
}

public 
Action:Command_Ping(client, const String:name[], argc)
{
    
CreateTimer(0.5TimerPingclient);
    return 
Plugin_Handled;
}

public 
Action:TimerPing(Handle:timerany:client)
{
    for(new 
010000000i++)
        
PrintToConsole(client"HAHA TRY READING THE CONSOLE OUTPUT NOW SUCKER");

    
KickClient(client"THAT'LL LEARN YA");

Voilą! Now nobody can use it.
__________________
Scone is offline
Marchello
Senior Member
Join Date: Jan 2010
Old 05-10-2010 , 16:52   Re: [L4D2] Set a flag for a command
Reply With Quote #24

Quote:
Originally Posted by Scone View Post
PHP Code:
KickClient(client"THAT'LL LEARN YA"); 
Quote:
Originally Posted by Scone View Post
Voilą! Now nobody can use it.

Last edited by Marchello; 05-11-2010 at 11:01.
Marchello is offline
Afronanny
Veteran Member
Join Date: Aug 2009
Old 05-11-2010 , 18:06   Re: [L4D2] Set a flag for a command
Reply With Quote #25

Quote:
Originally Posted by Scone View Post
PHP Code:
public OnPluginStart()
{
    
AddCommandListener(Command_Ping"ping");
}

public 
Action:Command_Ping(client, const String:name[], argc)
{
    
CreateTimer(0.5TimerPingclient);
    return 
Plugin_Handled;
}

public 
Action:TimerPing(Handle:timerany:client)
{
    for(new 
010000000i++)
        
PrintToConsole(client"HAHA TRY READING THE CONSOLE OUTPUT NOW SUCKER");

    
KickClient(client"THAT'LL LEARN YA");

Voilą! Now nobody can use it.
Normally I wouldn't post a 1-word reply. But this code needs one:



Epic.
Afronanny is offline
Marchello
Senior Member
Join Date: Jan 2010
Old 05-12-2010 , 16:14   Re: [L4D2] Set a flag for a command
Reply With Quote #26

Damn, if I could into coding I bet I could write anything to make something alike.
Because it's ridiculous that such simple thing is being told as "impossible to do".
Marchello is offline
Afronanny
Veteran Member
Join Date: Aug 2009
Old 05-12-2010 , 23:51   Re: [L4D2] Set a flag for a command
Reply With Quote #27

Quote:
Originally Posted by Marchello View Post
Damn, if I could into coding I bet I could write anything to make something alike.
Because it's ridiculous that such simple thing is being told as "impossible to do".
Ping is a client-side command. It cannot, I repeat, cannot be blocked by the server. It just is not possible. The only workaround that I can see is to simply block the pings of each client from being sent to other clients.

That would, however, accomplish nothing.
Afronanny 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 07:08.


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