View Single Post
potatoz
AlliedModders Donor
Join Date: Nov 2016
Old 02-27-2017 , 14:11   Re: [CSGO] Only round during the round use.
Reply With Quote #7

Mixed this up real quick, not tested but feel free to give it a try

PHP Code:
int CommandUsed 0;
ConVar sm_commandlimit_cmd null;

public 
OnPluginStart() 

// Hook round start
HookEvent("round_start"OnRoundStartEventHookMode_PostNoCopy);

// Create Convar and Config for easy Customization
sm_commandlimit_cmd CreateConVar("sm_commandlimit_cmd""sm_commandhere""Command to limit (This is currently limited to one command)");
AutoExecConfig(true"plugin_commandlimit");

// Add listener for specified command
new String:command[100];
GetConVarString(sm_commandlimit_cmdcommandsizeof(command));

AddCommandListener(Command_Limitcommand);


public 
OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast

CommandUsed 0;
}

public 
Action:Command_Limit(client, const String:command[], argc)
{    
    if(
CommandUsed == 1)
        return 
Plugin_Handled;
    
    
CommandUsed 1;
    return 
Plugin_Continue;

Attached Files
File Type: sp Get Plugin or Get Source (commandlimit.sp - 278 views - 1.1 KB)
__________________
potatoz is offline