Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: uinatsvima_ poslato Novembar 30, 2017, 11:09:00 PRE PODNE

Naslov: error 047: array sizes do not match, or destination array is too small
Poruka od: uinatsvima_ 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
[pawn]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.
[/pawn]
Naslov: Odg: error 047: array sizes do not match, or destination array is too small
Poruka od: Farkias poslato Novembar 30, 2017, 11:20:35 PRE PODNE
De mi samo postavi i tu komandu /amotor
Naslov: Odg: error 047: array sizes do not match, or destination array is too small
Poruka od: uinatsvima_ poslato Novembar 30, 2017, 17:43:41 POSLE PODNE
Citat: Farkias poslato Novembar 30, 2017, 11:20:35 PRE PODNE
De mi samo postavi i tu komandu /amotor
@Farkias  evo /amotor
[pawn]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;
}[/pawn]
A evo druga(/avozilo gde mi baca error)
[pawn]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;
}[/pawn]
Naslov: Odg: error 047: array sizes do not match, or destination array is too small
Poruka od: Bolex_ 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.
Naslov: Odg: error 047: array sizes do not match, or destination array is too small
Poruka od: uinatsvima_ poslato Novembar 30, 2017, 17:58:05 POSLE PODNE
Citat: Bolex_ 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.
Hvala @Bolex_ resio sam uz pomocu ovog citata :)