Im making a regestration form on my server first time you join. But i cant get the code to work. It should check if both Name and Pass is filled, else it do nothing.
Can somebody please help me, people are bypassing this.
[PHP]DermaButton.DoClick = function ()
if(Name:GetValue() == "" or Pass:GetValue() == "") then
else
RunConsoleCommand("adduserdb", Name:GetValue(), Pass:GetValue(),"<hash key so people cant abuse the regeration form by creating many accounts>")
DermaPanel:Close()
end
end[/PHP]
[lua]DermaButton.DoClick = function()
local name,pass = Name:GetValue(), Pass:GetValue()
if name != "" and pass != "" then
RunConsoleCommand("adduserdb",name,pass,"haskey")
DermaPanel:Close()
end
end
[/lua]
Your code is a little strange.
[QUOTE=Entoros;20689453]DermaButton.DoClick = function()
local name,pass = Name:GetValue(), Pass:GetValue()
if name != "" and pass != "" then
RunConsoleCommand("adduserdb",name,pass,"haskey")
DermaPanel:Close()
end
end
Your code is a little strange.[/QUOTE]
oh i thought that you couldnt use != in lua
thanks
[QUOTE=yuriman;20689841]oh i thought that you couldnt use != in lua
thanks[/QUOTE]
You can in the Garrysmod implementation because Garry hacked it in. The lua equivalent is ~=
ok thanks
Sorry, you need to Log In to post a reply to this thread.