PARTNERI:
-UPOZORENJE-

Samo registrovani članovi mogu da vide/koriste forum u celini.
Prijavite se ili registrujte nalog na Balkan SA-MP forumu.


Autor Tema: [Pomoc] error 047: array sizes do not match, or destination array is too small  (Pročitano 492 puta)

0 članova i 1 gost pregledaju ovu temu.

Van mreže ĖlďiŅ彡『H7』

error 047: array sizes do not match, or destination array is too small
« poslato: Novembar 30, 2017, 11:09:00 pre podne »
Skripta koju koristim: Perfect Gaming by Terzic
Detaljan opis problema: Napravio sam komandu /avozilo ali mi baca error na obe linije ovaj error sto je u naslovu
Dio skripte:Avozilo
Neke slike/video za lakse dobivanje pomoci(neobavezno): 1 Linija
https://imgur.com/a/hUzuo
2 Linija gde baca error
https://imgur.com/a/uXW09
EDIT: Evo error
Pawno Code: [Izaberi]
D:\Download\samp037_svr_R2-1-1_win32\gamemodes\PGRPG.pwn(29017) : error 047: array sizes do not match, or destination array is too small
D:\Download\samp037_svr_R2-1-1_win32\gamemodes\PGRPG.pwn(29021) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
« Poslednja izmena: Novembar 30, 2017, 11:13:15 pre podne #sPoIntUs ツ »
 

Van mreže Farkias

Odg: error 047: array sizes do not match, or destination array is too small
« Odgovor #1 poslato: Novembar 30, 2017, 11:20:35 pre podne »
De mi samo postavi i tu komandu /amotor
 

Van mreže ĖlďiŅ彡『H7』

Odg: error 047: array sizes do not match, or destination array is too small
« Odgovor #2 poslato: Novembar 30, 2017, 17:43:41 posle podne »
De mi samo postavi i tu komandu /amotor
@Farkias  evo /amotor
Pawno Code: [Izaberi]
YCMD:amotor(playerid, params[],help)
{
    #pragma unused help
    if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,"PG:RP| "CRVENA"Moras se ulogovati da bi koristio ovu komandu!");
new Float:Pos[4];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
if(PlayerInfo[playerid][pGM] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
{
    if(AdminDuty[playerid] == 0 && GMDuty[playerid] == 0) return SCM(playerid,-1,""CRVENA"[PG:RP] "SIVA"Morate biti na Admin & GameMaster duznosti!");
if(AdminVozilo[playerid] == -1)
{
vozilo1 = CreateVehicle(522,Pos[0],Pos[1],Pos[2],Pos[3],random(1),random(1),500);
PutPlayerInVehicle(playerid,vozilo1,0);
AdminVozilo[playerid] = vozilo1;
SCM(playerid,-1,"INFO | "ZUTA"Stvorili ste Admin & GM Motor.");
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, lights, alarm, doors, bonnet, boot, objective);
}
else if(AdminVozilo[playerid] != -1)
{
DestroyVehicle(AdminVozilo[playerid]);
AdminVozilo[playerid] = -1;
SCM(playerid,-1,"INFO | "ZUTA"Unistili ste Admin & GM Motor.");
}
}
else return SCM(playerid,-1,""ZUTA"[PG:RP] "SIVA"Samo Admini & GameMasteri.");
return 1;
}
A evo druga(/avozilo gde mi baca error)
Pawno Code: [Izaberi]
YCMD:avozilo(playerid, params[],help)
{
    #pragma unused help
    if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,"PG:RP| "CRVENA"Moras se ulogovati da bi koristio ovu komandu!");
new Float:Pos[4];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
if(PlayerInfo[playerid][pGM] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
{
    if(AdminDuty[playerid] == 0 && GMDuty[playerid] == 0) return SCM(playerid,-1,""CRVENA"[PG:RP] "SIVA"Morate biti na Admin & GameMaster duznosti!");
if(AdminVozilo[playerid] == -1)
{
vozilo2 = CreateVehicle(560,Pos[0],Pos[1],Pos[2],Pos[3],random(1),random(1),500);
PutPlayerInVehicle(playerid,vozilo2,0);
AdminVozilo[playerid] = vozilo2;
SCM(playerid,-1,"INFO | "ZUTA"Stvorili ste Admin & GM Vozilo.");
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, lights, alarm, doors, bonnet, boot, objective);
}
else if(AdminVozilo[playerid] != -1)
{
DestroyVehicle(AdminVozilo[playerid]);
AdminVozilo[playerid] = -1;
SCM(playerid,-1,"INFO | "ZUTA"Unistili ste Admin & GM Motor.");
}
    }
else return SCM(playerid,-1,""ZUTA"[PG:RP] "SIVA"Samo Admini & GameMasteri.");
return 1;
}
« Poslednja izmena: Novembar 30, 2017, 17:46:52 posle podne #sPoIntUs ツ »
 

Van mreže Bolex_

Odg: error 047: array sizes do not match, or destination array is too small
« Odgovor #3 poslato: Novembar 30, 2017, 17:50:21 posle podne »
Ove dvije komande nemaju veze se brojem linija koje su prikazane, ili možza griješim ?

Ali ovo je primjer kako da riješiš problem:

Citat
Error 047 - array sizes do not match, or destination array is too small:

For array assignment, the arrays on the left and the right side of the assignment operator must have the same number of dimensions.
In addition:
for multi-dimensional arrays, both arrays must have the same size;
for single arrays with a single dimension, the array on the left side of the assignment operator must have a size that is equal or bigger than the one on the right side.
When passing arrays to a function argument, these rules also hold for the array that is passed to the function (in the function call) versus the array declared in the function definition. When a function returns an array, all return statements must specify an array with the same size and dimensions.
« Poslednja izmena: Novembar 30, 2017, 17:52:20 posle podne Bolex_ »
Former Developer | COD: Lords Of War - Modern Warfare 3 | Stunt Planet | Global Warfare |
 

Van mreže ĖlďiŅ彡『H7』

Odg: error 047: array sizes do not match, or destination array is too small
« Odgovor #4 poslato: Novembar 30, 2017, 17:58:05 posle podne »
Ove dvije komande nemaju veze se brojem linija koje su prikazane, ili možza griješim ?

Ali ovo je primjer kako da riješiš problem:

Citat
Error 047 - array sizes do not match, or destination array is too small:

For array assignment, the arrays on the left and the right side of the assignment operator must have the same number of dimensions.
In addition:
for multi-dimensional arrays, both arrays must have the same size;
for single arrays with a single dimension, the array on the left side of the assignment operator must have a size that is equal or bigger than the one on the right side.
When passing arrays to a function argument, these rules also hold for the array that is passed to the function (in the function call) versus the array declared in the function definition. When a function returns an array, all return statements must specify an array with the same size and dimensions.
Hvala @Bolex_ resio sam uz pomocu ovog citata :)