String not complete
#3

pawn Код:
format(Player[playerid][FishSlot1], sizeof(FishName), "%s", FishName[rFish]);

format(Player[playerid][FishSlot2], sizeof(FishName), "%s", FishName[rFish]);
You use as second parameter (length) the number of elements in the 1st dimension so this means you have 6 fishes; thus 6 length. The correct would be:
pawn Код:
sizeof FishName[]
to read the size of the 2nd dimension. This is a good way to use it for the size of FishSlot1 and FishSlot2 as well in case you want to add more fishes with more characters and you won't have to change the size on those two manually every time.

Look for strcpy for copying strings, format is slower.
Reply


Messages In This Thread
String not complete - by DevBe - 05.11.2017, 01:26
Re: String not complete - by StrikerZ - 05.11.2017, 04:55
Re: String not complete - by Konstantinos - 05.11.2017, 08:52

Forum Jump:


Users browsing this thread: 1 Guest(s)