SA-MP Forums Archive
[Help] Warnings - 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: [Help] Warnings (/showthread.php?tid=556221)



[Help] Warnings - Arxalan - 10.01.2015

Hello , i want to know why i am facing the following error and what is the solution ?

Error:
Код:
C:\Users\Arsalan\Desktop\Samp\gamemodes\new.pwn(4015) : warning 219: local variable "GetName" shadows a variable at a preceding level
C:\Users\Arsalan\Desktop\Samp\gamemodes\new.pwn(4022) : warning 219: local variable "pName" shadows a variable at a preceding level
Code of the Line:

PHP код:
stock pName(playerid)
{
    new 
GetName[24];
    
GetPlayerName(playeridGetName24);
    return 
GetName;
}
stock GetName(playerid)
{
    new 
pName[24];
    
GetPlayerName(playeridpName24);
    return 
pName;




Re: [Help] Warnings - Rudy_ - 10.01.2015

pawn Код:
stock apName(playerid)
{
    new GetName[24];
    GetPlayerName(playerid, GetName, 24);
    return GetName;
}

stock aGetName(playerid)
{
    new pName[24];
    GetPlayerName(playerid, pName, 24);
    return pName;
}



Re: [Help] Warnings - JeaSon - 10.01.2015

why two ? you can use one!


pawn Код:
stock GetName(playerid)
{
    new pName[24];
    GetPlayerName(playerid, pName, 24);
    return pName;
}