SA-MP Forums Archive
string shadows a variable at a preceding level - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: string shadows a variable at a preceding level (/showthread.php?tid=631305)



string shadows a variable at a preceding level - Kiko12135 - 26.03.2017

Warning: local variable "IgracTablicki" shadows a variable at a preceding level
Please Help!
Line:
PHP код:
stock LocirajAvtomobilT(IgracTablicki
Code:
PHP код:
stock LocirajAvtomobilT(IgracTablicki)
{
    new 
cm AllMyCars(IgracTablicki);
    if(
cm 0)
    {
        if(
MyVehicle[playerid][MyVehTablicki] == tablickat)
        {
        
clx[playerid] ++;
        if(
clx[playerid] > cm)
        {
            
clx[playerid] = 0;
        }
        new 
Float:VPos[3];
        
GetVehiclePos(MyVehicle[GetMyCarMID(playerid,clx[playerid])][MyVehID], VPos[0],VPos[1],VPos[2]);
        
SetPlayerCheckpoint(playerid,VPos[0],VPos[1],VPos[2],8.0);
        if(
clx[playerid] == 0){DisablePlayerCheckpoint(playerid);}
    }
    else{
SCM(playeridCOLOR_LIGHTRED"{FF4040}>>[GRESKA]:{FFFFFF} Igracot nema avtomobil");}
}




Re: string shadows a variable at a preceding level - jasperschellekens - 26.03.2017

Change
PHP код:
new cm AllMyCars(IgracTablicki); 
to
PHP код:
new cm;
AllMyCars(IgracTablicki) = cm