General > Developers Corner

Fixing a chat command

(1/1)

CrazyCallum113:
Okay so I created a chat command to link to a url however when someone types it it opens the browser for everyone! How can I fix this?

Here's my code:

--- Code: ---function ulx.fixerrors( calling_ply )
    for _, pl in ipairs( player.GetAll() ) do pl:SendLua([[gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=179287953")]]) end
end
local fixerrors = ulx.command( CATEGORY_NAME, "ulx fixerrors", ulx.fixerrors, "!fixerrors", true )
fixerrors:defaultAccess( ULib.ACCESS_ADMIN )
fixerrors:help( "Brings up the workshop collection of content to fix any errors on the server." )
--- End code ---

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given

[0] Board index

Go to full version