I’ve been sitting on this mess for up to 2 hours, I cant find a solution for this:
the addon should send a net whenever a certain command was written but I can type either of which (2 commands) and it opens the same one:
sv_:
local ChatCString = function(len, ply)
local strText = net.ReadString()
if ( strText == "/logout" or "!logout" ) then
net.Start("jpg_PopupLogin")
net.Send( ply )
return true
end
if ( strText == "!resetpass" or "/resetpass") then
net.Start("jpg_PopupMenuOnClient")
net.Send( ply )
return true
end
end
net.Receive("jpg_StringChat", ChatCString)
cl_:
hook.Add( "OnPlayerChat", "jpg_GetStringCommandLogin", function( ply, strText )
if ply == LocalPlayer() then
strText = string.lower( strText )
if ( strText == "/logout" or "!logout" ) then
net.Start("jpg_StringChat")
net.WriteString(strText)
net.SendToServer()
return true
end
if ( strText == "/resetpass" or "!resetpass" ) then
net.Start("jpg_StringChat")
net.WriteString(strText)
net.SendToServer()
return true
end
end
end )
I am at loss, please tell me what I am doing wrong