Jump to content

Question

Posted

[pawn]warning 219: local variable "lights" shadows a variable at a preceding level[/pawn]

Linia de la care imi da eroare :

[pawn]27. #define MIN_WINNINGS (1000) //Cel mai mic pret la Fast Event[/pawn]

7 answers to this question

Recommended Posts

Posted

[pawn]D:\samp 0.3xa\pawno\include\SpikeStrip.inc(27) : warning 219: local variable "lights" shadows a variable at a preceding level

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Warning.[/pawn]

deci ba da aia este linia

Posted

[pawn]#include <a_samp>

#define MAX_SPIKESTRIPS 20

enum sInfo

{

sCreated,

    Float:sX,

    Float:sY,

    Float:sZ,

    sObject,

};

new SpikeInfo[MAX_SPIKESTRIPS][sInfo];

public OnPlayerUpdate(playerid)

{

if(!IsPlayerConnected(playerid)) return 0;

    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

    {

        for(new i = 0; i < sizeof(SpikeInfo); i++)

      {

          if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[sX], SpikeInfo[sY], SpikeInfo[sZ]))

            {

              if(SpikeInfo[sCreated] == 1)

              {

                  new panels, doors, lights, tires;

                  new carid = GetPlayerVehicleID(playerid);

            GetVehicleDamageStatus(carid, panels, doors, lights, tires);

            tires = encode_tires(1, 1, 1, 1);

            UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);

                  return 0;

              }

          }

      }

  }

return 1;

}

stock CreateStrip(Float:x,Float:y,Float:z,Float:Angle)

{

    for(new i = 0; i < sizeof(SpikeInfo); i++)

  {

      if(SpikeInfo[sCreated] == 0)

      {

            SpikeInfo[sCreated]=1;

            SpikeInfo[sX]=x;

            SpikeInfo[sY]=y;

            SpikeInfo[sZ]=z-0.7;

            SpikeInfo[sObject] = CreateObject(2899, x, y, z-0.9, 0, 0, Angle-90);

        return 1;

      }

  }

  return 0;

}

stock DeleteAllStrip()

{

    for(new i = 0; i < sizeof(SpikeInfo); i++)

  {

      if(SpikeInfo[sCreated] == 1)

      {

          SpikeInfo[sCreated]=0;

            SpikeInfo[sX]=0.0;

            SpikeInfo[sY]=0.0;

            SpikeInfo[sZ]=0.0;

            DestroyObject(SpikeInfo[sObject]);

      }

}

    return 0;

}

stock DeleteClosestStrip(playerid)

{

    for(new i = 0; i < sizeof(SpikeInfo); i++)

  {

      if(IsPlayerInRangeOfPoint(playerid, 2.0, SpikeInfo[sX], SpikeInfo[sY], SpikeInfo[sZ]))

        {

          if(SpikeInfo[sCreated] == 1)

            {

                SpikeInfo[sCreated]=0;

                SpikeInfo[sX]=0.0;

                SpikeInfo[sY]=0.0;

                SpikeInfo[sZ]=0.0;

                DestroyObject(SpikeInfo[sObject]);

                return 1;

          }

      }

  }

    return 0;

}

encode_tires(tires1, tires2, tires3, tires4) {

return tires1 | (tires2 << 1) | (tires3 << 2) | (tires4 << 3);

}[/pawn]

Poftim tot din acel include

Posted

Incearca asa:

[pawn]

#include <a_samp>

#define MAX_SPIKESTRIPS 20

enum sInfo

{

sCreated,

    Float:sX,

    Float:sY,

    Float:sZ,

    sObject,

};

new SpikeInfo[MAX_SPIKESTRIPS][sInfo];

public OnPlayerUpdate(playerid)

{

if(!IsPlayerConnected(playerid)) return 0;

    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

    {

        for(new i = 0; i < sizeof(SpikeInfo); i++)

      {

          if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[sX], SpikeInfo[sY], SpikeInfo[sZ]))

            {

              if(SpikeInfo[sCreated] == 1)

              {

                  new panels, doors, lights1, tires;

                  new carid = GetPlayerVehicleID(playerid);

            GetVehicleDamageStatus(carid, panels, doors, lights1, tires);

            tires = encode_tires(1, 1, 1, 1);

            UpdateVehicleDamageStatus(carid, panels, doors, lights1, tires);

                  return 0;

              }

          }

      }

  }

return 1;

}

stock CreateStrip(Float:x,Float:y,Float:z,Float:Angle)

{

    for(new i = 0; i < sizeof(SpikeInfo); i++)

  {

      if(SpikeInfo[sCreated] == 0)

      {

            SpikeInfo[sCreated]=1;

            SpikeInfo[sX]=x;

            SpikeInfo[sY]=y;

            SpikeInfo[sZ]=z-0.7;

            SpikeInfo[sObject] = CreateObject(2899, x, y, z-0.9, 0, 0, Angle-90);

        return 1;

      }

  }

  return 0;

}

stock DeleteAllStrip()

{

    for(new i = 0; i < sizeof(SpikeInfo); i++)

  {

      if(SpikeInfo[sCreated] == 1)

      {

          SpikeInfo[sCreated]=0;

            SpikeInfo[sX]=0.0;

            SpikeInfo[sY]=0.0;

            SpikeInfo[sZ]=0.0;

            DestroyObject(SpikeInfo[sObject]);

      }

}

    return 0;

}

stock DeleteClosestStrip(playerid)

{

    for(new i = 0; i < sizeof(SpikeInfo); i++)

  {

      if(IsPlayerInRangeOfPoint(playerid, 2.0, SpikeInfo[sX], SpikeInfo[sY], SpikeInfo[sZ]))

        {

          if(SpikeInfo[sCreated] == 1)

            {

                SpikeInfo[sCreated]=0;

                SpikeInfo[sX]=0.0;

                SpikeInfo[sY]=0.0;

                SpikeInfo[sZ]=0.0;

                DestroyObject(SpikeInfo[sObject]);

                return 1;

          }

      }

  }

    return 0;

}

encode_tires(tires1, tires2, tires3, tires4) {

return tires1 | (tires2 << 1) | (tires3 << 2) | (tires4 << 3);

}

[/pawn]

Guest
This topic is now closed to further replies.
×
×
  • 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.