View Single Post
Tylerst
Veteran Member
Join Date: Oct 2010
Old 04-27-2012 , 07:00   Re: how would I write this plugin?
Reply With Quote #9

The Unknown Command thing is due to having no return on the commands(Most, if not all callbacks with the Action: tag need a return of some sort), just add return Plugin_Handled; after the while loops.

Example:
PHP Code:
public Action:Command_One(clientargs)
{
    new 
entity = -1;
    while ((
entity FindEntityByClassname(entity"logic_branch"))!=INVALID_ENT_REFERENCE)
    {
        new 
String:entName[MAX_NAME_LENGTH];
        
GetEntPropString(entityProp_Data"m_iName"entNamesizeof(entName));
        if(
StrEqual(entName"bsm"))
        {
            
SetVariantInt(1);
            
AcceptEntityInput(entity"SetValueTest");
            break;
        }
    }
    return 
Plugin_Handled;

Running them multiple times shouldn't be a problem.

Last edited by Tylerst; 04-27-2012 at 07:08.
Tylerst is offline