[Ajuda] tag mismatch
#1

Oi gente, estou escrevendo um GM A/D baseado em Los Santos e gangues.
Portanto, fiz um sistema de Skin randфmica, ou seja, assim que o player escolhe sua equipe, a skin dele й selecionada aleatoriamente.
O *ЪNICO* problema й que o cуdigo faz o favor de me dar tag mismatches:
Код:
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(17) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(18) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(19) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(20) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(21) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(24) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(25) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(26) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(27) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(28) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(29) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(30) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(31) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(32) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(94) : warning 213: tag mismatch
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(97) : warning 213: tag mismatch
As linha que dгo tag mismatch :
pawn Код:
new Float:gRandomPoliceSkins[5][1] = {
{280}, //SP LS Police officer
{284}, //Bike officer
{285}, //S.W.A.T Dude
{286}, //FBI Dude
{287}  //Army Dude (Might put these on a different spawn, who knows...)
};
new Float:gRandomGangSkins[9][1] = {
{102}, //Those 3 skins are all Ballas
{103},
{104},
{105}, //Now on, Families
{106},
{107},
{108}, //Vagos...
{109},
{110}
};
A outra parte:
pawn Код:
public OnPlayerSpawn(playerid)
{   //Randomly selecting their skin after they spawn, depending on their team
    if (gTeam[playerid] == POLICE ) {
        new rand = random(sizeof(gRandomPoliceSkins));
(94)        SetPlayerSkin(playerid, gRandomPoliceSkins[rand][0]);
    }else if (gTeam[playerid] == GANGS ) {
        new rand = random(sizeof(gRandomGangSkins));
(97)        SetPlayerSkin(playerid, gRandomGangSkins[rand][0]); }
return 1;
}
Agradeзo desde jб.
Reply
#2

pawn Код:
new Float:gRandomPoliceSkins[][] =
{
    {280}, //SP LS Police officer
    {284}, //Bike officer
    {285}, //S.W.A.T Dude
    {286}, //FBI Dude
    {287}  //Army Dude (Might put these on a different spawn, who knows...)
};
new Float:gRandomGangSkins[][] =
{
    {102}, //Those 3 skins are all Ballas
    {103},
    {104},
    {105}, //Now on, Families
    {106},
    {107},
    {108}, //Vagos...
    {109},
    {110}
};

public OnPlayerSpawn(playerid)
{
    if (gTeam[playerid] == POLICE )
    {
        SetPlayerSkin(playerid, random(sizeof(gRandomPoliceSkins));
    }
    else if (gTeam[playerid] == GANGS )
    {
        SetPlayerSkin(playerid, random(sizeof(gRandomGangSkins));
    }
    return 1;
}
Vк se funciona ^^ se nгo der posta aqui
Reply
#3

Код:
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(96) : error 001: expected token: ",", but found ";"
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(100) : error 001: expected token: ",", but found ";"
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(269) : warning 203: symbol is never used: "gRandomGangSkins"
C:\Users\vhnn\Documents\uberhax\gamemodes\lswar.pwn(269) : warning 203: symbol is never used: "gRandomPoliceSkins"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
96 = SetPlayerSkin(playerid, random(sizeof(gRandomPoliceSkins));
100 = SetPlayerSkin(playerid, random(sizeof(gRandomGangSkins));
Reply
#4

Troque estas linhas:

pawn Код:
SetPlayerSkin(playerid, random(sizeof(gRandomPoliceSkins));
SetPlayerSkin(playerid, random(sizeof(gRandomGangSkins));
Por estas :

pawn Код:
SetPlayerSkin(playerid, random(sizeof(gRandomPoliceSkins)));
SetPlayerSkin(playerid, random(sizeof(gRandomGangSkins)));
Reply
#5

Compilou com dois warnings:
Код:
\lswar.pwn(269) : warning 203: symbol is never used: "gRandomGangSkins"
lswar.pwn(269) : warning 203: symbol is never used: "gRandomPoliceSkins"
E ingame vieram todas as skins menos as que eu pus no float.
Reply
#6

Ai diz que vocк tem duas floats de skins, apague umas das copias e seja feliz....
Reply
#7

Pensa um pouco fio, se eu apagar uma float, uma equipe vai ficar sem skins.
Reply
#8

Quote:
Originally Posted by leandro123456
Посмотреть сообщение
Ai diz que vocк tem duas floats de skins, apague umas das copias e seja feliz....
Nгo necessariamente...
O verdadeiro significado й que aquele cуdigo nгo estб sendo usado. Entгo caso vocк crie uma variбvel qualquer. e deixe ela lб sem utilizar irб resultar no mesmo aviso. Geralmente quando as pessoas pensam que й este o motivo apaga o cуdigo e por pensar que fez a coisa certa e resultou em mais erros voltam para solicitar ajuda..
Reply
#9

Erro meu, eu nгo li direito, achei que era : error 021: symbol already defined
Poste a linha 269
Reply
#10

269 = Fim do Gamemode, linha nula, significa que a variбvel nunca foi usada.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)