SA-MP Forums Archive
[Ajuda] Erros em variбveis - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Erros em variбveis (/showthread.php?tid=576320)



Erros em variбveis - CZ - 02.06.2015

Alguem pode me ajudar com esse erro?


C:\Users\Carlos\Desktop\Server\gamemodes\GM.pwn(16 73) : error 001: expected token: ";", but found "new"
C:\Users\Carlos\Desktop\Server\gamemodes\GM.pwn(16 74) : warning 219: local variable "Nome" shadows a variable at a preceding level
C:\Users\Carlos\Desktop\Server\gamemodes\GM.pwn(16 87) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Linha:

new string[50+MAX_PLAYER_NAME];
new Nome[40][MAX_PLAYERS];
new Nomi[40][MAX_PLAYERS];


Re: Ajuda - ZeZin - 02.06.2015

pawn Code:
new string[50][MAX_PLAYER_NAME];



Re: Ajuda - CZ - 02.06.2015

pawn Code:
C:\Users\Carlos\Desktop\Server\gamemodes\GM.pwn(102) : error 020: invalid symbol name ""
C:\Users\Carlos\Desktop\Server\gamemodes\GM.pwn(1674) : error 001: expected token: ";", but found "new"
C:\Users\Carlos\Desktop\Server\gamemodes\GM.pwn(1675) : warning 219: local variable "Nome" shadows a variable at a preceding level
C:\Users\Carlos\Desktop\Server\gamemodes\GM.pwn(1688) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Carlos\Desktop\Server\gamemodes\GM.pwn(2944) : warning 203: symbol is never used: ""
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.



Re: Ajuda - CZ - 02.06.2015

pawn Code:
new string[50+MAX_PLAYER_NAME];
    new Nome[40][MAX_PLAYERS];
    new Nomi[40][MAX_PLAYERS];

    TaNoX1[playerid] = false;
    TaNoX1[killerid] = false;

    GetPlayerName(killerid, Nomi[killerid], 40);
    GetPlayerName(playerid, Nome[playerid], 40);

    format(string, sizeof(string),"[GSF-[X1]] %s Derrotou no x1 Contra %s.",Nomi[killerid], Nome[killerid]);
    SendClientMessageToAll(Branco, string);
    Quantos = 0;
}
alguem me ajuda?


Re: Ajuda - ipsLuan - 02.06.2015

Tenta assim...
PHP Code:
new NickPlayer[2];

TaNoX1[playerid] = false;
TaNoX1[killerid] = false;

GetPlayerName(killeridNickPlayer[0], 40);
GetPlayerName(playeridNickPlayer[1], 40);

format(stringsizeof(string),"[GSF-[X1]] %s Derrotou no x1 Contra %s."NickPlayer[0], NickPlayer[1]);
SendClientMessageToAll(Brancostring);
Quantos 0



Re: Ajuda - CZ - 02.06.2015

agora deu esse erro
pawn Code:
C:\Users\Carlos\Desktop\Server\gamemodes\GM.pwn(1849) : error 001: expected token: ";", but found "new"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.



Re: Ajuda - ipsLuan - 02.06.2015

Manda a linha 1849.


Re: Ajuda - CZ - 02.06.2015

pawn Code:
new NickPlayer[2];



Re: Ajuda - ipsLuan - 02.06.2015

Manda linhas antes...


Re: Ajuda - CZ - 02.06.2015

pawn Code:
if(TaNoX1[playerid] == true)
{
    OnPlayerSpawn(playerid);
    OnPlayerSpawn(killerid)


//new pName[MAX_PLAYER_NAME];
//    new string[50+MAX_PLAYER_NAME];

new NickPlayer[2];

TaNoX1[playerid] = false;
TaNoX1[killerid] = false;

GetPlayerName(killerid, NickPlayer[0], 40);
GetPlayerName(playerid, NickPlayer[1], 40);

format(string, sizeof(string),"[GSF-[X1]] %s Derrotou no x1 Contra %s.", NickPlayer[0], NickPlayer[1]);
SendClientMessageToAll(Branco, string);
Quantos = 0;
}
       
        return 1;
}