Distance
#1

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(playeridProperty);
public 
Float:GetDistanceToProperty(playeridProperty)
{
    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));

Reply
#2

Код:
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..
Reply
#3

why not just pm me ?? btw you need to increase MAX_PROPERTYS
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)