SA-MP Forums Archive
Error 048 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Error 048 (/showthread.php?tid=351855)



Error 048 - kujox222 - 17.06.2012

Код:
error 048: array dimensions do not match
error 048: array dimensions do not match
pawn Код:
format(pInfo,sizeof(pInfo)," ~g~ Level Up! ~w~ Your now level: [%d]",pInfo[playerid][pLevel]);
That is the line giving me the errors. Is there anything wrong with it?


Re: Error 048 - Ironboy - 17.06.2012

I think its not pInfo, try this but i'm not sure.

pawn Код:
format(string,sizeof(string)," ~g~ Level Up! ~w~ Your now level: [%d]",pInfo[playerid][pLevel]);



Re: Error 048 - kujox222 - 17.06.2012

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
I think its not pInfo, try this but i'm not sure.

pawn Код:
format(string,sizeof(string)," ~g~ Level Up! ~w~ Your now level: [%d]",pInfo[playerid][pLevel]);
When I added new string[128] I got this, without it I still got a few errors to so.

Код:
error 048: array dimensions do not match



Re: Error 048 - Ironboy - 17.06.2012

Quote:
Originally Posted by kujox222
Посмотреть сообщение
When I added new string[128] I got this, without it I still got a few errors to so.

Код:
error 048: array dimensions do not match
Try new string[256];


Re: Error 048 - milanosie - 17.06.2012

pawn Код:
format(pInfo,sizeof(pInfo)," ~g~ Level Up! ~w~ Your now level: [%d]",pInfo[playerid][pLevel]);
Do you even see what you are doing?

You are defining A as "You are now level a" while A is obviously an integer, and therefor can not be formatted like this,


Re: Error 048 - kujox222 - 17.06.2012

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
Try new string[256];
Код:
: error 048: array dimensions do not match
Gave me that error again.


Re: Error 048 - milanosie - 17.06.2012

Quote:
Originally Posted by kujox222
Посмотреть сообщение
Код:
: error 048: array dimensions do not match
Gave me that error again.
Ow ffs,

pawn Код:
new string[128];
format(string,sizeof(string)," Level Up! Your now level: [%d]",pInfo[playerid][pLevel]);
SendClientMessage(playerid, -1, string);



Re: Error 048 - milanosie - 17.06.2012

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
Try new string[256];
This makes NO sense, as the size of a string is the maximum size to be used, and will never return a syntax error.
The worst it can do is not formatting the entire string because of the text being too long, but that is not what is happening.


Dimensions do not match can be explain as you trying to walk into the depth while playing a 2D game, which is not possible.


Re: Error 048 - Ironboy - 17.06.2012

Quote:
Originally Posted by milanosie
Посмотреть сообщение
This makes NO sense, as the size of a string is the maximum size to be used, and will never return a syntax error.
The worst it can do is not formatting the entire string because of the text being too long, but that is not what is happening.


Dimensions do not match can be explain as you trying to walk into the depth while playing a 2D game, which is not possible.
I told him the correct format but he didn't use his sense! :/