SA-MP Forums Archive
Warning.... - 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: Warning.... (/showthread.php?tid=510001)



Warning.... - lizter008 - 29.04.2014

PHP код:
warning 219local variable "object" shadows a variable at a preceding level 
PHP код:
    if(killerid != INVALID_PLAYER_ID)
    {
             new 
Float:xFloat:yFloat:z;
             new 
oldmoney GetPlayerMoney(playerid);
             
GetPlayerPos(playeridxyz);
             
ResetPlayerMoney(playerid);
             
//Only drop if the player has atleast $1
             
if(oldmoney 2999)
             {
                    new 
object MONEY_STACK;
                    if(
oldmoney >= 20000)
                    {
                        
object MONEY_BAG;
                    }
                    
//Create the pickup & return the id
                    //Set the id to how much money was dropped
                    
playerPickups[CreatePickup(object2xyz, -1)] = oldmoney;
             }
    } 



Re: Warning.... - superrobot48 - 29.04.2014

did u define it two times?


Re: Warning.... - VinPure - 29.04.2014

you change the object 1 in 2,
may be
Quote:

new object2 = MONEY_BAG




Re: Warning.... - Brandon_More - 29.04.2014

pawn Код:
new obje = MONEY_STACK;

                    if(oldmoney >= 20000)
                    {
                        obje = MONEY_BAG;
                    }

                    //Create the pickup & return the id
                    //Set the id to how much money was dropped
                    playerPickups[CreatePickup(obje, 2, x, y, z, -1)] = oldmoney;