View Single Post
QuantumToast
Member
Join Date: May 2017
Location: US
Old 06-23-2017 , 12:23   Re: Infractions - The Early Stages
Reply With Quote #41

Apologies for the second post so quickly.
Quote:
Originally Posted by Kryptanyte View Post
Just looking at your code I realize you can shorten a function by doing this (that was my bad haha):

*snip*

Otherwise it looks a lot cleaner.

A note when you implement SQL, you want to run threaded queries so using a query instantly won't really work (For threaded queries you pass a callback function to the query and once the query is run it will send the results to said callback function where you can handle them. This prevents hanging in your plugin)

I would say check the player for infractions early so it's (probably) returned the results by the time you want to check the player for infractions. The earliest you can do this would be OnClientAuthorized()
Based on that, if I'm reading correctly, I will have to actually run a query to check for infractions before I actually read that information into PlayerHasInfractions()? I'm trying my best to not be spoonfed, but I think I just have a lot to learn about SQL before this project gains any footing...
QuantumToast is offline