How to fix this??
#1

Hello there,
how to fix this??
Код:
C:\Documents and Settings\user\Desktop\xxx\xxxx\pawno\include\SpikeStrip.inc(25) : warning 219: local variable "doors" shadows a variable at a preceding level
C:\Documents and Settings\user\Desktop\xxx\xxxx\pawno\include\SpikeStrip.inc(25) : warning 219: local variable "lights" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
i've use spikestrip inculde :

pawn Код:
#include <a_samp>

#define MAX_SPIKESTRIPS 200

enum sInfo
{
    sCreated,
    Float:sX,
    Float:sY,
    Float:sZ,
    sObject,
};
new SpikeInfo[MAX_SPIKESTRIPS][sInfo];

public OnPlayerUpdate(playerid)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        for(new i = 0; i < sizeof(SpikeInfo); i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
            {
                if(SpikeInfo[i][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[i][sCreated] == 0)
        {
            SpikeInfo[i][sCreated]=1;
            SpikeInfo[i][sX]=x;
            SpikeInfo[i][sY]=y;
            SpikeInfo[i][sZ]=z-0.7;
            SpikeInfo[i][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[i][sCreated] == 1)
        {
            SpikeInfo[i][sCreated]=0;
            SpikeInfo[i][sX]=0.0;
            SpikeInfo[i][sY]=0.0;
            SpikeInfo[i][sZ]=0.0;
            DestroyObject(SpikeInfo[i][sObject]);
        }
    }
    return 0;
}

stock DeleteClosestStrip(playerid)
{
    for(new i = 0; i < sizeof(SpikeInfo); i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
        {
            if(SpikeInfo[i][sCreated] == 1)
            {
                SpikeInfo[i][sCreated]=0;
                SpikeInfo[i][sX]=0.0;
                SpikeInfo[i][sY]=0.0;
                SpikeInfo[i][sZ]=0.0;
                DestroyObject(SpikeInfo[i][sObject]);
                return 1;
            }
        }
    }
    return 0;
}

encode_tires(tires1, tires2, tires3, tires4) {

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

}
thanks
Reply
#2

Help me pls
Reply
#3

Remove the
pawn Код:
new doors, lights
You probably have it in a variable for your engine/lights, etc coding.
Reply
#4

Quote:
Originally Posted by austin070
Посмотреть сообщение
Remove the
pawn Код:
new doors, lights
You probably have it in a variable for your engine/lights, etc coding.
i've done with that..
when i compile it, that was same probe..
Reply
#5

You made this:
pawn Код:
new panels, doors, lights, tires;
look like this?:
pawn Код:
new panels, tires;
Reply
#6

Quote:
Originally Posted by Tama
Посмотреть сообщение
i've done with that..
when i compile it, that was same probe..
pawn Код:
new var1;

public OnPlayerConnect(playerid)
{
     new var1;
     return 1;
}
would give your kind of warning.

pawn Код:
new var1;

public OnPlayerConnect(playerid)
{
     new var2;
     return 1;
}
Would fix it.
Reply
#7

Quote:
Originally Posted by austin070
Посмотреть сообщение
You made this:
pawn Код:
new panels, doors, lights, tires;
look like this?:
pawn Код:
new panels, tires;
Yeah like that..

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
pawn Код:
new var1;

public OnPlayerConnect(playerid)
{
     new var1;
     return 1;
}
would give your kind of warning.

pawn Код:
new var1;

public OnPlayerConnect(playerid)
{
     new var2;
     return 1;
}
Would fix it.
same, that can't work
the spikestrip.inc needed to edit..
Reply
#8

Change the varialbe name, it's easy.
Reply
#9

post your error + the code
Reply
#10

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
Change the varialbe name, it's easy.
i have 1 error
Код:
C:\Documents and Settings\user\Desktop\titip\Raven's Roleplay 0.3c Tester\pawno\include\SpikeStrip.inc(18) : warning 219: local variable "var1" shadows a variable at a preceding level
C:\Documents and Settings\user\Desktop\titip\Raven's Roleplay 0.3c Tester\pawno\include\SpikeStrip.inc(18) : warning 203: symbol is never used: "var1"
C:\Documents and Settings\user\Desktop\titip\Raven's Roleplay 0.3c Tester\pawno\include\SpikeStrip.inc(32) : warning 219: local variable "doors" shadows a variable at a preceding level
C:\Documents and Settings\user\Desktop\titip\Raven's Roleplay 0.3c Tester\pawno\include\SpikeStrip.inc(32) : warning 219: local variable "lights" shadows a variable at a preceding level
C:\Documents and Settings\user\Desktop\titip\Raven's Roleplay 0.3c Tester\gamemodes\larp.pwn(4993) : error 021: symbol already defined: "Streamer_OnPlayerConnect"
C:\Documents and Settings\user\Desktop\titip\Raven's Roleplay 0.3c Tester\gamemodes\larp.pwn(84914) : warning 203: symbol is never used: "var1"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
sorry, for my bad..
im still newbie on pawno script
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)