[DUDA] Warnings
#1

Hola a todos, tengo unos warnings de hace mбs de 1 aсo y nosй como resolverlos jeje, son los siguientes (3):
Код:
C:\Users\yessica\Desktop\Carpetas\WEAPON_SCROLL_MOD_2_0_BETA\Andromeda 2.0\filterscripts\ladmin.pwn(4457) : warning 225: unreachable code
C:\Users\yessica\Desktop\Carpetas\WEAPON_SCROLL_MOD_2_0_BETA\Andromeda 2.0\filterscripts\ladmin.pwn(4459) : warning 209: function "dcmd_rango" should return a value
C:\Users\yessica\Desktop\Carpetas\WEAPON_SCROLL_MOD_2_0_BETA\Andromeda 2.0\filterscripts\ladmin.pwn(12188) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
Lineas: 4457, 4459, (cуdigo en general)

Код:
dcmd_rango(playerid,params[]) {
    #pragma unused params
	if(PlayerInfo[playerid][Level] >= 1) {
		if(RangoEnElChat[playerid] == 0) {
           RangoEnElChat[playerid] = 1;
           ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, " {9933CC}|| HABLAR AUTOMБTICAMENTE ||", "{FFFFFF}Ahora cuando hables, se te agregarб tu rango, usa de nuevo el comando para desactivarlo!", "Cerrar", ""); 
  return CMDMessageToAdmins(playerid,"RANGO");
		} else {
   	        RangoEnElChat[playerid] = 0;
		} return CMDMessageToAdmins(playerid,"RANGO (OFF)");
	  ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, " {9933CC}|| HABLAR AUTOMБTICAMENTE ||", "{FFFFFF}Ahora podrбs hablar como usuario normal!", "Cerrar", ""); // Esta 4457
	} else return SendClientMessage(playerid,red,"{9933CC}[ADMINISTRACION]:{FFFFFF} No tienes suficiente nivel para usar este comando");
} // Esta 4459
El otro warning linea (12118, es el rRace modificado :P):
Код:
StartRace(playerid);
Pero el cуdigo en general es este:
Код:
function CountTillRace(playerid)
{
	switch(CountAmount)
	{
 		case 0:
	    {
			ForEach(i, MAX_PLAYERS)
			{
			    if(Joined[i] == false)
			    {
			        new
			            string[256]
					;
					format(string, sizeof(string), ">> El tiempo para ingresar a la carrera \"%s\" ha terminado", RaceName);
					TextDrawHideForAll(EntrarCarrera);
					TextDrawHideForAll(CuadroEntrarCarrera);
				}
			}
			StartRace(playerid); // Esta 12188
	    }
	    case 5:
	    {
	        new string[256];

			format(string, sizeof(string), "~w~La carrera ~g~~h~~h~%s ~w~comenzara en ~r~~h~%d segundos~w~, usa ~p~/entrarc ~w~para entrar", RaceName, CountAmount);
			TextDrawSetString(EntrarCarrera,string);
			TextDrawShowForAll(CuadroEntrarCarrera);

			format(string, sizeof(string), "%d", CountAmount);
			ForEach(i, MAX_PLAYERS)
			{
			    if(Joined[i] == true)
			    {
			    	GameTextForPlayer(i, string, 1000,6);
			    	PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
			    	GetPlayerPos(i,PosCarrera[playerid][0],PosCarrera[playerid][1],PosCarrera[playerid][2]);
			    	SetPlayerCameraLookAt(i, PosCarrera[i][0]+2, PosCarrera[i][1], PosCarrera[i][2]-1);
			    }
			}
	    }
	    case 4:
	    {
	        new string[256];

			format(string, sizeof(string), "~w~La carrera ~g~~h~~h~%s ~w~comenzara en ~r~~h~%d segundos~w~, usa ~p~/entrarc ~w~para entrar", RaceName, CountAmount);
			TextDrawSetString(EntrarCarrera,string);
			TextDrawShowForAll(CuadroEntrarCarrera);

			format(string, sizeof(string), "%d", CountAmount);
			ForEach(i, MAX_PLAYERS)
			{
			    if(Joined[i] == true)
			    {
			    	GameTextForPlayer(i, string, 1000,6);
			    	PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
			    	GetPlayerPos(i,PosCarrera[playerid][0],PosCarrera[playerid][1],PosCarrera[playerid][2]);
			    	SetPlayerCameraLookAt(i, PosCarrera[i][0]+4, PosCarrera[i][1], PosCarrera[i][2]-2);
                    //Camera(i, RaceVehCoords[0][0]+4, RaceVehCoords[0][1], RaceVehCoords[0][2]-2,RaceVehCoords[0][3], 20);
			    }
			}
	    }
	    case 3:
	    {
	        new string[256];

			format(string, sizeof(string), "~w~La carrera ~g~~h~~h~%s ~w~comenzara en ~r~~h~%d segundos~w~, usa ~p~/entrarc ~w~para entrar", RaceName, CountAmount);
			TextDrawSetString(EntrarCarrera,string);
			TextDrawShowForAll(CuadroEntrarCarrera);

			format(string, sizeof(string), "%d", CountAmount);
			ForEach(i, MAX_PLAYERS)
			{
			    if(Joined[i] == true)
			    {
			    	GameTextForPlayer(i, string, 1000,6);
			    	PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
			    	GetPlayerPos(i,PosCarrera[playerid][0],PosCarrera[playerid][1],PosCarrera[playerid][2]);
			    	SetPlayerCameraLookAt(i, PosCarrera[i][0]+6, PosCarrera[i][1], PosCarrera[i][2]-3);
	                //Camera(i, RaceVehCoords[0][0]+6, RaceVehCoords[0][1], RaceVehCoords[0][2]-3,RaceVehCoords[0][3], 20);
			    }
			}
	    }
	    case 2:
	    {
	        new string[256];

			format(string, sizeof(string), "~w~La carrera ~g~~h~~h~%s ~w~comenzara en ~r~~h~%d segundos~w~, usa ~p~/entrarc ~w~para entrar", RaceName, CountAmount);
			TextDrawSetString(EntrarCarrera,string);
			TextDrawShowForAll(CuadroEntrarCarrera);

			format(string, sizeof(string), "%d", CountAmount);
			ForEach(i, MAX_PLAYERS)
			{
			    if(Joined[i] == true)
			    {
			    	GameTextForPlayer(i, string, 1000,6);
			    	PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
			    	GetPlayerPos(i,PosCarrera[playerid][0],PosCarrera[playerid][1],PosCarrera[playerid][2]);
			    	SetPlayerCameraLookAt(i, PosCarrera[i][0]+8, PosCarrera[i][1], PosCarrera[i][2]-4);
	                //Camera(i, RaceVehCoords[0][0]+8, RaceVehCoords[0][1], RaceVehCoords[0][2]-4,RaceVehCoords[0][3], 20);
			    }
			}
	    }
	    case 1:
	    {
	        new string[256];

			format(string, sizeof(string), "~w~La carrera ~g~~h~~h~%s ~w~comenzara en ~r~~h~%d segundos~w~, usa ~p~/entrarc ~w~para entrar", RaceName, CountAmount);
			TextDrawSetString(EntrarCarrera,string);
			TextDrawShowForAll(CuadroEntrarCarrera);

			format(string, sizeof(string), "%d", CountAmount);
			ForEach(i, MAX_PLAYERS)
			{
			    if(Joined[i] == true)
			    {
			    	GameTextForPlayer(i, string, 1000,6);
			    	PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
			    	GetPlayerPos(i,PosCarrera[playerid][0],PosCarrera[playerid][1],PosCarrera[playerid][2]);
			    	SetPlayerCameraLookAt(i, PosCarrera[i][0]+10, PosCarrera[i][1], PosCarrera[i][2]-5);
	                //Camera(i, RaceVehCoords[0][0]+10, RaceVehCoords[0][1], RaceVehCoords[0][2]-5,RaceVehCoords[0][3], 20);
			    }
			}
	    }

	    case 6..60:
	    {
	        new string[256];
			format(string, sizeof(string), "~w~La carrera ~g~~h~~h~%s ~w~comenzara en ~r~~h~%d segundos~w~, usa ~p~/entrarc ~w~para entrar", RaceName, CountAmount);
			TextDrawSetString(EntrarCarrera,string);
			TextDrawShowForAll(EntrarCarrera);
			TextDrawShowForAll(CuadroEntrarCarrera);

			format(string, sizeof(string), "%d", CountAmount);
			ForEach(i, MAX_PLAYERS)
			{
			    if(Joined[i] == true)
			    {
			    	GameTextForPlayer(i, string, 1000,6);
			    	PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
			    }
			}

	    }
	}
	return CountAmount--;
}
Eso, espero que me ayuden xD... otra cosa, como Ђ#@|!? hago un spoiler? saludos
Reply
#2

puedes decirme cuales son exactamente las lineas de los warnings? seсalalas con "//<-"
Reply
#3

Listo, estбn marcadas con // :P
Oye david, no te acuerdas de mi? :c
Pasame tu fb que ya no entro al msn XDDD
Reply
#4

pawn Код:
dcmd_rango(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 1) {
        if(RangoEnElChat[playerid] == 0) {
           RangoEnElChat[playerid] = 1;
           ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, " {9933CC}|| HABLAR AUTOMБTICAMENTE ||", "{FFFFFF}Ahora cuando hables, se te agregarб tu rango, usa de nuevo el comando para desactivarlo!", "Cerrar", "");
  return CMDMessageToAdmins(playerid,"RANGO");
        } else {
            RangoEnElChat[playerid] = 0;
        } CMDMessageToAdmins(playerid,"RANGO (OFF)");
      return ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, " {9933CC}|| HABLAR AUTOMБTICAMENTE ||", "{FFFFFF}Ahora podrбs hablar como usuario normal!", "Cerrar", ""); // Esta 4457
    } else return SendClientMessage(playerid,red,"{9933CC}[ADMINISTRACION]:{FFFFFF} No tienes suficiente nivel para usar este comando");
return 1;
} // Esta 4459
Reply
#5

El primero y el segundo es por los return, saca los que no son necesarios. El que manda el mensaje "RANGO (OFF)" me parece que lo tenes mal ubicado.
Reply
#6

Gracias a los 2, ahora solo me falta el ъltimo... :P
Reply
#7

Te esta diciendo que te faltan o pusiste de mбs en los argumentos.

Ej:

stock A(b, c)

y despuйs usas A(b);, te falta c.
Reply
#8

Y cual podrнa ser? :/
Reply
#9

Quote:
Originally Posted by Matyaas
Посмотреть сообщение
Y cual podrнa ser? :/
Ve a la definiciуn de la funciуn y miras cual hace falta o cual estб demбs.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)