Warnig en consola.
#1

їPorquй sale warning cada vez que uso un comando?

Код:
[11:15:34] [CMD] [Jake Taoka]: /editarb exterior 18 
[11:15:34] sscanf warning: No default value found.


El comando es:

Код:
CMD:editarb(playerid, params[])
{
	if(Info[playerid][pAdminZC] < 3)
	{
		SendClientMessageEx(playerid, COLOR_GRAD2, "No puedes usar este comando!");
		return 1;
	}

	new choice[32], string[128], bid, amount;
	if(sscanf(params, "s[32]dD", choice, bid, amount))
	{
		SendClientMessageEx(playerid, COLOR_WHITE, "USA: /editarb [name] [bid] [amount]");
		SendClientMessageEx(playerid, COLOR_GREY, "Available names: Exterior, Interior, Nivel, Precio, Ganancias");
		SendClientMessageEx(playerid, COLOR_GREY, "CustomInterior, CustomExterior, NoEntrar, Productos, Tipo");
		return 1;
	}

	if(bid >= MAX_BIZZ)
	{
		SendClientMessageEx( playerid, COLOR_WHITE, "Bizz ID Invбlida!");
		return 1;
	}

	if(strcmp(choice, "interior", true) == 0)
	{
		GetPlayerPos(playerid, BizzInfo[bid][bInteriorx], BizzInfo[bid][bInteriory], BizzInfo[bid][bInteriorz]);
		SendClientMessageEx(playerid, COLOR_WHITE, "Cambiaste el interior!");
		BizzInfo[bid][bInteriorInt] = GetPlayerInterior(playerid);
		BizzInfo[bid][bInteriorVW] = GetPlayerVirtualWorld(playerid);
  		UpdateBizz();
  		return 1;
	}
	else if(strcmp(choice, "exterior", true) == 0)
	{
		GetPlayerPos(playerid, BizzInfo[bid][bEntrancex], BizzInfo[bid][bEntrancey], BizzInfo[bid][bEntrancez]);
		SendClientMessageEx(playerid, COLOR_WHITE, "Cambiaste el exterior!");
        BizzInfo[bid][bExteriorInt] = GetPlayerInterior(playerid);
		BizzInfo[bid][bExteriorVW] = GetPlayerVirtualWorld(playerid);
		OnBizzTextdrawUpdate(bid);
		UpdateBizz();
		return 1;
	}
	else if(strcmp(choice, "nivel", true) == 0)
	{
		BizzInfo[bid][bLevelNeeded] = amount;
		format(string, sizeof(string), "Cambiaste el nivel del negocio %d a %d", bid, amount);
		SendClientMessageEx(playerid, COLOR_WHITE, string);
		OnBizzTextdrawUpdate(bid);
		UpdateBizz();
		return 1;
	}
	else if(strcmp(choice, "precio", true) == 0)
	{
		BizzInfo[bid][bBuyPrice] = amount;
		format(string, sizeof(string), "Cambiaste el precio del negocio %d a $%d", bid, amount);
		SendClientMessageEx(playerid, COLOR_WHITE, string);
		OnBizzTextdrawUpdate(bid);
		UpdateBizz();
		return 1;
	}
	else if(strcmp(choice, "ganancias", true) == 0)
	{
		BizzInfo[bid][bTill] = amount;
		format(string, sizeof(string), "Cambiaste las ganancias del negocio %d a $%d", bid, amount);
		SendClientMessageEx(playerid, COLOR_WHITE, string);
		OnBizzTextdrawUpdate(bid);
		UpdateBizz();
		return 1;
	}
	else if(strcmp(choice, "productos", true) == 0)
	{
		BizzInfo[bid][bProductos] = amount;
		format(string, sizeof(string), "Cambiaste los productos del negocio %d a %d", bid, amount);
		SendClientMessageEx(playerid, COLOR_WHITE, string);
		OnBizzTextdrawUpdate(bid);
		UpdateBizz();
		return 1;
	}
	else if(strcmp(choice, "tipo", true) == 0) // 1. 24-7 2. Ammu-Nation 3. Puerto 4. Electronica 5. Sexshop 6. Tienda de Ropa 7. Burguer Shot 8. Clukin' Bell 9. Pizza Co 10. Otro (Resaturante)
	{
		BizzInfo[bid][bTipo] = amount;
		format(string, sizeof(string), "Cambiaste el tipo del negocio %d a %d", bid, amount);
		SendClientMessageEx(playerid, COLOR_WHITE, string);
		OnBizzTextdrawUpdate(bid);
		UpdateBizz();
		return 1;
	}
	else if(strcmp(choice, "custominterior", true) == 0)
	{
		if(BizzInfo[bid][bCustomInterior] == 0)
		{
			BizzInfo[bid][bCustomInterior] = 1;
			SendClientMessageEx(playerid, COLOR_WHITE, "Estableciste a Interior Personalizado!");
		}
		else
		{
			BizzInfo[bid][bCustomInterior] = 0;
			SendClientMessageEx(playerid, COLOR_WHITE, "Estableciste a Interior Normal!");
		}
		UpdateBizz();
		return 1;
	}
	else if(strcmp(choice, "customexterior", true) == 0)
	{
		if(BizzInfo[bid][bCustomExterior] == 0)
		{
			BizzInfo[bid][bCustomExterior] = 1;
			SendClientMessageEx(playerid, COLOR_WHITE, "Estableciste a Exterior Personalizado!");
		}
		else
		{
			BizzInfo[bid][bCustomExterior] = 0;
			SendClientMessageEx(playerid, COLOR_WHITE, "Estableciste a Exterior Normal!");
		}
		UpdateBizz();
		return 1;
	}
	else if(strcmp(choice, "noentrar", true) == 0)
	{
		if(BizzInfo[bid][bNoEnter] == 0)
		{
			BizzInfo[bid][bNoEnter] = 1;
			SendClientMessageEx(playerid, COLOR_WHITE, "Ahora no se puede entrar a este negocio");
		}
		else
		{
			BizzInfo[bid][bNoEnter] = 0;
			SendClientMessageEx(playerid, COLOR_WHITE, "Ahora se puede entrar a este negocio");
		}
		UpdateBizz();
		return 1;
	}
	return 1;
}
Reply
#2

Al ser un parбmetro opcional debe tener un valor por defecto si no es usado.
Код:
sscanf(params, "s[32]dD(0)", choice, bid, amount)
Reply
#3

Me salio el siguiente error;

linea 22528

Код:
{
linea 22535

Код:
if(bid >= MAX_BIZZ)
Код:
D:\Al\C1\gamemodes\Los.pwn(22528) : error 001: expected token: ";", but found "{"
D:\Al\C1\gamemodes\Los.pwn(22535) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

if(bid >= MAX_BIZZ) Creo que hace falta otro ")"
Reply
#5

debiste mover algo y no te diste cuenta.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)