General > Developers Corner

[ERROR] Need help debugging!

<< < (3/3)

Caustic Soda-Senpai:

--- Code: ---local CATEGORY_NAME = "sourcebans"
 
function ulx.bancheck( calling_ply, target_ply )
calling_ply:SendLua([[gui.OpenURL('http://gflclan.com/gmodbans/index.php?p=banlist&advSearch=]]..target_ply:SteamID()..[[&advType=steamid')]])
end
 
local bancheck = ulx.command(CATEGORY_NAME, "bancheck", ulx.bancheck, "!bancheck", true)
bancheck:addParam{ type=ULib.cmds.PlayerArg }
bancheck:defaultAccess(ULib.ACCESS_ALL)
bancheck:help( "Opens SourceBans to check a player's bans" );
--- End code ---

This is your final product. I've tested and debugged myself, apparently I have no bans, which is good. Have fun!

To sum up what was changed:
The local variable was removed
URL was modified to deliver needs
target_ply:SteamID was changed to target_ply:SteamID() and was placed in the URL rather than a variable.

SinkingV:
Thank you for your help, maybe I can reverse debug this to help me in future projects

Navigation

[0] Message Index

[*] Previous page

Go to full version