General > Developers Corner

stool and weapon restriction

<< < (4/4)

saintmark:
btw any clue why mine prints the HUD message twice?

JamminR:
Tip:
When you aren't using complex tables, that is, if you just have a list of items in a table you want to recurse like

--- Code: ---table_list = { a,b,c,d,e,f,g,h }

--- End code ---
Lua handles the 'ipairs' more efficiently than 'pairs'

--- Code: ---for _,item in ipairs( table_list ) do
-- do something with item
end

--- End code ---

As for why printmessage twice, is it the exact same both times, not a different message, one from each of two of your three hooks?

saintmark:

--- Quote from: JamminR on June 01, 2008, 04:10:00 PM ---
As for why printmessage twice, is it the exact same both times, not a different message, one from each of two of your three hooks?

--- End quote ---

Yes it is exact both times...

JamminR:
No idea. While looking at PrintMessage on the Gmod Lua wiki, I found ChatPrint too. Perhaps try it, see if it does same.
http://wiki.garrysmod.com/wiki/?title=Player.ChatPrint

Navigation

[0] Message Index

[*] Previous page

Go to full version