• Own Ban system not working
    13 replies, posted
Im making a ban system but it wont work. I get no error so i dont know why it isnt working i dont get a error but it seems like the function runs on server start without any reason and wont run when a player joins. -snip- Please help!
[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerConnect]Gamemode.PlayerConnect [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
You know that PlayerConnect just give you the name... Not the SteamID
[b][url=http://wiki.garrysmod.com/?title=Gamemode.PlayerAuthed]Gamemode.PlayerAuthed [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] I think this is called sometime near where the player connects, before they actually spawn at around 'Retrieving server info..'.
[QUOTE=BastinkaLive;21276023][b][url=http://wiki.garrysmod.com/?title=Gamemode.PlayerAuthed]Gamemode.PlayerAuthed [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] I think this is called sometime near where the player connects, before they actually spawn at around 'Retrieving server info..'.[/QUOTE] Was thinking the same thing.
Guys Guys! if you reed my code its the function im using. but im using it in a hook as in the wiki.
Right... Well... Im blank.
ok do anyone know about any mod that uses its own ban system? [editline]12:54AM[/editline] Cant belive ive missed it. at line 7 it should been "END"...
Not to mention you're missing an end for the if on line 21.
yeah i noticed it to. Thanks everyone who tried to help me!
How can you do this in a function? function auth(ply, cmd, args) --codehere?-- end Like if you were doing multiple things.
look at the wiki page [PHP]function userAuthed( ply, stid, unid ) print("Player "..ply:Name().." ("..stid.."|"..unid..") is authed") end hook.Add( "PlayerAuthed", "playerauthed", userAuthed )[/PHP] I got one problem it runs at sending client so if the person is banned he will be kicked after sending client info is done. Is it possible to run this earlier?
Yes use gatekeeper
If you want to call it earlier use gatekeeper and use the hook, [b]PlayerPasswordAuth[/b]. It's called before most hooks when a player connects. If not first.
Sorry, you need to Log In to post a reply to this thread.