Script warnings
#1

I get these 3 warnings while compiling my script. 2nd and 3rd warning is fixed.

-----------------

1st warning = redundant test: constant expression is non-zero

Code relating to the error

pawn Code:
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
            {
                new vehicleid = GetPlayerVehicleID(playerid),
                playingid = v_VehicleInfo[vehicleid][RadioPlaying];
               
                if(TEXTDRAWSET == 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);
            }
Specific code related to the error

pawn Code:
if(TEXTDRAWSET == 2)
Hope you can at-least tell me what's the problem, I will appreciate it!
Reply
#2

pawn Code:
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        new playingid = v_VehicleInfo[vehicleid][RadioPlaying];
      //End bracket below the else relating above
About the 2nd and the 3rd warnings, I may assume that the bracket is the last line of your script?
When you are getting an error like: "symbol is never used:", that means that the symbol is never used, simple as that. You may delete the variable (symbol) or use it.
Reply
#3

Thanks zxc1, fixed the 2nd and 3rd error. Surprisingly, another error pounced out of nowhere. Updated the topic, read it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)