Ayuda con йste error
#1

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\savegmunico.pwn(30563) : error 021: symbol already defined: "NameTimer"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Lнneas del error:

pawn Код:
public NameTimer()
{
    for(new i = 0;i < MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            for(new q = 0;q < MAX_PLAYERS;q++)
            {
                if(IsPlayerConnected(q))
                {
                    new Float:p1x;
                    new Float:p1y;
                    new Float:p1z;
                    new Float:p2x;
                    new Float:p2y;
                    new Float:p2z;
                    if(IsPlayerConnected(i) && IsPlayerConnected(q))
                    {
                        GetPlayerPos(i,p1x,p1y,p1z);
                        GetPlayerPos(q,p2x,p2y,p2z);
                        if(GetPointDistanceToPointExMorph(p1x,p1y,p1z,p2x,p2y,p2z) < pdistance)
                        {
                                ShowPlayerNameTagForPlayer(i,q,1);
                        }
                    }
                }
            }
        }
    }
}
Reply
#2

Код:
symbol already defined
Chekea si no tenes dos veces el public NameTimer()
Reply
#3

Busquй con control + F el NameTimer, y apareciу en йsta vez:

pawn Код:
public CustomPickups()
{
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new string[150];
    NameTimer();
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerPos(i, oldposx, oldposy, oldposz);
            if(oldposx!=0.0 && oldposy!=0.0 && oldposz!=0.0)
            {
                for(new h = 0; h < sizeof(HouseInfo); h++)
                {
                    if(PlayerToPoint(2.0, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
                    {
                        //TextDrawShowForPlayer(i, HouseDraw[i]);
                        if(HouseInfo[h][hOwned] == 1)
                        {
                            if(HouseInfo[h][hRent] > 0)
                            {
                                format(string, sizeof(string), "~r~~h~Propiedad Privada~n~~r~Renta: ~w~%d~g~$~n~~r~Habitaciones: ~w~%d~n~~b~~h~Usa~w~ /cinfo",HouseInfo[h][hRent],HouseInfo[h][hRooms]);
                            }
                            else
                            {
                                format(string, sizeof(string), "~r~~h~Propiedad Privada~n~~y~%s",HouseInfo[h][hOwner]);
                            }
                        }
                        else
                        {
                            format(string, sizeof(string), "~g~~h~Casa en Venta~n~~r~Precio: ~w~%d~g~$~n~~r~Nivel: ~w~%d~n~~b~~h~Usa~w~ /cinfo",HouseInfo[h][hValue],HouseInfo[h][hLevel]);
                        }
                        //TDStr(HouseDraw[i], string);
                        GameTextForPlayer(i, string, 5000, 3);
                        return 1;
                    }
                    else
                    {
                        //TextDrawHideForPlayer(i, HouseDraw[i]);
                    }
                }
                for(new sb = 0; sb < sizeof(SBizzInfo); sb++)
                {
                    if(PlayerToPoint(2.0, i, SBizzInfo[sb][sbEntranceX],SBizzInfo[sb][sbEntranceY],SBizzInfo[sb][sbEntranceZ]))
                    {
                        //TextDrawShowForPlayer(i, HouseDraw[i]);
                        format(string, sizeof(string), "~w~-----------------~n~%s~n~~w~-----------------",SBizzInfo[sb][sbMessage]);
                        //TDStr(HouseDraw[i], string);
                        GameTextForPlayer(i, string, 5000, 3);
                        return 1;
                    }
                    else
                    {
                        //TextDrawHideForPlayer(i, HouseDraw[i]);
                    }
                }
                for(new b = 0; b < sizeof(BizzInfo); b++)
                {
                    if(PlayerToPoint(2.0, i, BizzInfo[b][bEntranceX],BizzInfo[b][bEntranceY],BizzInfo[b][bEntranceZ]))
                    {
                        //TextDrawShowForPlayer(i, HouseDraw[i]);
                        if(BizzInfo[b][bOwned] == 0)
                        {
                            format(string, sizeof(string), "~w~%s~n~~r~Precio: ~w~%d$~n~~r~Nivel: ~w~%d",BizzInfo[b][bMessage],BizzInfo[b][bBuyPrice],BizzInfo[b][bLevelNeeded]);
                        }
                        else
                        {
                            format(string, sizeof(string), "~w~%s~n~~r~Propietario:~n~ ~w~%s~n~~r~Entrada: ~w~%d$",BizzInfo[b][bMessage],BizzInfo[b][bOwner],BizzInfo[b][bEntranceCost]);
                        }
                        //TDStr(HouseDraw[i], string);
                        GameTextForPlayer(i, string, 5000, 3);
                        return 1;
                    }
                    else
                    {
                        //TextDrawHideForPlayer(i, HouseDraw[i]);
                    }
                }
            }
            if (PlayerToPoint(3.0, i, 2033.9985,-1401.9303,17.2931))
            {// U7 Ascensor
                if(GetPlayerState(i) == PLAYER_STATE_ONFOOT && Umbrella7(i))
                {
                    GameTextForPlayer(i, "~w~Ascensor: pulsa ~r~intro", 5000, 5);
                }
            }
            else if (PlayerToPoint(2.0, i, 1790.3563,-1591.3485,13.4936))
            {
                GameTextForPlayer(i, "~w~/comprarentrada - ~n~~y~Para entrar al Club VIP", 5000, 1);
            }
            else if (PlayerToPoint(1.0, i, 358.8297,184.5727,1008.3828))
            {
                GameTextForPlayer(i, "~p~/cpasaporte~n~~w~Pasaporte LS-LV", 5000, 1);
            }
            else if (PlayerToPoint(1.0, i, 2333.6797,2417.9956,-77.7784))
            {
                GameTextForPlayer(i, "~p~/cpasaporte~n~~w~Pasaporte LV-LS", 5000, 1);
            }
            else if (PlayerToPoint(3.0, i, 994.3551,-1296.4821,13.5469))
            {
                GameTextForPlayer(i, "~w~oferta de empleo~n~~r~vendedor de moviles~n~~w~utilize ~g~/trabajo", 5000, 3);
            }
            else if (PlayerToPoint(3.0, i, 1684.6674,-1944.6483,13.5469))
            {
                GameTextForPlayer(i, "~w~oferta de empleo~n~~r~conductor de tren~n~~w~utilize ~g~/trabajo", 5000, 3);
            }
            else if (PlayerToPoint(3.0, i, 784.2336,1954.3387,5.7074))
            {
                GameTextForPlayer(i, "~b~Hitman ~w~Deje su mensaje~n~Use: ~y~~n~/hitman (id) (Monto)", 5000, 3);
            }
            else if (PlayerToPoint(3.0, i, 1642.3722,-2238.3552,13.4976))
            {
                GameTextForPlayer(i, "~w~oferta de empleo~n~~r~piloto~n~~w~utilize ~g~/trabajo", 5000, 3);
            }
            else if (PlayerToPoint(3.0, i, 1616.0295,-1897.1339,13.5491))
            {
                GameTextForPlayer(i, "~w~oferta de empleo~n~~r~barrender~n~~w~utilize ~g~/trabajo", 5000, 3);
            }
        }
    }
    return 1;
}
Reply
#4

Lo debйs tener en un include, por eso tira error de que ya estб definido.
Para solucionarlo podes:
- Buscar el include que lo tenga y borrarlo
- Borrarlo de tu GameMode
Reply
#5

Capas lo tenes en un include, generalmente si usas un RP deberбs tener el include 'morphinc.inc' buscalo en pawno/include y si lo tenes pegб el contenido acб.

EDIT: No vн el post de ElBardo xD
Reply
#6

pawn Код:
new pdistance = 1;
forward NameTimer();
Float:GetPointDistanceToPointExMorph(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2)
{
new Float:x, Float:y, Float:z;
x = x1-x2;
y = y1-y2;
z = z1-z2;
return floatsqroot(x*x+y*y+z*z);
}
stock SetPDistance(dista)
{
pdistance = dista;
}
stock GetPDistance()
{
return pdistance;
}
stock EnableDistancedNameTag(delay)
{
SetTimer("NameTimer",delay,1);
}
forward NameTimer();
public NameTimer()
    {
    for(new i = 0;i < MAX_PLAYERS;i++)
    {
    if(IsPlayerConnected(i))
    {
    for(new q = 0;q < MAX_PLAYERS;q++)
    {
    if(IsPlayerConnected(q))
    {
    new Float:p1x;
    new Float:p1y;
    new Float:p1z;
    new Float:p2x;
    new Float:p2y;
    new Float:p2z;
    if(IsPlayerConnected(i) && IsPlayerConnected(q))
    {
    GetPlayerPos(i,p1x,p1y,p1z);
    GetPlayerPos(q,p2x,p2y,p2z);
    if(GetPointDistanceToPointExMorph(p1x,p1y,p1z,p2x,p2y,p2z) < pdistance)
        {
        ShowPlayerNameTagForPlayer(i,q,1);
        }
    else
        {
        ShowPlayerNameTagForPlayer(i,q,0);
        }
    }}}}}
}
Reply
#7

sep, ya lo tenйs definido en el include, borralo tranquilamente de tu gamemode.
Reply
#8

Ahн tenйs ves, borrб el NameTimer de tu GM e intentб a ver que te sale (ya lo tenйs definido en el include).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)