View Single Post
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 06-15-2018 , 14:22   Re: Team switch using database
Reply With Quote #3

Quote:
Originally Posted by Ahimel View Post
Code:
void SQL_CheckSPOT(client)
{
	char[] Query = new char[150];
	decl String:steamID64[18]; 
	GetClientAuthId(client, AuthId_SteamID64, steamID64, sizeof(steamID64));
This one is seriously bad, -

Do the SteamID checking properly, as explained in this post.

Doing otherwise will produce unexpected results...


Quote:
Originally Posted by ThatKidWhoGames View Post
You need to change each of the <= 0 to != 1. You could also simply use one StrContains and check if the string player exists. You also can't return Plugin_Continue to a void function.
I believe you mean to do "!= -1", with your advice:

Quote:
Originally Posted by https://sm.alliedmods.net/new-api/string/StrContains
Return Value

-1 on failure (no match found). Any other value indicates a position in the string where the match starts.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].

Last edited by DarkDeviL; 06-15-2018 at 14:23.
DarkDeviL is offline