An issue in a format.
#1

Well, i've been formatting several textdraws, but there is a problem im literally stuck in, and i don't think i can fix it alone.

Here are the formatting lines.

Код:
format(pInv[playerid][InvTitle],sizeof(pInv[playerid][InvTitle]),"Inventory [~g~%i~w~/20]",pInv[playerid][UsedSlots]);
format(pInv[playerid][InvSlot1],sizeof(pInv[playerid][InvSlot1]),"1.%s",pInv[playerid][Slot1]);
format(pInv[playerid][InvSlot2],sizeof(pInv[playerid][InvSlot2]),"2.%s",pInv[playerid][Slot2]);
format(pInv[playerid][InvSlot3],sizeof(pInv[playerid][InvSlot3]),"3.%s",pInv[playerid][Slot3]);
format(pInv[playerid][InvSlot4],sizeof(pInv[playerid][InvSlot4]),"4.%s",pInv[playerid][Slot4]);
format(pInv[playerid][InvSlot5],sizeof(pInv[playerid][InvSlot5]),"5.%s",pInv[playerid][Slot5]);
format(pInv[playerid][InvSlot6],sizeof(pInv[playerid][InvSlot6]),"6.%s",pInv[playerid][Slot6]);
format(pInv[playerid][InvSlot7],sizeof(pInv[playerid][InvSlot7]),"7.%s",pInv[playerid][Slot7]);
format(pInv[playerid][InvSlot8],sizeof(pInv[playerid][InvSlot8]),"8.%s",pInv[playerid][Slot8]);
format(pInv[playerid][InvSlot9],sizeof(pInv[playerid][InvSlot9]),"9.%s",pInv[playerid][Slot9]);
format(pInv[playerid][InvSlot10],sizeof(pInv[playerid][InvSlot10]),"10.%s",pInv[playerid][Slot10]);
format(pInv[playerid][InvSlot11],sizeof(pInv[playerid][InvSlot11]),"11.%s",pInv[playerid][Slot11]);
format(pInv[playerid][InvSlot12],sizeof(pInv[playerid][InvSlot12]),"12.%s",pInv[playerid][Slot12]);
format(pInv[playerid][InvSlot13],sizeof(pInv[playerid][InvSlot13]),"13.%s",pInv[playerid][Slot13]);
format(pInv[playerid][InvSlot14],sizeof(pInv[playerid][InvSlot14]),"14.%s",pInv[playerid][Slot14]);
format(pInv[playerid][InvSlot15],sizeof(pInv[playerid][InvSlot15]),"15.%s",pInv[playerid][Slot15]);
format(pInv[playerid][InvSlot16],sizeof(pInv[playerid][InvSlot16]),"16.%s",pInv[playerid][Slot16]);
format(pInv[playerid][InvSlot17],sizeof(pInv[playerid][InvSlot17]),"17.%s",pInv[playerid][Slot17]);
format(pInv[playerid][InvSlot18],sizeof(pInv[playerid][InvSlot18]),"18.%s",pInv[playerid][Slot18]);	
format(pInv[playerid][InvSlot19],sizeof(pInv[playerid][InvSlot19]),"19.%s",pInv[playerid][Slot19]);	
format(pInv[playerid][InvSlot20],sizeof(pInv[playerid][InvSlot20]),"20.%s",pInv[playerid][Slot20]);
Here are the errors.

Код:
C:\Users\Mohamed\Desktop\World of Azeroth Roleplay\gamemodes\WoARP.pwn(424) : error 001: expected token: "]", but found "-identifier-"
C:\Users\Mohamed\Desktop\World of Azeroth Roleplay\gamemodes\WoARP.pwn(424) : warning 215: expression has no effect
C:\Users\Mohamed\Desktop\World of Azeroth Roleplay\gamemodes\WoARP.pwn(424) : error 001: expected token: ";", but found "]"
C:\Users\Mohamed\Desktop\World of Azeroth Roleplay\gamemodes\WoARP.pwn(424) : error 029: invalid expression, assumed zero
C:\Users\Mohamed\Desktop\World of Azeroth Roleplay\gamemodes\WoARP.pwn(424) : fatal error 107: too many error messages on one line
Those errors only occur when i add the function CreatePlayerInvTexts which includes all the formatting, and the textdraws.

However, thanks.
Reply
#2

Explain more and which line occurs the errors, is that an include?
Reply
#3

Quote:
Originally Posted by Shinja
Посмотреть сообщение
Explain more and which line occurs the errors, is that an include?
First of all i guess i explained enough, and you have the lines which occur the errors, Line 424, but when i tested i figured out that it's not only 424, it's all the formatting lines. And not rlly, it's not an include.

Tell me if im not specific enough. >.> Or if you need a specific part to see.
Reply
#4

which line exactly is 424?
Reply
#5

Quote:
Originally Posted by TakeiT
Посмотреть сообщение
which line exactly is 424?
Oh, my bad. line 424 is the first format.

But as i mentioned, i figured out it's not only the first format occurring the errors, it's all formats.
Reply
#6

Replace all sizeof(pInv[playerid][InvSlot(x)]) and sizeof(pInv[playerid][InvTitle]) to the string size manually, and are you sure pInv[playerid][InvTitle] and pInv[playerid][InvSlot(x)] are strings?
Reply
#7

Quote:
Originally Posted by Shinja
Посмотреть сообщение
Replace all sizeof(pInv[playerid][InvSlot(x)]) and sizeof(pInv[playerid][InvTitle]) to the string size manually, and are you sure pInv[playerid][InvTitle] and pInv[playerid][InvSlot(x)] are strings?
Well, Yes. Im sure they are strings. However, your exact solution worked for me and fixed it all. Thank you.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)