Thread: [Store] Gamble
View Single Post
B2SX
Member
Join Date: Dec 2015
Location: Israel
Old 07-15-2017 , 16:42   Re: [Store] Gamble
Reply With Quote #7

Quote:
Originally Posted by lay295 View Post
From taking a quick look your IsValidClient seems to be messed up. I have no idea what he's talking about saying it's not clean though and "really bad" it seems fine besides a few small things.

Code:
stock bool IsValidClient(client)
{
	if (client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && IsFakeClient(client) && IsClientSourceTV(client))return true;
	return false;
}
Wouldn't this only return true if you're a bot and a sourcetv client? O.o

Also your first check
Code:
if(args < 0 || !BetAmmont || IsValidClient(client))
Wouldn't args never be less than 0? Maybe you meant args <=0 or args < 1. No real point in checking if they have -1 args.
I'm also not sure what the purpose of !BetAmmont would be, as in your code that could never resolve to true. Since StringToInt would just return 0 on failure anyways. Thus (!BetAmmount) == false all the time.

NOTE: I haven't actually tested the plugin, just making some observations.
i forget to add ! in the start in the isvalidclient i will fix now, and the arg check is working fine i do the same all the time, also the !BetAmmont checks if it is a number again using it in other plugins working great, fixed the plugin i uploaded the updated version.
__________________
◆ Developer - C++,C#,Python,VB.NET,Java,SQF,AS 3.0,AS 2.0,SP,Pawn,LUA
Steam Link

Last edited by B2SX; 07-15-2017 at 16:44.
B2SX is offline