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

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

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

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

-removed-
Reply
#5

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

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'
Reply
#7

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)