Monolith Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Similar topics
    Search
     
     

    Display results as :
     


    Rechercher Advanced Search

    Latest topics
    » Hey guys.........
    [Tutorial] How to create a command for console. I_icon_minitimeFri Sep 09, 2011 4:58 pm by WhiteWolf

    » Last to post wins
    [Tutorial] How to create a command for console. I_icon_minitimeFri Sep 09, 2011 4:57 pm by WhiteWolf

    » COMBAT ARMS WOOOOO
    [Tutorial] How to create a command for console. I_icon_minitimeTue Oct 19, 2010 10:59 pm by viperjake31

    » Its over (Bye)
    [Tutorial] How to create a command for console. I_icon_minitimeWed Sep 22, 2010 10:05 pm by Supanooba

    » Sorry guys...
    [Tutorial] How to create a command for console. I_icon_minitimeWed Sep 22, 2010 10:01 pm by Supanooba

    » bad feeling...
    [Tutorial] How to create a command for console. I_icon_minitimeTue Sep 21, 2010 1:16 pm by Supanooba

    » This game...
    [Tutorial] How to create a command for console. I_icon_minitimeSun Sep 19, 2010 10:01 am by Supanooba

    » Me, D@rk T3mpl4r, Hacking?
    [Tutorial] How to create a command for console. I_icon_minitimeSun Sep 19, 2010 12:36 am by D@rk T3mpl4r

    » fractured my arm and leg
    [Tutorial] How to create a command for console. I_icon_minitimeSat Sep 18, 2010 9:08 pm by Supanooba

    Navigation
     Portal
     Index
     Memberlist
     Profile
     FAQ
     Search

    [Tutorial] How to create a command for console.

    4 posters

    Go down

    [Tutorial] How to create a command for console. Empty [Tutorial] How to create a command for console.

    Post by Starkkz Fri Jun 11, 2010 3:21 pm

    Okay, i'm professional for CS2D Lua Scripting..
    I'm going to show us the Parsing System..

    The Hook..
    Code:

    addhook("parse","parser_hook") -- We need to make the hook wich calls a function

    The Function..
    Code:

    addhook("parse","parser_hook")
    function parser_hook(command)
    end

    The Command..

    Code:

    function string.split(t,b)
       local cmd = {}
       if not b then match = "[^%s]+" else match = "[^"..b.."]+" end
       for word in string.gmatch(t,match) do
          table.insert(cmd,word)
       end
       return cmd
    end

    addhook("parse","parser_hook")
    function parser_hook(command)
       local parses = string.split(command) -- Command Splitted in table
       local cmd = tostring(parses[1]) -- First Split - table[1]
       if cmd == "your command name" then
          -- Here you can do what you want..
          return 1 -- Don't show error message
       end
    end

    Starkkz

    Posts : 30
    Rep : 0
    Join date : 2010-06-11

    Back to top Go down

    [Tutorial] How to create a command for console. Empty Re: [Tutorial] How to create a command for console.

    Post by Debt Sun Jun 13, 2010 10:29 pm

    lol! Starkkz, the split command is Leegao(The true god of scripting for lua) xD and my table conversion function is like ten times better.

    Debt

    Posts : 10
    Rep : 0
    Join date : 2010-06-13

    Back to top Go down

    [Tutorial] How to create a command for console. Empty Re: [Tutorial] How to create a command for console.

    Post by Starkkz Mon Jun 14, 2010 4:09 pm

    table conversion? wtf.

    Starkkz

    Posts : 30
    Rep : 0
    Join date : 2010-06-11

    Back to top Go down

    [Tutorial] How to create a command for console. Empty Re: [Tutorial] How to create a command for console.

    Post by Debt Mon Jun 14, 2010 4:40 pm

    I added some stuff to Lee's epic function. I also have a question, where did you get your trig formulas?

    Debt

    Posts : 10
    Rep : 0
    Join date : 2010-06-13

    Back to top Go down

    [Tutorial] How to create a command for console. Empty Re: [Tutorial] How to create a command for console.

    Post by Starkkz Tue Jun 15, 2010 3:01 pm

    that's not my, just posting.

    Starkkz

    Posts : 30
    Rep : 0
    Join date : 2010-06-11

    Back to top Go down

    [Tutorial] How to create a command for console. Empty Re: [Tutorial] How to create a command for console.

    Post by WhiteWolf Sat Jun 19, 2010 9:01 pm

    Starkkz wrote:that's not my, just posting.
    Took it off of some FPSBANANA file scripts I see.
    I think that you should post a script that YOU understand pretty good.
    WhiteWolf
    WhiteWolf

    Posts : 226
    Rep : 12
    Join date : 2010-06-11

    Back to top Go down

    [Tutorial] How to create a command for console. Empty Re: [Tutorial] How to create a command for console.

    Post by Debt Tue Jul 06, 2010 11:35 am

    I was just saying that he should explain that it isn't his, 'cause some people have tried to convince me that, and I've seen them other places, and it draws conclusion without proper facts.

    Debt

    Posts : 10
    Rep : 0
    Join date : 2010-06-13

    Back to top Go down

    [Tutorial] How to create a command for console. Empty Re: [Tutorial] How to create a command for console.

    Post by WhiteWolf Tue Jul 06, 2010 11:41 am

    O.O?
    WhiteWolf
    WhiteWolf

    Posts : 226
    Rep : 12
    Join date : 2010-06-11

    Back to top Go down

    [Tutorial] How to create a command for console. Empty Re: [Tutorial] How to create a command for console.

    Post by V1Kt0R Fri Jul 09, 2010 3:11 pm

    so what is the use of the "parsing system"?
    like what does it do
    V1Kt0R
    V1Kt0R

    Posts : 196
    Rep : 2
    Join date : 2010-06-19
    Age : 28
    Location : Auburn

    Back to top Go down

    [Tutorial] How to create a command for console. Empty Re: [Tutorial] How to create a command for console.

    Post by Sponsored content


    Sponsored content


    Back to top Go down

    Back to top

    - Similar topics

     
    Permissions in this forum:
    You cannot reply to topics in this forum