[Solved] Function causing server freeze - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Solved] Function causing server freeze (
/showthread.php?tid=118908)
[Solved] Function causing server freeze -
Rimeau - 05.01.2010
Hey there,
Sometimes our server freezes, it doesn't crash but stops doing anything
This is allways caused by this function (we added a print to every function to find the reason...hello 600 MB server_log
)
Код:
public GetPointPointDis(Float:X1, Float:Y1, Float:Z1, Float:X2, Float:Y2, Float:Z2)
{
X1 = floatround(X1);
Y1 = floatround(Y1);
Z1 = floatround(Z1);
X2 = floatround(X2);
Y2 = floatround(Y2);
Z2 = floatround(Z2);
if(X1 == X2 && Y1 == Y2 && Z1 == Z2) return 0;
X1 -= X2;
Y1 -= Y2;
Z1 -= Z2;
new Float:dis = floatsqroot((X1*X1)+(Y1*Y1)+(Z1*Z1));
return floatround(dis);
}
Any ideas...?
The floatround for the 6 coordinates was added later