Raised This Month: $51 Target: $400
 12% 

PawnHerp


Post New Thread Reply   
 
Thread Tools Display Modes
Author
necavi
Veteran Member
Join Date: Sep 2010
Plugin ID:
2696
Plugin Version:
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows you to write, compile and run sourcemod plugins entirely in game!
    Old 12-03-2011 , 08:20   PawnHerp
    Reply With Quote #1

    Pretty much exactly what the plugin description says!
    Currently it is COMPLETELY pointless, as I haven't gone through the trouble to finish adding commands, such as one that more automatically handles adding commands, or ones that makes it so that each chat message is automatically written to the file.

    Currently I don't really recommend using this plugin, I'm more publishing it as proof-of-concept, as well as looking for comments and suggestions (beyond the obvious stupid, writing it at 5 AM use of variables).

    I admit that there is very little point to actually using this plugin at all, but sometimes an idea strikes, and...well, sometimes you just have to write such things!

    Requirements:
    System2 extension (http://forums.alliedmods.net/showthread.php?t=146019)


    Example use:
    Code:
    sm_newfile herp
    sm_writeline public OnPluginStart(){
    sm_writeline PrintToChatAll("Herp Plugin Loaded!");
    sm_writeline }
    sm_compile
    would output:
    Code:
    /* Plugin Template built by Ingame Editor! */
    #include <sourcemod>
    public Plugin:myinfo =
    {
        name = "herp",
        author = "=(eG)=™Necavi",
        description = "Made using Ingame Editor!",
        version = "0.1",
        url = "www.necavi.com"
    }
    public OnPluginStart(){
    PrintToChatAll("Herp Plugin Loaded!");
    }
    Addendum: I'm aware that there may be issues with player's names using this system, I'll deal with that at a later date though.

    Updated to add the (first version) of the sm_include command, currently it overwrites the previous include, as this is my first time modifying a C-style file, other than appending to it.
    Attached Files
    File Type: sp Get Plugin or Get Source (IngameEditor.sp - 222 views - 4.8 KB)
    File Type: smx IngameEditor.smx (4.7 KB, 208 views)

    Last edited by KyleS; 01-02-2013 at 20:45.
    necavi is offline
    McFlurry
    Veteran Member
    Join Date: Mar 2010
    Location: RemoveEdict(0);
    Old 12-03-2011 , 11:18   Re: PawnHerp
    Reply With Quote #2

    You don't have anything that allows us to include other files besides <sourcemod>
    __________________
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    necavi
    Veteran Member
    Join Date: Sep 2010
    Old 12-03-2011 , 16:37   Re: PawnHerp
    Reply With Quote #3

    I know, I've already thought of sm_AddInclude or some such command, which would insert an include, likely requiring you to either type "rel path" or <name> and place it right below my little 'Plugin Generated'.
    necavi is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 01-02-2013 , 20:44   Re: PawnHerp
    Reply With Quote #4

    Cool plugin Necavi!

    Please use PLATFORM_MAX_PATH instead of rolling your own sizes ( right now it's 256, yours are 128 ). You should probably also check if the player's file handle is invalid before running commands on it. You've forgotten to set the handles to invalid on disconnection, so it's possible for a file to get clobbered if a client disconnects, or the map changes. Are you sure you'd like to announce to the server that someone is compiling a plugin? a convar would be splendid for this. You should also try to avoid reindexing arrays whenever possible, you can copy the client's handle to a new variable and perform the 9 operations in one case on that, the handle to the file will not change. There's a %N format operator which will get the client's name from their index, which saves you from creating a limited string buffer and calling GetClientName.

    You could maybe save their work using a trie with a steamid, but then you'd have a bunch of open handles. Another suggestion is to reuse your existing arrays (you have path, format it, then create another called filepath and never reuse path again after formatting path). As a matter of fact, BuildPath supports formatting a string with options, so you're reformatting the same string twice and using three different buffers. new is kind of slow in comparison to decl, but in this case it shouldn't really matter.

    Regardless, this looks great! Nice job!

    Last edited by KyleS; 01-02-2013 at 20:45.
    KyleS 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 23:50.


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