Yup !
I create a script in LUA to display my collection on Workshop.
I made this :
[CODE]
function ChatCommand(ply, txt)
if (string.sub(txt, 1, 7) == "!addons") then
ply:SendLua([[gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=268799573")]])
end
end
hook.Add("PlayerSay", "SayAddon", ChatCommand)[/CODE]
I think its good, but, when i said : !addons, my gui is displayed for every players.
How i can fix this ?
Thx
That shouldn't happen. ply is the one who chatted and you only sendlua to him.
:( its weird...
37.59.46.110:27065 -> if you want test...
[code]
function ChatCommand(ply, txt)
if (string.sub(txt, 1, 7) == "!addons") then
ply:SendLua([[gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=268799573")]])
return ""
end
end
hook.Add("PlayerSay", "SayAddon", ChatCommand)[/code]
Try adding that I think. I don't think you'd need to though. So... hummm.
Where did you put the file?
Solved...
I dont know why, but i made this :
[CODE]
function ChatCommand(ply, text)
if (string.sub(text, 1, 7) == "!addons") then
if ply==LocalPlayer() then
ply:SendLua([[gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=268799573")]])
end
end
end
hook.Add("PlayerSay", "SayAddon", ChatCommand)
[/CODE]
--' !
Sorry, you need to Log In to post a reply to this thread.