local variable "result" shadows a variable at a preceding level
#1

C:\Users\Fiore\Desktop\NIKOlikeAboss\pawno\include \dutils.inc(383) : warning 219: local variable "result" shadows a variable at a preceding level
C:\Users\Fiore\Desktop\NIKOlikeAboss\gamemodes\woo tisidiot.pwn(7481) : warning 219: local variable "result" shadows a variable at a preceding level
C:\Users\Fiore\Desktop\NIKOlikeAboss\gamemodes\woo tisidiot.pwn(7491) : error 025: function heading differs from prototype
C:\Users\Fiore\Desktop\NIKOlikeAboss\gamemodes\woo tisidiot.pwn(7791) : warning 219: local variable "result" shadows a variable at a preceding level

1) What's wrong with dutils.inc? LOL
2) Can you please help me to fix those errors/warning?

pawn Код:
stock strrest(const string[], index)
{
    new length = strlen(string);

    new offset = index;
    new result[256]; // 7481
    while ((index < length) && ((index - offset) < (sizeof(result) - 1)) && (string[index] > '\r'))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
pawn Код:
stock IsNumeric(const string[]) // 7491
{
    if(strlen(string) > 15) return 0;
    for (new i = 0, j = strlen(string); i < j; i++)
    {
        if (string[i] > '9' || string[i] < '0') return 0;
    }
    return 1;
}
pawn Код:
mystrtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[32]; // 7791
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Reply
#2

PHP код:
stock strrest(const string[], index)
{
    new 
length strlen(string);
    new 
offset index;
    new 
result2[256]; // 7481
    
while ((index length) && ((index offset) < (sizeof(result2) - 1)) && (string[index] > '\r'))
    {
        
result2[index offset] = string[index];
        
index++;
    }
    
result2[index offset] = EOS;
    return 
result2;
}
stock IsNumeric(const string2[]) // 7491
{
    if(
strlen(string2) > 15) return 0;
    for (new 
0strlen(string2); ji++)
    {
        if (
string2[i] > '9' || string2[i] < '0') return 0;
    }
    return 
1;
}
mystrtok(const string[], &index)
{
    new 
length strlen(string);
    while ((
index length) && (string[index] <= ' '))
    {
        
index++;
    }
    new 
offset index;
    new 
result2[32]; // 7791
    
while ((index length) && (string[index] > ' ') && ((index offset) < (sizeof(result2) - 1)))
    {
        
result2[index offset] = string[index];
        
index++;
    }
    
result2[index offset] = EOS;
    return 
result2;

Reply
#3

I still get this error:

C:\Users\Fiore\Desktop\NIKOlikeAboss\gamemodes\woo tisidiot.pwn(7491) : error 025: function heading differs from prototype
Reply
#4

new string2[256];
Reply
#5

pawn Код:
stock IsNumeric(const string2[]) // 7491
{
    new string2[256];
    if(strlen(string2) > 15) return 0;
    for (new i = 0, j = strlen(string2); i < j; i++)
    {
        if (string2[i] > '9' || string2[i] < '0') return 0;
    }
    return 1;
}
Like this doesnt work.
Reply
#6

any help please?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)