Problem with business load system -
andrejc999 - 22.06.2015
Hi everybody! I have a problem with my loading business system! When i enter game and when i go to place of the business it wont show for some reason(3d text label)...
I have no errors just to know
This is the code
Код:
stock LoadBusiness()
{
new str[40];
new sa[128];
for(new id = 0; id < MAX_BUSINESS; id++)
{
format(str, sizeof(str), "Bizovi\%d", id);
if(dini_Exists(str))
{
bInfo[id][bX] = dini_Float(str, "PosX");
bInfo[id][bY] = dini_Float(str, "PosY");
bInfo[id][bZ] = dini_Float(str, "PosZ");
bInfo[id][bOwner] = dini_Int(str, "Vlasnik");
bInfo[id][bPrice] = dini_Int(str, "Cijena");
bInfo[id][bOwned] = dini_Int(str, "Kupljen");
bInfo[id][bName] = dini_Int(str, "Ime");
bInfo[id][bMoney] = dini_Int(str, "Kasa");
format(sa, sizeof(sa), "Ime firme:%s\nVlasnik firme:%s\nCijena:%i\nPare u kasi:%i", bInfo[id][bName], bInfo[id][bOwner], bInfo[id][bPrice], bInfo[id][bMoney]);
Create3DTextLabel(sa, 0x008080FF, bInfo[id][bX], bInfo[id][bY], bInfo[id][bZ], 40.0, 0, 0);
}
return 1;
}
return 1;
}
Can anybody help me?
Re: Problem with business load system -
X337 - 23.06.2015
Try to increase the string size.
Re: Problem with business load system -
andrejc999 - 23.06.2015
Noup still no text label on coords.. Any more ideas? Ty anyway
I have just typed in on
OnGameModeInit()
{
LoadBusiness();
return 1;
}
AW: Problem with business load system -
Mencent - 23.06.2015
Hello!
Try this:
PHP код:
stock LoadBusiness()
{
new str[40];
new sa[128];
for(new id = 0; id < MAX_BUSINESS; id++)
{
format(str, sizeof(str), "Bizovi\%d", id);
if(dini_Exists(str))
{
bInfo[id][bX] = dini_Float(str, "PosX");
bInfo[id][bY] = dini_Float(str, "PosY");
bInfo[id][bZ] = dini_Float(str, "PosZ");
bInfo[id][bOwner] = dini_Int(str, "Vlasnik");
bInfo[id][bPrice] = dini_Int(str, "Cijena");
bInfo[id][bOwned] = dini_Int(str, "Kupljen");
bInfo[id][bName] = dini_Int(str, "Ime");
bInfo[id][bMoney] = dini_Int(str, "Kasa");
format(sa, sizeof(sa), "Ime firme:%s\nVlasnik firme:%s\nCijena:%i\nPare u kasi:%i", bInfo[id][bName], bInfo[id][bOwner], bInfo[id][bPrice], bInfo[id][bMoney]);
Create3DTextLabel(sa, 0x008080FF, bInfo[id][bX], bInfo[id][bY], bInfo[id][bZ], 40.0, 0, 0);
printf("bX: %f - bY: %f - bZ: %f",bInfo[id][bX],bInfo[id][bY],bInfo[id][bZ]);
}
}
return 1;
}
When it doesn't work what is printing in the console for bX,bY and bZ?
- Mencent
Re: Problem with business load system -
andrejc999 - 23.06.2015
It says: nothing xD
Maybe it's about "return 1;" ... Should i put return 1; under your printf?
I've even maked a command
Код:
CMD:loadbusiness(playerid, params[])
{
LoadBusiness();
return 1;
}
AW: Problem with business load system -
Mencent - 23.06.2015
Well, and so?
PHP код:
stock LoadBusiness()
{
new str[40];
new sa[128];
for(new id = 0; id < MAX_BUSINESS; id++)
{
format(str, sizeof(str), "Bizovi\%d", id);
print(str);
if(dini_Exists(str))
{
printf("'str' exists");
bInfo[id][bX] = dini_Float(str, "PosX");
bInfo[id][bY] = dini_Float(str, "PosY");
bInfo[id][bZ] = dini_Float(str, "PosZ");
bInfo[id][bOwner] = dini_Int(str, "Vlasnik");
bInfo[id][bPrice] = dini_Int(str, "Cijena");
bInfo[id][bOwned] = dini_Int(str, "Kupljen");
bInfo[id][bName] = dini_Int(str, "Ime");
bInfo[id][bMoney] = dini_Int(str, "Kasa");
format(sa, sizeof(sa), "Ime firme:%s\nVlasnik firme:%s\nCijena:%i\nPare u kasi:%i", bInfo[id][bName], bInfo[id][bOwner], bInfo[id][bPrice], bInfo[id][bMoney]);
Create3DTextLabel(sa, 0x008080FF, bInfo[id][bX], bInfo[id][bY], bInfo[id][bZ], 40.0, 0, 0);
printf("bX: %f - bY: %f - bZ: %f",bInfo[id][bX],bInfo[id][bY],bInfo[id][bZ]);
}
}
return 1;
}
- Mencent
Re: Problem with business load system -
andrejc999 - 23.06.2015
It doesn't print anything... I think that I should use foreach for this idk...
Re: Problem with business load system -
andrejc999 - 23.06.2015
OH SRY I DIDN'T SAW WHAT U HAVE CHANGED
now it prints
Bizovi1
Bizovi2
.
.
.
Bizovi29
but it doesn't print "exists"
Re: Problem with business load system -
andrejc999 - 23.06.2015
Any other ideas?