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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error 047: array sizes do not match, or destination array is too small (/showthread.php?tid=119176)



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

here is line thats having troubles

pawn Code:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { ctext = vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]; }
Error Name

Code:
 error 047: array sizes do not match, or destination array is too small
Can anybody give meh a quick hand?


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

Have you made

pawn Code:
new ctext[128];
?


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

yep but i made it ctext[256]; i just set it to 128 and still error :\


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

You can't set strings like that, use format for that.
pawn Code:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) format(ctext, sizeof(ctext), vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);