Raised This Month: $ Target: $400
 0% 

[ANY] Entity Toggler


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author
Ecclesiastical
New Member
Join Date: Jun 2016
Location: United State of M
Plugin ID:
5263
Plugin Version:
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    An Plugin to Enable/Disable Entities.
    Old 06-27-2016 , 07:05   [ANY] Entity Toggler
    Reply With Quote #1

    An Entity Toggler I wrote for Disabling Func_no_builds and other Entities for tf2, but should work for Any Game;


    Code:
    #include <sourcemod>
    #include <sdktools>
     
    public Plugin myinfo =
    {
        name = "Ent Toggler",
        author = "Ecclesiastical",
        description = "Toggle Entities and such",
        version = "3.3.3",
        url = "http://xt6zo6bcjbrrjyvr.onion"
    }
     
    public void OnPluginStart()
    {
        RegAdminCmd("sm_toggleent_admin", Command_EntToggler, ADMFLAG_SLAY);
        RegAdminCmd("sm_enthealth_admin", Command_EntHealth, ADMFLAG_SLAY);
        RegAdminCmd("sm_entcolor_admin", Command_EntColor, ADMFLAG_SLAY);
        RegAdminCmd("sm_entmodel_admin", Command_EntModel, ADMFLAG_SLAY);
        RegConsoleCmd("sm_toggleent", Command_EntToggler, "Toggle an Entity;");
        RegConsoleCmd("sm_enthealth", Command_EntHealth, "Set an Entity's Health;");
        RegConsoleCmd("sm_entcolor", Command_EntColor, "Set an Entity's Color;");
        RegConsoleCmd("sm_entmodel", Command_EntModel, "Set an Entity's Model;");
    }
     
    public Action Command_EntToggler(client, args)
    {
        char arg1[64];
        char arg2[64];
        char name[MAX_NAME_LENGTH];
        
        if (args < 1)
        {
          ReplyToCommand(client, "[SM] Usage: sm_toggleent <Entity> <Input>");
          return Plugin_Handled;
        }
     
        GetCmdArg(1, arg1, sizeof(arg1));
        GetCmdArg(2, arg2, sizeof(arg2));
        
        new horse = FindEntityByClassname(-1, arg1);
            
        for(new x = 0; x > horse; x++) 
        {
            AcceptEntityInput(horse, arg2);
        }
    
        GetClientName(client, name, sizeof(name));
        ReplyToCommand(client, "[SM] You Toggled The %s Entity", arg1);
     
        return Plugin_Handled;
    }
    
    public Action Command_EntHealth(client, args)
    {
        char arg1[64];
        char arg2[64];
        char name[MAX_NAME_LENGTH];
        
        if (args < 2)
        {
          ReplyToCommand(client, "[SM] Usage: sm_enthealth <Entity> <Health>");
          return Plugin_Handled;
        }
     
        GetCmdArg(1, arg1, sizeof(arg1));
        GetCmdArg(2, arg2, sizeof(arg2));
        
        new horse = FindEntityByClassname(-1, arg1);
        new turtle = StringToInt(arg2);
        
        for(new x = 0; x > horse; x++) 
        {
            SetEntityHealth(horse, turtle);
        }
        
        GetClientName(client, name, sizeof(name));
        ReplyToCommand(client, "[SM] %s's Health is now %d", arg1, turtle);
     
        return Plugin_Handled;
    }
    
    public Action Command_EntColor(client, args)
    {
        char arg1[64];
        char arg2[64];
        char arg3[64];
        char arg4[64];
        char arg5[64];
        char name[MAX_NAME_LENGTH];
    
        if (args < 3)
        {
          ReplyToCommand(client, "[SM] Usage: sm_entcolor <entity> <Red 0-255> <Green 0-255> <blue 0-255> <alpha 0-255>");
          return Plugin_Handled;
        }
     
        GetCmdArg(1, arg1, sizeof(arg1));
        GetCmdArg(2, arg2, sizeof(arg2));
        GetCmdArg(3, arg3, sizeof(arg3));
        GetCmdArg(4, arg4, sizeof(arg4));
        GetCmdArg(5, arg5, sizeof(arg5));
        
        new horse = FindEntityByClassname(-1, arg1);
        
        new donkey = StringToInt(arg2);
        new penguin = StringToInt(arg3);
        new anteater = StringToInt(arg4);
        new angel = StringToInt(arg5);
            
        for(new x = 0; x > horse; x++) 
        {
            SetEntityRenderColor(horse, donkey, penguin, anteater, angel);
        }
        
        GetClientName(client, name, sizeof(name));
        ReplyToCommand(client, "[SM] You Changed %s's color Red: %d; Green: %d; Blue: %d; Alpha: %d ", horse, donkey, penguin, anteater, angel);
     
        return Plugin_Handled;
    }
    
    public Action Command_EntModel(client, args)
    {
        char arg1[64];
        char arg2[64];
        char name[MAX_NAME_LENGTH];
        
        if (args < 3)
        {
          ReplyToCommand(client, "[SM] Usage: sm_entmodel <entity > <model>");
          return Plugin_Handled;
        }
     
        GetCmdArg(1, arg1, sizeof(arg1));
        GetCmdArg(2, arg2, sizeof(arg2));
        
        new horse = FindEntityByClassname(-1, arg1);
        
        for(new x = 0; x > horse; x++) 
        {
            SetEntityModel(horse, arg2);
        }
    
        GetClientName(client, name, sizeof(name));
        ReplyToCommand(client, "[SM] The Model for %s has been changed to %s", arg1, arg2);
     
        return Plugin_Handled;
    }
    For Joanne;
    Ecclesiastical 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 03:08.


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