SA-MP Forums Archive
Symbol is never used problem - 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: Symbol is never used problem (/showthread.php?tid=600663)



Symbol is never used problem - E7mad - 11.02.2016

Hello, I've scripted a function, to make a checkpoint and a 3d text label in same time, before using the function there are no warnings, but when I used the function at OnGameModeInit, I got two warnings!

PHP код:
stock CreateDynamicCPLabel(DynamicCPText3D:textlabelthetext[100], thecolorFloat:xFloat:yFloat:zFloat:sizeworldidinterioridplayeridFloat:streamdistancethetestlos)
{
    
DynamicCP CreateDynamicCP(xyzsizeworldidinterioridplayeridstreamdistance);
    
textlabel CreateDynamic3DTextLabel(thetextthecolorxyzstreamdistanceINVALID_PLAYER_IDINVALID_VEHICLE_IDthetestlosworldidinterioridplayeridstreamdistance);
    return 
1;

Код:
C:\Program Files\MyServer\pawno\include\required/stocks.inc(428) : warning 204: symbol is assigned a value that is never used: "textlabel"
C:\Program Files\MyServer\pawno\include\required/stocks.inc(427) : warning 204: symbol is assigned a value that is never used: "DynamicCP"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.



Re: Symbol is never used problem - Godey - 11.02.2016

Код:
stock CreateDynamicCPLabel( thetext[100], thecolor, Float:x, Float:y, Float:z, Float:size, worldid, interiorid, playerid, Float:streamdistance, thetestlos) 
{ 
    new DynamicCP, Text3D:textlabel;
    DynamicCP = CreateDynamicCP(x, y, z, size, worldid, interiorid, playerid, streamdistance); 
    textlabel = CreateDynamic3DTextLabel(thetext, thecolor, x, y, z, streamdistance, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, thetestlos, worldid, interiorid, playerid, streamdistance); 
    return 1; 
}
NOTE: UNTESTED


Re: Symbol is never used problem - PrO.GameR - 11.02.2016

If you want your DynamicCP and textlabel to actually change you should pass them as pointers
PHP код:
CreateDynamicCPLabel(&DynamicCP, &Text3D:textlabel thetext[100], thecolorFloat:xFloat:yFloat:zFloat:sizeworldidinterioridplayeridFloat:streamdistancethetestlos
This will probably remove these warnings too, but inform us if it didn't.


Re: Symbol is never used problem - K0P - 11.02.2016

Sometimes,the warning or error is not in the line specified by the compiler,maybe you forgot the ";" sign at the end of the line which is before this stock function.