SA-MP Forums Archive
Que quieren decir estos warning? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Que quieren decir estos warning? (/showthread.php?tid=303565)



Que quieren decir estos warning? - [Nikk] - 14.12.2011

Quisiera saber que quieren decir estos warning.

PHP код:
D:\Nico\Samp\Gm y fs de samp\GM\Nikk dm\gamemodes\SADM.pwn(1373) : warning 225unreachable code
D
:\Nico\Samp\Gm y fs de samp\GM\Nikk dm\gamemodes\SADM.pwn(1411) : warning 219local variable "string" shadows a variable at a preceding level 
Tengo varios de esos, aca un ejemplo

unreachable code: linea


Quote:

new playerstate = GetPlayerState(playerid);

local variable....: linea

pawn Код:
new string[300]
Que shiet quieren decir?


Respuesta: Que quieren decir estos warning? - TheChaoz - 14.12.2011

unreachable code:

pawn Код:
public OnPlayerConnect(playerid)
{
    new string[40+MAX_PLAYER_NAME];
    GetPlayerName(playerid, string, MAX_PLAYER_NAME);
    format(string, sizeof(string), "El jugador %s(%i) se conecto al servidor.", string, playerid);
    return 1;
    SendClientMessage(playerid, 0xFF0000FF, string);//Este codigo nunca sera ejecutado ya que se sale del callback en el return 1, por lo que nos aparecera el warning unreachable code
}
warning 219: local variable "string" shadows a variable at a preceding level

hace referencia a que la variable string ya fue definida anteriormente.


Respuesta: Que quieren decir estos warning? - [Nikk] - 14.12.2011

Gracias chaoz, me sirvio