Thread: [Store] Gamble
View Single Post
lay295
Senior Member
Join Date: Sep 2013
Old 07-15-2017 , 15:49   Re: [Store] Gamble
Reply With Quote #6

Quote:
Originally Posted by B2SX View Post
the code is working perfectly I don't know what are you talking about test it again, im not new to SM, im programming sm for a year and a half and I'm really good at it also so I don't know what are you talking about, also I have been programming in other languages for 9 years, im not starting anywhere i have something like 100-200 plugins (half are sourcepawn), 20 of them are gamemodes like jailbreak, deathrun, etc so....
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.
__________________


Last edited by lay295; 07-15-2017 at 16:01.
lay295 is offline