Many Errors
#1

On this code i get a lot of errors
PHP код:
stock GasesteID()
{
    new 
i;
    for(
1<= masinii++)
    {
//HERE   if(cInfo[i][cID] = -2)
        
{
            return 
i;
        }
    }
    return 
0;

Errors
PHP код:
C:\Users\andrei.andrei-PC\Desktop\semp\gamemodes\WiD.pwn(4569) : error 028invalid subscript (not an array or too many subscripts): "cInfo"
C:\Users\andrei.andrei-PC\Desktop\semp\gamemodes\WiD.pwn(4569) : warning 215expression has no effect
C
:\Users\andrei.andrei-PC\Desktop\semp\gamemodes\WiD.pwn(4569) : error 001expected token";"but found "]"
C:\Users\andrei.andrei-PC\Desktop\semp\gamemodes\WiD.pwn(4569) : error 029invalid expressionassumed zero
C
:\Users\andrei.andrei-PC\Desktop\semp\gamemodes\WiD.pwn(4569) : fatal error 107too many error messages on one line 
Reply
#2

Quote:
Originally Posted by andreistalker
Посмотреть сообщение
On this code i get a lot of errors
PHP код:
stock GasesteID()
{
    new 
i;
    for(
1<= masinii++)
    {
//HERE   if(cInfo[i][cID] = -2)
        
{
            return 
i;
        }
    }
    return 
0;

Errors
PHP код:
C:\Users\andrei.andrei-PC\Desktop\semp\gamemodes\WiD.pwn(4569) : error 028invalid subscript (not an array or too many subscripts): "cInfo"
C:\Users\andrei.andrei-PC\Desktop\semp\gamemodes\WiD.pwn(4569) : warning 215expression has no effect
C
:\Users\andrei.andrei-PC\Desktop\semp\gamemodes\WiD.pwn(4569) : error 001expected token";"but found "]"
C:\Users\andrei.andrei-PC\Desktop\semp\gamemodes\WiD.pwn(4569) : error 029invalid expressionassumed zero
C
:\Users\andrei.andrei-PC\Desktop\semp\gamemodes\WiD.pwn(4569) : fatal error 107too many error messages on one line 
Instead of <= try <. What's the definition for cInfo?

Greetings.
Reply
#3

I modified from cInfo to CarData, cInfo was my enum, now i have this:
PHP код:
warning 211possibly unintended assignment 
Reply
#4

Resolved all
Reply
#5

For people who come here after searching: the solution for warning 211: possibly unintended assignment is that you are assigning a value inside an IF-statement.

Код:
/**
will 99.9% of times default to TRUE because the value can be assigned
**/
if($value = 1) {
}

/**
This is the correct code. A value is not assigned, but checked for (notice the double equals sign (=) for the single equals sign in the top code
**/
if($value == 1) {
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)