redundant code: constant expression is zero
#1

I got redundant code: constant expression is zero from SendClientMessageToAllEx, dont worry about Packed: , its from ps-format include . . .
Код:
SendClientMessageToAllEx(color, const fmat[], va_args<>)
{
	new
		Packed:str[144];

	va_format(str, sizeof (str), !fmat, va_start<2>);

	foreach(new i : Player) if (PlayerData[i][pGameplay] == 2) {
 		SendClientMessage(i, color, str);
	}
	return 1;
}

KickEx(targetid, string:reason[], announce = false, playerid = INVALID_PLAYER_ID)
{
	if (announce) {
		if (playerid != INVALID_PLAYER_ID)
			SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was kicked from the server by %s, reason: %s", GetPlayerNameEx(targetid, false), GetPlayerNameEx(playerid, false), reason);
		else
			SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was kicked from the server, reason: %s", GetPlayerNameEx(targetid, false), reason);
	}	
	if (playerid != INVALID_PLAYER_ID) {
		Dialog_Show(playerid, _Show, DIALOG_STYLE_MSGBOX, "You're kicked from server!", CHAT_WHITE"Hello %s!\n\nYou're kicked from server including reason:\n\"%s\"\n\nPlease, dont do it again!\nBut if you're sure it's not your fault,\nYou can report %s to our forum.", "Ok", "", GetPlayerNameEx(targetid, false), reason, GetPlayerNameEx(playerid, false));
	}
	else {
		Dialog_Show(playerid, _Show, DIALOG_STYLE_MSGBOX, "You're kicked from server!", CHAT_WHITE "Hello %s!\n\nYou're kicked from server including reason:\n\"%s\"", "Ok", "", reason);
	}
	return Kick(targetid);
}
Reply
#2

I think the problem is using Packed, beacuse I removed it and I've got no warnings.

Код:
SendClientMessageToAllEx(color, const fmat[], va_args<>)
{
	new
		str[144];

	va_format(str, sizeof (str), fmat, va_start<2>);

	foreach(new i : Player) 
 		SendClientMessage(i, color, str);

	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)