snipt

Ctrl+h for KB shortcuts

Lua

AMX2D modlua1

1
2
3
4
5
6
7
init_mod("sample_move")

function hook_move_sample(p, x, y)
     parse(string.format("hudtxt2 %s 1 %sPlayer '%s' is at (%s, %s) 100 100 1", p, Color(255, 100, 0), player(p, "name"), x, y))
end

toMod("sample_move")
https://snipt.net/embed/f9c3e388f36694e9c6b93e980513e641/
https://snipt.net/raw/f9c3e388f36694e9c6b93e980513e641/
f9c3e388f36694e9c6b93e980513e641
lua
Lua
8
2016-09-28T18:46:46
True
False
False
/api/public/snipt/4950/
amx2d-modlua1
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="n">init_mod</span><span class="p">(</span><span class="s2">&quot;</span><span class="s">sample_move&quot;</span><span class="p">)</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="k">function</span> <span class="nf">hook_move_sample</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span> </span><span id="L-4"><a name="L-4"></a> <span class="n">parse</span><span class="p">(</span><span class="nb">string.format</span><span class="p">(</span><span class="s2">&quot;</span><span class="s">hudtxt2 %s 1 %sPlayer &#39;%s&#39; is at (%s, %s) 100 100 1&quot;</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">Color</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">100</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="n">player</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="s2">&quot;</span><span class="s">name&quot;</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">))</span> </span><span id="L-5"><a name="L-5"></a><span class="k">end</span> </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a><span class="n">toMod</span><span class="p">(</span><span class="s2">&quot;</span><span class="s">sample_move&quot;</span><span class="p">)</span> </span></pre></div> </td></tr></table>
amx2d, lua
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.