AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   SourceMod Anti-Cheat (https://forums.alliedmods.net/forumdisplay.php?f=133)
-   -   Help, I need to limit the input of the command (https://forums.alliedmods.net/showthread.php?t=299950)

Bruno_Ferrari 07-31-2017 10:17

Help, I need to limit the input of the command
 
How to ban a command? !powerups for example, a blue team! Reds, they can use. Tell me please!!!!

Papero 08-01-2017 08:15

Re: Help, I need to limit the input of the command
 
Quote:

Originally Posted by Bruno_Ferrari (Post 2538854)
a blue team! Reds, they can use. Tell me please!!!!

What???

stephen473 08-04-2017 17:25

Re: Help, I need to limit the input of the command
 
?¿?¿?

Cooky 08-09-2017 02:59

Re: Help, I need to limit the input of the command
 
I think he said: block the command for the "Red" team, so only "Blue" can use it...

waylander3 08-13-2017 20:26

Re: Help, I need to limit the input of the command
 
Quote:

Originally Posted by Cooky (Post 2540417)
I think he said: block the command for the "Red" team, so only "Blue" can use it...

And how it relates to SMAC? :)

ThatKidWhoGames 09-02-2017 18:51

Re: Help, I need to limit the input of the command
 
1 Attachment(s)
Quote:

Originally Posted by Bruno_Ferrari (Post 2538854)
How to ban a command? !powerups for example, a blue team! Reds, they can use. Tell me please!!!!

Completely wrong section lmao but this template should work for ya:

PHP Code:

#include <sourcemod>
#include <tf2_stocks>

ConVar cv_BlueTeam;
ConVar cv_RedTeam;

new 
bool:bBlueTeamCvar;
new 
bool:bRedTeamCvar;

public 
OnPluginStart()
{
    
// Replace with whatever command you want to block for a team
    
AddCommandListener(CommandBlock"command_you_want_to_block");

    
cv_BlueTeam CreateConVar("sm_command_block_blue""1""Block the blue team from using the command?"_true0.0true1.0);
    
bBlueTeamCvar GetConVarBool(cv_BlueTeam);

    
cv_RedTeam CreateConVar("sm_command_block_red""1""Block the blue team from using the command?"_true0.0true1.0);
    
bRedTeamCvar GetConVarBool(cv_RedTeam);
}

public 
Action CommandBlock(int client, const char[] commandint argc)
{
    if (
IsValidClient(client))
    {
        if (
bBlueTeamCvar && TF2_GetClientTeam(client) == TFTeam_Blue)
        {
            return 
Plugin_Stop;
            
// Blocks the command for the client on the blue team
        
}
        else if (
bRedTeamCvar && TF2_GetClientTeam(client) == TFTeam_Red)
        {
            return 
Plugin_Stop;
            
// Blocks the command for the client on the red team            
        
}
    }
    return 
Plugin_Continue;
}

stock bool IsValidClient(int clientbool bAllowBots falsebool bAllowDead true

    if (!(
<= client <= MaxClients) || !IsClientInGame(client) || (IsFakeClient(client) && !bAllowBots) || IsClientSourceTV(client) || IsClientReplay(client) || (!bAllowDead && !IsPlayerAlive(client))) 
    { 
        return 
false
    }
    return 
true;




All times are GMT -4. The time now is 09:41.

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