I have a few errors in my new stocks I'm trying to make (yes I know these stocks have already been made elsewhere) A lot of this code is 6+ years old. Idk if my methods still work.
I'm more so worried about error 028 and error 021.
Errors Below
Pick it apart and be as cruel as necessary. Looking to learn. Wont be offended.
PHP Code:
stock int GetRandomClient()
{
int i[MaxClients + 1], ii;
for(int i = 1; i <= MaxClients; i++)
{
if(IsAuthenticClient(i))
{
i[ii++] + i; //THIS IS LINE 15
}
return (ii == 0) ? -1 : i[GetRandomInt(0, ii - 1)];
}
return -1;
}
IsAuthenticClient
PHP Code:
stock bool IsAuthenticClient(int iClient)
{
if (iClient <= 0)
return false;
if (!IsClientInGame(iClient))
return false;
if (!IsClientConnected(iClient))
return false;
if (IsClientReplay(iClient))
return false;
return true;
}