The problem is that dini_Get is defined as:
pawn Код:
stock dini_Get(filename[],key[]) {
new tmpres[DINI_MAX_STRING];
new key_length = strlen(key);
if (key_length==0 || key_length+2>DINI_MAX_STRING) return tmpres;
new File:fohnd;
fohnd=fopen(filename,io_read);
if (!fohnd) return tmpres;
while (fread(fohnd,tmpres)) {
if (
tmpres[key_length]=='='
&& !strcmp(tmpres, key, true, key_length)
) {
/* We've got what we need */
DINI_StripNewLine(tmpres);
strmid(tmpres, tmpres, key_length + 1, strlen(tmpres), DINI_MAX_STRING);
fclose(fohnd);
return tmpres;
}
}
fclose(fohnd);
return tmpres;
}
(at least the original one)
So it will read only one line.
I suggest you to do
pawn Код:
new labeltext[80];
format(labeltext, sizeof(labeltext), "Building ID %d#Building Level %d#Type /scavenge to Scavenge",ammunationid,store);
dini_Set(file, "BuildingName", labeltext); // changed \n to #
So your file will be saved like this
Код:
BuildingName=Building ID 0#Building Level 1#Type /scavenge to Scavenge
but then when creating the label we will convert a # to a \n
pawn Код:
new labelname[32];
labelname = dini_Get(file, "BuildingName");
str_replace("#", "\n", labelname);
StoreLabel[dini_Int(file, "BuildingID")] = Create3DTextLabel(labelname, 0x00BC00FF, dini_Float(file, "CPOutX"), dini_Float(file, "CPOutY"), dini_Float(file, "CPOutZ")+0.7, 25, 0, 1);
And define this stock function
(from strlib by westie)
pawn Код:
stock str_replace(sSearch[], sReplace[], const sSubject[], &iCount = 0)
{
new
iLengthTarget = strlen(sSearch),
iLengthReplace = strlen(sReplace),
iLengthSource = strlen(sSubject),
iItterations = (iLengthSource - iLengthTarget) + 1;
new
sTemp[128],
sReturn[_strlib_med_string];
strcat(sReturn, sSubject, _strlib_med_string);
iCount = 0;
for(new iIndex; iIndex < iItterations; ++iIndex)
{
strmid(sTemp, sReturn, iIndex, (iIndex + iLengthTarget), (iLengthTarget + 1));
if(!strcmp(sTemp, sSearch, false))
{
strdel(sReturn, iIndex, (iIndex + iLengthTarget));
strins(sReturn, sReplace, iIndex, iLengthReplace);
iIndex += iLengthTarget;
iCount++;
}
}
return sReturn;
}
I hope I was helpful