[Ajuda] warnings
#1

como resolver essas warnings?
pawn Код:
C:\Users\Joselene\Desktop\sv\pawno\include\DOF2.inc(1283) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Joselene\Desktop\sv\pawno\include\DOF2.inc(1314) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Joselene\Desktop\sv\pawno\include\DOF2.inc(1337) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Joselene\Desktop\cokwindows\gamemodes\cok.pwn(3134) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Warnings.
Codigo Warning
pawn Код:
CMD:pmc(playerid, params[])
{
    if(policial[playerid]==1) {
        if(!cmd[3])return SendClientMessage(playerid, 0xFF0000FF, "[SERVER] USO: /chat [texto]");
        format(string, sizeof(string), "[Policiais] %s: {FFFFFF}%s", pnome(playerid), cmd[5]);
        for(new i=0;i<MAX_PLAYERS;i++)
            if(policial[i]==1)SendClientMessage(i,0x1E90FFFF,string);
        return 1;
    }
    return SendClientMessage(playerid, cinza, "[SERVER] Vocк nгo й policial!");
}
Codigo Warning
pawn Код:
CMD:commands2(playerid, params[])
{
    if(langague[playerid]==BR){return cmd_comandos2(playerid, "");}
    new strdialog[2024];
    format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{FF0000}/rules{FFFFFF} => See the server rules.\n");
    format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{FF0000}/credits{FFFFFF} => See the server credits.\n");
    format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{FF0000}/v{FFFFFF} => Create a vehicle.\n");
    format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{FF0000}/motorcycle{FFFFFF} => Create a Motorcycle.\n");
    format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{FF0000}/avenue{FFFFFF} => Go to pricipal Avenue of Las Venturas.\n");
    format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{FF0000}/afks{FFFFFF} => See away players.\n");
    format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{FF0000}! [text]{FFFFFF} => Gang Chat.\n");
    return ShowPlayerDialog(playerid, DialogBoxEx, DIALOG_STYLE_MSGBOX, "===== {1E90FF}More Server Commands{FFFFFF} =====", strdialog, "OK", "");
}
Codigo Warning
pawn Код:
CMD:motorcycle(playerid, params[])
{
    if(langague[playerid]==BR){return cmd_moto(playerid, "");}
    if(TaX1[playerid] == true){ return SendClientMessage(playerid, cinza, "[SERVER] You can not use this command here!");}
    if(TaMG[playerid] == true){ return SendClientMessage(playerid, cinza, "[SERVER] You can not use this command here!");}
    if(TaSN[playerid] == true){ return SendClientMessage(playerid, cinza, "[SERVER] You can not use this command here!");}
    if(TaRPG[playerid] == true){ return SendClientMessage(playerid, cinza, "[SERVER] You can not use this command here!");}
    if(Ta69[playerid] == true){ return SendClientMessage(playerid, cinza, "[SERVER] You can not use this command here!");}
    if(Prisao[playerid] == 1){ return SendClientMessage(playerid, cinza, "[SERVER] You can not use this command here!");}
    if(IsPlayerInAnyVehicle(playerid)) {
        return SendClientMessage(playerid, 0x33AA33AA, "[SERVER] You already have a vehicle.");
    }
Codigo Warning
pawn Код:
public SendPlayerFormattedText(playerid, const str[], define)
{
    new tmpbuf[256];
    format(tmpbuf, sizeof(tmpbuf), str, define);
    SendClientMessage(playerid, 0xFF004040, tmpbuf);
}
Reply
#2

Coloque isso No Topo Do Seu GameMode

pawn Код:
new string[258];
Reply
#3

agora apareceu um erro

pawn Код:
C:\Users\Joselene\Desktop\sv\pawno\include\DOF2.inc(1283) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Joselene\Desktop\sv\pawno\include\DOF2.inc(1314) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Joselene\Desktop\sv\pawno\include\DOF2.inc(1337) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Joselene\Desktop\cokwindows\gamemodes\cok.pwn(167) : error 021: symbol already defined: "string"
C:\Users\Joselene\Desktop\cokwindows\gamemodes\cok.pwn(3135) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

Provavel que ja tenha uma variavel com o mesmo nome declarada vбrias vezes.
Reply
#5

Quote:
Originally Posted by BreakDriFT
Посмотреть сообщение
Provavel que ja tenha uma variavel com o mesmo nome declarada vбrias vezes.
como resolver?
Reply
#6

Deixando somente um.

Se usa ela como local em varios lugares e tiver uma no topo do gamemode apague-a.
Reply
#7

Coloca aquilo que o murilo passou no topo, e apaga todas news string abaixo do gm, todas, e so deixa a do topo..
Reply
#8

Nгo precisa. Tire todos os New String do GM, nгo deixe NENHUM new string pois voce estб usando uma include que jб tem o new Include, se vocкs nгo perceberam.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)