Raised This Month: $ Target: $400
 0% 

Block selected commands


Post New Thread Reply   
 
Thread Tools Display Modes
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
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-26-2011 , 14:27   Re: Block selected commands
Reply With Quote #2

See this plugin:
http://forums.alliedmods.net/showthread.php?p=660187
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



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