Raised This Month: $ Target: $400
 0% 

Block selected commands


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
0xyGens
Member
Join Date: Mar 2008
Old 04-26-2011 , 03:29   Block selected commands
Reply With Quote #1

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;
}

?>
__________________




0xyGens is offline
 



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 04:21.


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