SA-MP Forums Archive
error 047: array sizes do not match, or destination array is too small - 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 047: array sizes do not match, or destination array is too small (/showthread.php?tid=587655)



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

In an enum
PHP код:
owner[MAX_PLAYER_NAME], 
Error code on this line
PHP код:
CarInfo[GetPlayerVehicleID(playerid)][owner] = "None"



Re: error 047: array sizes do not match, or destination array is too small - Jefff - 01.09.2015

pawn Код:
new vID = GetPlayerVehicleID(playerid);
CarInfo[vID][owner][0] = EOS;
strcat(CarInfo[vID][owner], "None", MAX_PLAYER_NAME);



Re: error 047: array sizes do not match, or destination array is too small - nezo2001 - 05.09.2015

PHP код:
CarInfo[vID][owner][0] = EOS
What is EOS?


Re: error 047: array sizes do not match, or destination array is too small - SpikY_ - 05.09.2015

-removed-


Re: error 047: array sizes do not match, or destination array is too small - iggy1 - 05.09.2015

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
PHP код:
CarInfo[vID][owner][0] = EOS
What is EOS?
End Of String AKA '\0'.


Re: error 047: array sizes do not match, or destination array is too small - Freezo - 05.09.2015

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
PHP код:
CarInfo[vID][owner][0] = EOS
What is EOS?
add_constant("EOS", 0, sGLOBAL, 0); /* End Of String, or '\0' */

EOS = End Of String = 0 = '\0'


Re: error 047: array sizes do not match, or destination array is too small - xVIP3Rx - 05.09.2015

Or you can just
pawn Код:
format(CarInfo[GetPlayerVehicleID(playerid)][owner], MAX_PLAYER_NAME, "None");
Edit: Yeah, strcat is 1.6 times faster.. Use strcat.


Re: error 047: array sizes do not match, or destination array is too small - Vince - 05.09.2015

Which is way slower than the strcat version. Perfect if you don't give a crap about performance.