Sql Database Moving Around

I have data being made on a Sqlite Database Serverside.

I have a derma menu that needs it clientside.

Clientside.
[lua]
local function p228legal( um )

				if um:ReadString() == "legal" then
				 print("success")
				end
				
				end
				usermessage.Hook("p228legal", p228legal)

[/lua]

ServerSide
[lua]
function p228legal(umsg)

legal = sql.QueryValue(“SELECT status FROM zack_lawsystem WHERE weaponname = ‘p228’”)
if legal == “legal” then
umsg.Start(“p228legal”)
umsg.String(“legal”)
umsg.End()
else
umsg.Start(“p228legal”)
umsg.String(“illegal”)
umsg.End()
end
end
[/lua]

The clientside code is inside a function like below.
[lua]
function Blah()
local function Blah()

end
end
[/lua]

So… what’s the issue? Assuming the menu and the usermessage hook are in the same file, just set a variable equal to true or false, and then use that variable in the menu.

When I run it clientside it dosent print success.

Status = legal I know. So there is a issue with my usermessage hooks I cannot figure out.

[editline]01:05AM[/editline]

Also, Entoros my main issue was that I have about 40 usermessages( one for every gun).

And the menu is all one function, so I am confused on also how to get multiple usermessages in one function.

You can do it with 1 usermessage (and 2 variables being sent).

[lua]
umsg.Start(“wepIsLegal”)
umsg.Bool(legal == “legal”)
umsg.String(wepName) – ex: ‘p228’
umsg.End()
[/lua]