error 047: array sizes do not match, or destination array is too small


Započeo uinatsvima_, Novembar 30, 2017, 11:09:00 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

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
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 od #sPoIntUs ツ


Citat: Farkias poslato Novembar 30, 2017, 11:20:35 PRE PODNE
De mi samo postavi i tu komandu /amotor
@Farkias  evo /amotor
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)
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 od #sPoIntUs ツ

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 od Bolex_
Former Developer | COD: Lords Of War - Modern Warfare 3 | Stunt Planet | Global Warfare |

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 :)