Thread: [Store] Gamble
View Single Post
nhnkl159
Senior Member
Join Date: Jul 2012
Location: Israel 3>
Old 07-15-2017 , 17:41   Re: [Store] Gamble
Reply With Quote #8

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've written it before he updated the plugin, he uploaded a new version of this plugin that made better and not really messy.
__________________
nhnkl159 is offline
Send a message via Skype™ to nhnkl159