Jump to content
  • 0

Warning


buNNy

Question

Cum rezolv warningul asta?

fire2.inc(46) : warning 219: local variable "FIREID" shadows a variable at a preceding level

Spoiler

stock AddFire(Float:x, Float:y, Float:z, Health)
{
        TotalFires++;
        new FIREID = TotalFires;                                 //Linia cu eroare
        FireObj[FIREID] = CreateObject(3461, x, y, z-2.61, 0, 0, 0.0);
        FirePos[FIREID][0] = x, FirePos[FIREID][1] = y, FirePos[FIREID][2] = z;
        FireHealth[FIREID] = Health;
        FireHealthMax[FIREID] = Health;
        #if defined Labels
            new string[128];
            format(string, sizeof(string), "%d/%d", FireHealth[FIREID], FireHealthMax[FIREID]);
            FireText[FIREID] = CreateDynamic3DTextLabel(string, 0xFFFFFFFFF, x, y, z, 20, 0);
        #endif
}
stock DeleteFire(FIREID)
{
        DestroyObject(FireObj[FIREID]);
        TotalFires--;
        FirePos[FIREID][0] = 0, FirePos[FIREID][1] = 0, FirePos[FIREID][2] = 0;
        #if defined Labels
            Delete3DTextLabel(FireText[FIREID]);
        #endif
}

 

COMUNITATEA MEA DE RESURSE
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spacer.png
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
www.codeup.ro / www.codeup.ro/forum

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

	TotalFires++;
FireObj[TotalFires] = CreateObject(3461, x, y, z-2.61, 0, 0, 0.0);
FirePos[TotalFires][0] = x, FirePos[TotalFires][1] = y, FirePos[TotalFires][2] = z;
FireHealth[TotalFires] = Health;
FireHealthMax[TotalFires] = Health;
#if defined Labels
    new string[128];
    format(string, sizeof(string), "%d/%d", FireHealth[TotalFires], FireHealthMax[TotalFires]);
    FireText[TotalFires] = CreateDynamic3DTextLabel(string, 0xFFFFFFFFF, x, y, z, 20, 0);
#endif
	

Edited by iSkull
Link to comment
Share on other sites

  • 0
Acum 21 ore, iSkull a spus:

 

	TotalFires++;
FireObj[TotalFires] = CreateObject(3461, x, y, z-2.61, 0, 0, 0.0);
FirePos[TotalFires][0] = x, FirePos[TotalFires][1] = y, FirePos[TotalFires][2] = z;
FireHealth[TotalFires] = Health;
FireHealthMax[TotalFires] = Health;
#if defined Labels
    new string[128];
    format(string, sizeof(string), "%d/%d", FireHealth[TotalFires], FireHealthMax[TotalFires]);
    FireText[TotalFires] = CreateDynamic3DTextLabel(string, 0xFFFFFFFFF, x, y, z, 20, 0);
#endif
	

 

ms.

COMUNITATEA MEA DE RESURSE
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spacer.png
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
www.codeup.ro / www.codeup.ro/forum

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.