4 errors?
#1

Why getting these errors?

Код:
E:\RP\gamemodes\RP1.pwn(29116) : warning 206: redundant test: constant expression is non-zero
E:\RP\gamemodes\RP1.pwn(63683) : warning 204: symbol is assigned a value that is never used: "type"
E:\RP\gamemodes\RP1.pwn(104305) : warning 217: loose indentation
E:\RP\gamemodes\RP1.pwn(104450) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Warnings.
Reply
#2

Can you show us the script ? And this is not errors but warnings

Show line 29116, 63683, 104305, 104450.
Reply
#3

Show the lines + some code like each error show 5-6 lines.. and red mark the error.line so that we can understand like error 1- give us line from 29110 - 29120 and mark 29116 red.. and same with all , so that we can see which line have error.. wow
Reply
#4

Quote:

warning 206: redundant test: constant expression is non-zero

You'll have to show the code.

Quote:

warning 204: symbol is assigned a value that is never used: "type"

You created a variable called "type", but you aren't using it, so just delete it.

Quote:

warning 217: loose indentation

Your indentation is improper, read these to know how to fix indentation:
https://sampwiki.blast.hk/wiki/Errors_Li...se_indentation
https://sampforum.blast.hk/showthread.php?tid=256961
Reply
#5

about "type you defined type which is not being used so thats why compiler showing you that error and about warnings

pawn Код:
If(gData[playerid][Dom] != 2)
{
  SetPlayerHealth(playerid, 10); // there is a bit space
    SendClientMessage(playerid, -1, "more space in this line so thats why compiler shows loose indentation warning");

}
Reply
#6

yea i meant warnings. they shouldn't show... since I didn't edit anything new.

Line: 29116:

Код:
	if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
        {
        new vehicleid = GetPlayerVehicleID(playerid),
        playingid = v_VehicleInfo[vehicleid][RadioPlaying];
        if(USE_TEXTDRAW_SET == 2)
            {
            format(string,sizeof(string),"Listening to: ~n~~w~%s",r_RadioInfo[playingid][r_Name]);
            TextDrawSetString(v_VehicleInfo[vehicleid][r_Draw],string);
            }
        else
            {
            TextDrawSetString(v_VehicleInfo[vehicleid][r_Draw],r_RadioInfo[playingid][r_Name]);
            }
        TextDrawShowForPlayer(playerid,v_VehicleInfo[vehicleid][r_Draw]);
        SetPVarInt(playerid,"ID_HideRadioTextdraw",SetTimerEx("HideRadioTextdraw",TEXTDRAW_DISAPPEAR_TIME,false,"ii",playerid,vehicleid));
        PlayAudioStreamForPlayer(playerid,r_RadioInfo[playingid][r_Link]);
        SetPVarInt(playerid,"ID_OldVehicle",vehicleid);
        }
    	if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
        {
        new vehicleid = GetPVarInt(playerid,"ID_OldVehicle"),
            timer = GetPVarInt(playerid,"ID_HideRadioTextdraw");
        if(timer != -1)
            {
            TextDrawHideForPlayer(playerid,v_VehicleInfo[vehicleid][r_Draw]);
            KillTimer(timer);
            }
        StopAudioStreamForPlayer(playerid);
    }
Exact line: if(USE_TEXTDRAW_SET == 2)

Код:
if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        new type = FactionInfo[PlayerInfo[playerid][pMember]][FactionType];
			new tmpcar = GetPlayerVehicleID(playerid);
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/m)egaphone [megaphone chat]");
				return 1;
			}
			if(IsACop(playerid) || PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4|| IsASoldier(playerid) || IsAnAgent(playerid) || IsAMedic(playerid))
			{
				if(!IsACopCar(tmpcar) && !IsAnAmbulance(tmpcar) && !IsANGCar(tmpcar))
				{
					SendClientMessage(playerid, COLOR_GRAD2, "   You are not in a Government vehicle !");
					return 1;
				}
				else if(IsACop(playerid))
				{
					format(string, sizeof(string), "[Officer %s:o< %s]", sendername, result);
					ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
				}
				else if(IsAnAgent(playerid))
				{
					format(string, sizeof(string), "[Agent %s:o< %s]", sendername, result);
					ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
				}
				else if(IsAMedic(playerid))
				{
				    format(string, sizeof(string), "[Doctor %s:o< %s]", sendername, result);
				    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
				}
				else if(IsASoldier(playerid))
				{
				    format(string, sizeof(string), "[Soldier %s:o< %s]", sendername, result);
				    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GRAD2, "   You are not part of a Faction !");
				return 1;
			}
		}
		return 1;
	}
Line 63683: new type = FactionInfo[PlayerInfo[playerid][pMember]][FactionType];

Код:
		if(current == paintjobs_menu)
		{
		switch(row)
		{
		    case 0:
		    {
		        if(GetVehicleModel(install_mod_car[playerid]) == 562 ||
				GetVehicleModel(install_mod_car[playerid]) == 565 ||
				GetVehicleModel(install_mod_car[playerid]) == 559 ||
				GetVehicleModel(install_mod_car[playerid]) == 561 ||
				GetVehicleModel(install_mod_car[playerid]) == 560 ||
				GetVehicleModel(install_mod_car[playerid]) == 575 ||
				GetVehicleModel(install_mod_car[playerid]) == 534 ||
				GetVehicleModel(install_mod_car[playerid]) == 567 ||
				GetVehicleModel(install_mod_car[playerid]) == 536 ||
				GetVehicleModel(install_mod_car[playerid]) == 535 ||
				GetVehicleModel(install_mod_car[playerid]) == 576 ||
				GetVehicleModel(install_mod_car[playerid]) == 558 ||
				GetVehicleModel(install_mod_car[playerid]) == 483)
		        {
					new car = install_mod_car[playerid];
					SetVehiclePaintjob(car, 0);
					PlayerPlaySound(playerid, 1134, 0, 0, 0);
					ShowMenuForPlayer(paintjobs_menu, playerid);
				}
				else
				{
					SendClientMessage(playerid, GREY, "This vehicle doesn't support Paintjobs.");
			        ShowMenuForPlayer(tuning_menu, playerid);
				}
			}
Line: 104305: if(current == paintjobs_menu)

if(current == exhausts_menu)
Reply
#7

USE_TEXTDRAW_SET is not a variable. Perhaps you #define it.... The syntax is similar

if( constant1 == constant2 ) has no sense as condition
Reply
#8

We told you how to fix the other warnings.
For 29116, show how you declare USE_TEXTDRAW_SET.
Reply
#9

I already pasted that 29116 line.
Reply
#10

Yes, but show where you define "USE_TEXTDRAW_SET".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)