[Ajuda] 1 Erro (initialization data exceeds declared size)
#1

Erro :
pawn Код:
C:\Users\Leandro\Desktop\TUT.pwn(8) : error 018: initialization data exceeds declared size
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Comando completo :

pawn Код:
new Float:GalsTeleport[3][3] =
{
{1911.9089,-2296.0752,13.5469,263.6957}, // erro
{1908.9016,-2327.6499,13.5469,263.6957},
{1909.1213,-2350.7175,13.5469,263.6957}
};

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/tele", cmdtext, true, 10) == 0)
{
new rand = random(sizeof(GalsTeleport));
SetPlayerPos(playerid,GalsTeleport[rand][0],GalsTeleport[rand][1],GalsTeleport[rand][2]);
}
return 1;
}
Reply
#2

pawn Код:
new Float:GalsTeleport[][3] =
{
{1911.9089,-2296.0752,13.5469}, // erro ===== Vocк tem 4 valores declarando [3]
{1908.9016,-2327.6499,13.5469},
{1909.1213,-2350.7175,13.5469}
};

//pronto deve resolver :D
Reply
#3

essa linha
pawn Код:
new Float:GalsTeleport[3][3] =
deixe assim so teste
pawn Код:
new Float:GalsTeleport[][3] =

##EDIT nao vi que o cara respondeu antes!
Reply
#4

Vlw !
Reply
#5

disponha sу para lembrar....

pawn Код:
error 018: initialization data exceeds declared size
Ocorre quando vocк estб declarando um tamanho para a sua condiзгo e ela excede esse tamanho ou fica menor que ele ex:

pawn Код:
new Float:GalsTeleport[][3] =

{1911.9089,-2296.0752,13.5469,263.6957}
   1         2           3         4

//que й = ah error 018: initialization data exceeds declared size

//removendo o ъltimo valor:

{1911.9089,-2296.0752,13.5469}

// O erro irб sumir agora observe....

{1911.9089,-2296.0752,13.5469,263.6957}
   X            Y          Z        RX

//para setar a posiзгo й necessбrio X Y Z pois no SetPlayerPos utiliza-se:

SetPlayerPos(playerid, X, Y, Z);
espero que seja ъtil
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)