Script warnings - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Script warnings (
/showthread.php?tid=428582)
Script warnings -
TheSka - 06.04.2013
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
Hope you can at-least tell me what's the problem, I will appreciate it!
Re: Script warnings -
zxc1 - 06.04.2013
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.
Re: Script warnings -
TheSka - 06.04.2013
Thanks zxc1, fixed the 2nd and 3rd error. Surprisingly, another error pounced out of nowhere. Updated the topic, read it.