22.01.2017, 11:14
Since i updated my Gamemode to R41-2 i got these errors
Codes:
Код:
[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
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));
}