2 Functions crashing server... Major isssue +Rep! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 2 Functions crashing server... Major isssue +Rep! (
/showthread.php?tid=381259)
2 Functions crashing server... Major isssue +Rep! -
ShawnMiller1337 - 29.09.2012
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);
}
}
Re: 2 Functions crashing server... Major isssue +Rep! -
Face9000 - 29.09.2012
Do you have:
sacgta main folder located in
scriptfiles -
property subfolder located in
sacgta and the
dint.cfg file located in the
property subfolder?Check it.