[lua]
local CountChars1 = "SELECT COUNT(charname) FROM crp_characters WHERE steamid = '"..args[1].."'"
[/lua]
This would return a table.
If I were to do..
[lua]
print(CountChars1)
[/lua]
It will say table:xxxx
Where do I extract the value in the table?
Count isn't a part of the SQL syntax I've seen before. So I don't know the answer. But try doing PrintTable(CountChars1) to find out what's in the table. Very handy function.
I need to incorporate it into a usermessage and a arithmetic function
Like
[lua]
if um:ReadString() =< 5 then
print('no')
end
[/lua]
Anyone have a klue?
Use PrintTable to find out what's in the result of the SQL query and paste it here if you don't understand something.
I don't need to print the table though.
[lua]
umsg.Start("SendCharAmmt")
umsg.String(amount[1])
umsg.End()
[/lua]
[QUOTE=zzaacckk;25211500]I don't need to print the table though.
[lua]
umsg.Start("SendCharAmmt")
umsg.String(amount[1])
umsg.End()
[/lua][/QUOTE]
When you gonna send a number send a short... just use tonumber on it.
Sorry, you need to Log In to post a reply to this thread.