Params and redundant test: constant expression is non-zero
#7

Quote:
Originally Posted by BigETI
Посмотреть сообщение
Did you just completly ignore my post?
I posted replay for you'r post after compiling and seen errors/warnings.

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
Is it like this?
pawn Код:
// For example:
dcmd_kill(playerid, params[])
{
    #pragma unused params
    SetPlayerHealth(playerid, 0.0);
    return 1;
}
I know it's giving the same warning for even a check (10 > 2), but you can try what BigETI said!



I believe he was typing more than 2 minutes and he didn't see your post until he posted a reply.
Код:
(266) : error 017: undefined symbol "params"
Line 266
Код:
#pragma unused params
Eample of the one of the dcmd params that gives me an warning:
Код:
dcmd_placeboombox(playerid, params[])
{
	if(PlayerInfo[playerid][pBoomBox] == 0) return SendClientMessage(playerid, COLOR_WHITE, "You don't have a BoomBox");
	if(GetPVarType(playerid, "pDynamicBB")) return SendClientMessage(playerid, COLOR_WHITE, "You already have a boombox out, use /pickupboombox.");

	foreach(Player, i)
	{
 		if(GetPVarType(i, "pDynamicBB"))
   		{
  			if(IsPlayerInRangeOfPoint(playerid, 30.0, GetPVarFloat(i, "pDynamicBBX"), GetPVarFloat(i, "pDynamicBBY"), GetPVarFloat(i, "pDynamicBBZ")))
			{
   				SendClientMessage(playerid, COLOR_WHITE, "You cannot put your boombox in this Radius");
			    return 1;
			}
		}
		new string[128];
		format(string, sizeof(string), "%s has placed a boombox on the floor!", SenderName(playerid));
		SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);

	    new Float:x, Float:y, Float:z, Float:a;
	    GetPlayerPos(playerid, x, y, z);
	    GetPlayerFacingAngle(playerid, a);
	    ApplyAnimation(playerid,"BOMBER","BOM_Plant_Crouch_In", 4.0, 0, 0, 0, 0, 0, 1);
	    x += (2 * floatsin(-a, degrees));
    	y += (2 * floatcos(-a, degrees));
    	z -= 1.0;

	    SetPVarInt(playerid, "pDynamicBB", CreateDynamicObject(2226, x, y, z, 0.0, 0.0, 0.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
	    SetPVarFloat(playerid, "pDynamicBBX", x); SetPVarFloat(playerid, "pDynamicBBY", y); SetPVarFloat(playerid, "pDynamicBBZ", z);
		format(string, sizeof(string), "{00FF00}Boombox Owner:{FFFFFF}%s\n{FF0000}/turnon{FFFFFF} to set your boombox \n{FFFF00}or\n{FF0000}/pickupboombox", SenderName(playerid));
	    SetPVarInt(playerid, "pDynamicBBLabel", _:CreateDynamic3DTextLabel(string, COLOR_WHITE, x, y, z+0.6, 5.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
		SetPVarInt(playerid, "pDynamicBBArea", CreateDynamicSphere(x, y, z, 30.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
		SetPVarInt(playerid, "pDynamicBBInt", GetPlayerInterior(playerid));
		SetPVarInt(playerid, "pDynamicBBVW", GetPlayerVirtualWorld(playerid));
	}
	return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)