• ASSMOD and SourceBans
    7 replies, posted
So I'm trying to combine ASSMOD and SourceBans with each other. There is only one problem, Sourcemod can't find a matching client. Anyways if i can get any help that would be cool. BTW i am a complete newb to lua i just started learning not to long ago. The code that i got: [CODE]if (#INFO.Reason > 0) then RunConsoleCommand("sm_ban", INFO.Player:UniqueID(), INFO.Time, INFO.Reason) else RunConsoleCommand("sm_ban", INFO.Player:UniqueID(), INFO.Time) end[/CODE] When i try to ban somone in the Ass menu i got this: [CODE][SM] No matching client was found. [[/CODE]
Try using INFO.Player:Name() instead of INFO.Player:UniqueID(), might help
-snip-
Are you using lua sourcebans, or sourcemod itself? You should use their steamid. It's always better, how many people are going to have the same steamid? :v: He's an <insertwordhere> for telling you to use UserID(). He should have pointed you towards SteamID(). [lua] if (#INFO.Reason > 0) then RunConsoleCommand("sm_ban", INFO.Player:SteamID(), INFO.Time, INFO.Reason) else RunConsoleCommand("sm_ban", INFO.Player:SteamID(), INFO.Time) end [/lua] Generally easier to use the lua equivalent, as you could just use the function.
[QUOTE=Phoenixf129;35216258]wisdom[/QUOTE] wow im stupid
My personal input here - I prefer UniqueID, I find it cleaner than SteamID
[QUOTE=Phoenixf129;35216258]Are you using lua sourcebans, or sourcemod itself? You should use their steamid. It's always better, how many people are going to have the same steamid? :v: He's an <insertwordhere> for telling you to use UserID(). He should have pointed you towards SteamID(). [lua] if (#INFO.Reason > 0) then RunConsoleCommand("sm_ban", INFO.Player:SteamID(), INFO.Time, INFO.Reason) else RunConsoleCommand("sm_ban", INFO.Player:SteamID(), INFO.Time) end [/lua] Generally easier to use the lua equivalent, as you could just use the function.[/QUOTE] I am using SorceMod itself for sourcebans. But what I'm trying to do is replace the "ASS_BanPlayer" command and just have it Use the "sm_ban" In the ban menu of assmod instead. If you guys don't know how the SourceMod banning through console works, This is it. "sm_ban (STEAMID OR Whatever you want to ban with) (Time) (REASON)" Also thank you for these fast replys guys
[QUOTE=Banana Lord.;35224148]My personal input here - I prefer UniqueID, I find it cleaner than SteamID[/QUOTE] Wouldn't work in this instance though. Sourcemod only has support for SteamID/Name as that argument. [QUOTE=Towlie2142;35227959]I am using SorceMod itself for sourcebans. But what I'm trying to do is replace the "ASS_BanPlayer" command and just have it Use the "sm_ban" In the ban menu of assmod instead. If you guys don't know how the SourceMod banning through console works, This is it. "sm_ban (STEAMID OR Whatever you want to ban with) (Time) (REASON)" Also thank you for these fast replys guys[/QUOTE] If you are only using sourcemod for sourcebans, may I suggest something a little more native to Garry's Mod? [url]http://facepunch.com/threads/980687[/url] That's a lot better, and you could even hook the function directly.
Sorry, you need to Log In to post a reply to this thread.