Jump to content

Question

Posted

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

3 answers to this question

Recommended Posts

  • 0
Posted (edited)

	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
  • 0
Posted
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.