idx problem
#1

I got huge problem with my script i get this can someone help me?

Код:
C:\Users\Hellman\Desktop\Rebound Roleplay server\gamemodes\RGRP.pwn(10528) : warning 219: local variable "idx" shadows a variable at a preceding level
C:\Users\Hellman\Desktop\Rebound Roleplay server\gamemodes\RGRP.pwn(16975) : warning 219: local variable "idx" shadows a variable at a preceding level
C:\Users\Hellman\Desktop\Rebound Roleplay server\gamemodes\RGRP.pwn(17057) : warning 219: local variable "idx" shadows a variable at a preceding level
C:\Users\Hellman\Desktop\Rebound Roleplay server\gamemodes\RGRP.pwn(17165) : warning 219: local variable "idx" shadows a variable at a preceding level
C:\Users\Hellman\Desktop\Rebound Roleplay server\gamemodes\RGRP.pwn(17226) : warning 219: local variable "idx" shadows a variable at a preceding level
C:\Users\Hellman\Desktop\Rebound Roleplay server\gamemodes\RGRP.pwn(17314) : warning 219: local variable "idx" shadows a variable at a preceding level
C:\Users\Hellman\Desktop\Rebound Roleplay server\gamemodes\RGRP.pwn(17395) : warning 219: local variable "idx" shadows a variable at a preceding level
Reply
#2

This warning simply means that a variable named "idx" is declared in the same scope more than once, for example:

pawn Код:
new idx; // This variable carries into any statements below it that are within the same block of code

if(something == something)
{
    new idx; // A variable with this name is already declared in this scope, hence you get a warning.
}
Does that make sense?
Reply
#3

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
This warning simply means that a variable named "idx" is declared in the same scope more than once, for example:

pawn Код:
new idx; // This variable carries into any statements below it that are within the same block of code

if(something == something)
{
    new idx; // A variable with this name is already declared in this scope, hence you get a warning.
}
Does that make sense?
Yes, let me send all lines too.

here if one of them.

pawn Код:
line 10528 stock GetPlayerItemInfo(playerid,&idx,ItemName[],len=sizeof(ItemName),&Amount)
{
    if(idx>=MAX_ITEMS)return 0;
    format(ItemName,len,_GetItemNamePVar(playerid,idx));
    Amount=_GetItemAmountPVar(playerid,idx);
    idx++;
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)