29.09.2012, 01:00
These 2 functions when Ever I seem to call them they crash my server for some reason. Giving me a real headache here. Coming to SA-MP forums for help, Been trying to figure this out. Will give +rep to people who come up with a soluation. Much appreciated!
Код:
UpdatePropertyText3d(); OnPropUpdate();
pawn Код:
forward UpdatePropertyText3d(propertyid);
public UpdatePropertyText3d(propertyid)
{
new string[128];
DestroyDynamic3DTextLabel(Property3d[propertyid]);
if(DIntInfo[propertyid][doorOwned] == 0)
{
format(string,sizeof(string), "Business For Sale\nPrice: $%d", DIntInfo[propertyid][doorBuyPrice]);
Property3d[propertyid] = CreateDynamic3DTextLabel(string,COLOR_LIGHTBLUE, DIntInfo[propertyid][doorEntranceX], DIntInfo[propertyid][doorEntranceY], DIntInfo[propertyid][doorEntranceZ]+1.0, 50.0);
}
if(DIntInfo[propertyid][doorOwned] == 1)
{
if(DIntInfo[propertyid][doorLocked] == 1)
{
format(string,sizeof(string), "%s\nClosed For Business",DIntInfo[propertyid][doorUOwner]);
}
else
{
format(string,sizeof(string), "%s\nOwner: %s",DIntInfo[propertyid][doorUOwner], DIntInfo[propertyid][doorFOwner]);
}
Property3d[propertyid] = CreateDynamic3DTextLabel(string,COLOR_YELLOW, DIntInfo[propertyid][doorEntranceX], DIntInfo[propertyid][doorEntranceY], DIntInfo[propertyid][doorEntranceZ]+1.0, 50.0);
}
}
pawn Код:
forward OnPropUpdate();
public OnPropUpdate()
{
new idx;
new File: file2;
idx = 0;
while (idx < sizeof(DIntInfo))
{
new coordsstring[1024];
format(coordsstring, sizeof(coordsstring), "%d|%s|%s|%s|%f|%f|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\n",
DIntInfo[idx][doorOwned],
DIntInfo[idx][doorOwner],
DIntInfo[idx][doorUOwner],
DIntInfo[idx][doorFOwner],
DIntInfo[idx][doorEntranceX],
DIntInfo[idx][doorEntranceY],
DIntInfo[idx][doorEntranceZ],
DIntInfo[idx][doorEntAngle],
DIntInfo[idx][doorExitX],
DIntInfo[idx][doorExitY],
DIntInfo[idx][doorExitZ],
DIntInfo[idx][doorExitAngle],
DIntInfo[idx][doorLevelRequired],
DIntInfo[idx][doorTill],
DIntInfo[idx][doorMats],
DIntInfo[idx][doorPot],
DIntInfo[idx][doorCrack],
DIntInfo[idx][doorLocked],
DIntInfo[idx][doorInterior],
DIntInfo[idx][doorVirtual],
DIntInfo[idx][doorBuyPrice],
DIntInfo[idx][doorType]);
if(idx == 0)
{
file2 = fopen("sacgta/property/dint.cfg", io_write);
}
else
{
file2 = fopen("sacgta/property/dint.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
}