Help with 3DTEXTLABEL -
Chrillzen - 10.04.2013
My code; OnGameModeInit.
pawn Код:
new biztext[128];
for(new idx = 1; idx < sizeof(BusinessInfo); idx++)//Creates a loop, that goes through all of the businesses.
{
format(MessageString, sizeof(MessageString), BPATH, idx);//formats the file path, with the biz ID
INI_ParseFile(MessageString, "loadbiz_%s", .bExtra = true, .extra = idx );//This is very hard to explain, but it basically loads the info from the file(More in ****** y_ini tutorial.)
BusinessInfo[idx][bOutsideIcon] = CreateDynamicPickup(1272, 1, BusinessInfo[idx][bEntranceX], BusinessInfo[idx][bEntranceY], BusinessInfo[idx][bEntranceZ], BusinessInfo[idx][bWorld]); //Creates a pickup at the business entrance.
switch(BusinessInfo[idx][bType])
{
case 1: biztext = "Bar";
case 2: biztext = "Restaurant";
case 3: biztext = "Phone Company";
case 4: biztext = "24/7";
}
if(BusinessInfo[idx][On_Sell] == 1)
{
format(MessageString,sizeof(MessageString),""COLORGREEN"Owner: "COL_WHITE"None\n"COLORGREEN"Price: "COL_WHITE"%d\n"COLORGREEN"Business type: "COL_WHITE"%s", BusinessInfo[idx][bPrice], biztext);
BusinessInfo[idx][DLabel] = CreateDynamic3DTextLabel(MessageString, 0xFFFFFF, BusinessInfo[idx][bEntranceX],BusinessInfo[idx][bEntranceY],BusinessInfo[idx][bEntranceZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10);
}
else if(BusinessInfo[idx][On_Sell] == 0)
{
format(MessageString,sizeof(MessageString),""COLORGREEN"Owner: "COL_WHITE"%s\n"COLORGREEN"Price: "COL_WHITE"%d\n"COLORGREEN"Business type: "COL_WHITE"%s",BusinessInfo[idx][bOwner], BusinessInfo[idx][bName], biztext);
BusinessInfo[idx][DLabel] = CreateDynamic3DTextLabel(MessageString, 0xFFFFFF, BusinessInfo[idx][bEntranceX],BusinessInfo[idx][bEntranceY],BusinessInfo[idx][bEntranceZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10);
}
}
return 1;
}
How it looks in-game:
How it should look like:
Re: Help with 3DTEXTLABEL -
zT KiNgKoNg - 10.04.2013
This should work for you.
pawn Код:
for(new idx = 1; idx < sizeof(BusinessInfo); idx++)//Creates a loop, that goes through all of the businesses.
{
format(MessageString, sizeof(MessageString), BPATH, idx);//formats the file path, with the biz ID
INI_ParseFile(MessageString, "loadbiz_%s", .bExtra = true, .extra = idx );//This is very hard to explain, but it basically loads the info from the file(More in ****** y_ini tutorial.)
BusinessInfo[idx][bOutsideIcon] = CreateDynamicPickup(1272, 1, BusinessInfo[idx][bEntranceX], BusinessInfo[idx][bEntranceY], BusinessInfo[idx][bEntranceZ], BusinessInfo[idx][bWorld]); //Creates a pickup at the business entrance.
switch(BusinessInfo[idx][bType])
{
case 1: biztext = "Bar";
case 2: biztext = "Restaurant";
case 3: biztext = "Phone Company";
case 4: biztext = "24/7";
}
if(BusinessInfo[idx][On_Sell] == 1)
{
format(MessageString,sizeof(MessageString),"{COLORGREEN}Owner: {COL_WHITE}None\n{COLORGREEN}Price:{COL_WHITE}%d\n{COLORGREEN}Business type: {COL_WHITE}%s", BusinessInfo[idx][bPrice], biztext);
BusinessInfo[idx][DLabel] = CreateDynamic3DTextLabel(MessageString, 0xFFFFFF, BusinessInfo[idx][bEntranceX],BusinessInfo[idx][bEntranceY],BusinessInfo[idx][bEntranceZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10);
}
else if(BusinessInfo[idx][On_Sell] == 0)
{
format(MessageString,sizeof(MessageString),"{COLORGREEN}Owner: {COL_WHITE}%s\n{COLORGREEN}Price: {COL_WHITE}%d\n{COLORGREEN}Business type: {COL_WHITE}%s",BusinessInfo[idx][bOwner], BusinessInfo[idx][bName], biztext);
BusinessInfo[idx][DLabel] = CreateDynamic3DTextLabel(MessageString, 0xFFFFFF, BusinessInfo[idx][bEntranceX],BusinessInfo[idx][bEntranceY],BusinessInfo[idx][bEntranceZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10);
}
}
Re: Help with 3DTEXTLABEL -
Chrillzen - 10.04.2013
Embedding the colors does not do anything, same stuff.
Re: Help with 3DTEXTLABEL -
zT KiNgKoNg - 10.04.2013
Have you tried doing it?
Re: Help with 3DTEXTLABEL -
Chrillzen - 11.04.2013
Yes... I tried your code.
Re: Help with 3DTEXTLABEL -
SomebodyAndMe - 11.04.2013
Check the second format
pawn Код:
new biztext[128];
for(new idx = 1; idx < sizeof(BusinessInfo); idx++)//Creates a loop, that goes through all of the businesses.
{
format(MessageString, sizeof(MessageString), BPATH, idx);//formats the file path, with the biz ID
INI_ParseFile(MessageString, "loadbiz_%s", .bExtra = true, .extra = idx );//This is very hard to explain, but it basically loads the info from the file(More in ****** y_ini tutorial.)
BusinessInfo[idx][bOutsideIcon] = CreateDynamicPickup(1272, 1, BusinessInfo[idx][bEntranceX], BusinessInfo[idx][bEntranceY], BusinessInfo[idx][bEntranceZ], BusinessInfo[idx][bWorld]); //Creates a pickup at the business entrance.
switch(BusinessInfo[idx][bType])
{
case 1: biztext = "Bar";
case 2: biztext = "Restaurant";
case 3: biztext = "Phone Company";
case 4: biztext = "24/7";
}
if(BusinessInfo[idx][On_Sell] == 1)
{
format(MessageString,sizeof(MessageString),""COLORGREEN"Owner: "COL_WHITE"None\n"COLORGREEN"Price: "COL_WHITE"%d\n"COLORGREEN"Business type: "COL_WHITE"%s", BusinessInfo[idx][bPrice], biztext);
BusinessInfo[idx][DLabel] = CreateDynamic3DTextLabel(MessageString, 0xFFFFFF, BusinessInfo[idx][bEntranceX],BusinessInfo[idx][bEntranceY],BusinessInfo[idx][bEntranceZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10);
}
else if(BusinessInfo[idx][On_Sell] == 0)
{
format(MessageString,sizeof(MessageString),""COLORGREEN"Owner: "COL_WHITE"%s\n"COLORGREEN"Price: "COL_WHITE"%d\n"COLORGREEN"Business type: "COL_WHITE"%s",BusinessInfo[idx][bOwner], BusinessInfo[idx][bPrice], biztext);
BusinessInfo[idx][DLabel] = CreateDynamic3DTextLabel(MessageString, 0xFFFFFF, BusinessInfo[idx][bEntranceX],BusinessInfo[idx][bEntranceY],BusinessInfo[idx][bEntranceZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10);
}
}
return 1;
}
I think that should fix it, if not check the variables at the end of the format.
Re: Help with 3DTEXTLABEL -
MP2 - 11.04.2013
Nice indentation.
Re: Help with 3DTEXTLABEL -
Chrillzen - 13.04.2013
Quote:
Originally Posted by MP2
Nice indentation.
|
This is the section where you're supposed to help, not be an asshole.