All pastes #901063 Raw Edit

Someone

public lua v1 · immutable
·published 2008-02-12 11:20 UTC
rendered paste body
/*---------------------------------------------*\       EXPERIMENTAL SWITCH STATEMENT :D\*---------------------------------------------*//* required table designlocal t = {    {        ["condition"] = "a",        ["code"] = "Msg( "AYY" )"    },    {        ["condition"] = "b",        ["code"] = "Msg( "NEWFAGS" )    }}*/Msg("--> (SWITCH INSTALLED) <--\n")        function switch( arg, tab )    for i = 1, #tab do        if( arg == tab[i]["condition"] ) then            RunString( tab[i]["code"] )        end    endendlocal t = {     {         condition = "a",        code = "MsgN( \"AYY\" )"    },    {        condition = "b",        code = "MsgN( \"NEWFAGS\" )"    }}function lol(...)    switch( "b", t )endconcommand.Add("call_switch", lol)