Raised This Month: $90 Target: $400
 22% 

Help, I need to limit the input of the command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bruno_Ferrari
Member
Join Date: Oct 2016
Old 07-31-2017 , 11:17   Help, I need to limit the input of the command
Reply With Quote #1

How to ban a command? !powerups for example, a blue team! Reds, they can use. Tell me please!!!!
Bruno_Ferrari is offline
Papero
Senior Member
Join Date: Aug 2016
Location: Rimini, Italy
Old 08-01-2017 , 09:15   Re: Help, I need to limit the input of the command
Reply With Quote #2

Quote:
Originally Posted by Bruno_Ferrari View Post
a blue team! Reds, they can use. Tell me please!!!!
What???
__________________
Thanks, Papero(Hexah)
Steam | GITHUB |CS:ITA JailBreak
Papero is offline
Send a message via Skype™ to Papero
stephen473
Member
Join Date: Jan 2017
Location: GetClientAbsOrigin();
Old 08-04-2017 , 18:25   Re: Help, I need to limit the input of the command
Reply With Quote #3

???
__________________
stephen473 is offline
Cooky
AlliedModders Donor
Join Date: Jun 2010
Location: 127.0.0.1
Old 08-09-2017 , 03:59   Re: Help, I need to limit the input of the command
Reply With Quote #4

I think he said: block the command for the "Red" team, so only "Blue" can use it...
__________________
Cooky is offline
waylander3
Senior Member
Join Date: Sep 2015
Location: Russia, Norilsk
Old 08-13-2017 , 21:26   Re: Help, I need to limit the input of the command
Reply With Quote #5

Quote:
Originally Posted by Cooky View Post
I think he said: block the command for the "Red" team, so only "Blue" can use it...
And how it relates to SMAC?
waylander3 is offline
ThatKidWhoGames
AlliedModders Donor
Join Date: Jun 2013
Location: My House
Old 09-02-2017 , 19:51   Re: Help, I need to limit the input of the command
Reply With Quote #6

Quote:
Originally Posted by Bruno_Ferrari View Post
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;

Attached Files
File Type: sp Get Plugin or Get Source (tutorial.sp - 20 views - 1.4 KB)
__________________


I take custom plugin requests, add me on Steam for details.
ThatKidWhoGames is offline
Reply


Thread Tools
Display Modes

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:09.


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