Distance - 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: Distance (
/showthread.php?tid=626964)
Distance -
Loinal - 22.01.2017
Since i updated my Gamemode to R41-2 i got these errors
Код:
[13:54:12] [debug] #1 0005be70 in public MapIconStreamer () at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5315
[13:54:13] [debug] Run time error 4: "Array index out of bounds"
[13:54:13] [debug] Attempted to read/write array element at index 100 in array of size 100
[13:54:13] [debug] AMX backtrace:
[13:54:13] [debug] #0 0005b2d8 in public Float:GetDistanceToProperty (playerid=0, Property=100) at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5234
[13:54:13] [debug] #1 0005be70 in public MapIconStreamer () at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5315
[13:54:13] [debug] Run time error 4: "Array index out of bounds"
[13:54:13] [debug] Attempted to read/write array element at index 100 in array of size 100
[13:54:13] [debug] AMX backtrace:
[13:54:13] [debug] #0 0005b2d8 in public Float:GetDistanceToProperty (playerid=0, Property=100) at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5234
[13:54:13] [debug] #1 0005be70 in public MapIconStreamer () at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5315
[13:54:14] [debug] Run time error 4: "Array index out of bounds"
[13:54:14] [debug] Attempted to read/write array element at index 100 in array of size 100
[13:54:14] [debug] AMX backtrace:
[13:54:14] [debug] #0 0005b2d8 in public Float:GetDistanceToProperty (playerid=0, Property=100) at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5234
[13:54:14] [debug] #1 0005be70 in public MapIconStreamer () at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5315
[13:54:14] [debug] Run time error 4: "Array index out of bounds"
[13:54:14] [debug] Attempted to read/write array element at index 100 in array of size 100
[13:54:14] [debug] AMX backtrace:
[13:54:14] [debug] #0 0005b2d8 in public Float:GetDistanceToProperty (playerid=0, Property=100) at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5234
[13:54:14] [debug] #1 0005be70 in public MapIconStreamer () at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5315
[13:54:15] [debug] Run time error 4: "Array index out of bounds"
[13:54:15] [debug] Attempted to read/write array element at index 100 in array of size 100
[13:54:15] [debug] AMX backtrace:
[13:54:15] [debug] #0 0005b2d8 in public Float:GetDistanceToProperty (playerid=0, Property=100) at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5234
[13:54:15] [debug] #1 0005be70 in public MapIconStreamer () at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5315
[13:54:16] [debug] Run time error 4: "Array index out of bounds"
[13:54:16] [debug] Attempted to read/write array element at index 100 in array of size 100
[13:54:16] [debug] AMX backtrace:
[13:54:16] [debug] #0 0005b2d8 in public Float:GetDistanceToProperty (playerid=0, Property=100) at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5234
[13:54:16] [debug] #1 0005be70 in public MapIconStreamer () at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5315
[13:54:16] [debug] Run time error 4: "Array index out of bounds"
[13:54:16] [debug] Attempted to read/write array element at index 100 in array of size 100
[13:54:16] [debug] AMX backtrace:
[13:54:16] [debug] #0 0005b2d8 in public Float:GetDistanceToProperty (playerid=0, Property=100) at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5234
[13:54:16] [debug] #1 0005be70 in public MapIconStreamer () at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5315
[13:54:17] [debug] Run time error 4: "Array index out of bounds"
[13:54:17] [debug] Attempted to read/write array element at index 100 in array of size 100
[13:54:17] [debug] AMX backtrace:
[13:54:17] [debug] #0 0005b2d8 in public Float:GetDistanceToProperty (playerid=0, Property=100) at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5234
[13:54:17] [debug] #1 0005be70 in public MapIconStreamer () at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5315
[13:54:17] [debug] Run time error 4: "Array index out of bounds"
[13:54:17] [debug] Attempted to read/write array element at index 100 in array of size 100
[13:54:17] [debug] AMX backtrace:
[13:54:17] [debug] #0 0005b2d8 in public Float:GetDistanceToProperty (playerid=0, Property=100) at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5234
[13:54:17] [debug] #1 0005be70 in public MapIconStreamer () at D:\samp folder\(XteMeX) xMs\gamemodes\xMs.pwn:5315
Codes:
PHP код:
forward Float:GetDistanceToProperty(playerid, Property);
public Float:GetDistanceToProperty(playerid, Property)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
GetPlayerPos(playerid,x1,y1,z1);
x2 = PropInfo[Property][PropX];
y2 = PropInfo[Property][PropY];
z2 = PropInfo[Property][PropZ];
return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}
Re: Distance -
Micko123 - 22.01.2017
Код:
Run time error 4: "Array index out of bounds"
That means that you have smth like this
PHP код:
new something[100]
but it need more than 100 cells to write string or piece of information. To fix problem just increase your cell size..
Re: Distance -
Yaa - 22.01.2017
why not just pm me ?? btw you need to increase MAX_PROPERTYS
Re: Distance -
Vince - 22.01.2017
A backtrace is in reverse order; first thing listed is the last thing that happened.
Just for your information, though: that whole floatsqroot(floatpower ... line is obsolete. See VectorSize for a cleaner and simpler solution.