Symbol is never used problem
#1

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.
Reply
#2

Код:
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
Reply
#3

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.
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)