AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block selected commands (https://forums.alliedmods.net/showthread.php?t=155736)

0xyGens 04-26-2011 03:29

Block selected commands
 
Hi im newbie in plugin coding. I work on selected commands block but i cant that.

In Php

PHP Code:

<?php
$blocks 
= array('rcon','autobuy','rebuy',);
$block_args = array('sv_','mp_','cl_');

if(
$player != 'Admin')
{

    if(
checkcommand($sendedcommand) == FALSE)
{
return 
PLUGIN_HANDLED;
}

}


function 
checkcommand($command)
{
    if(
in_array($command,$blocks))
    {
        return 
false;
    }
    else
    {
        
$count count($block_args)
        for(
$i $i $count $i++)
        {
            if(
strstr($command$block_args[$i]))
            {
                return 
false;
            }
        }
    }
    
    return 
true;
}

?>


Exolent[jNr] 04-26-2011 14:27

Re: Block selected commands
 
See this plugin:
http://forums.alliedmods.net/showthread.php?p=660187


All times are GMT -4. The time now is 04:21.

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