15.07.2013, 10:24
No offence, but is that hard to ****** the errors/warnings? I can find dozen of results..
When you create an array, let me give an example:
About "loose indentation". Just indent your code..
pawn Код:
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
pawn Код:
new
TopLappers[ MAX_PLAYERS ]
;
if(TopLappers == 5) //error 033: array must be indexed (variable "TopLappers")
pawn Код:
// Awful indentation
if(x == n)
{
x = 5;
n = 6;
}
pawn Код:
// Readable and good! No warnings!
if(x == n)
{
x = 5;
n = 6;
}