SA-MP Forums Archive
help bug - 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: help bug (/showthread.php?tid=571096)



help bug - hoangtn219 - 16.04.2015

I have a problem when the edit gate .
----------------
else if(strcmp(x_job, "open", true) == 0)
{
foreach(new i:Player)
{
if(GetPVarInt(i, "EditingGateID") == gateid && i != playerid)
{
format(string, sizeof(string), "ERROR: %s (ID: %d) is currently editing this gate.", gateid);
return SendClientMessage(playerid, COLOR_WHITE, string);
}
}
SetPVarInt(playerid, "gEdit", 1);
SetPVarInt(playerid, "EditingGateID", gateid);
SetDynamicObjectPos(GateInfo[gateid][gGATE], GateInfo[gateid][gPosX], GateInfo[gateid][gPosY], GateInfo[gateid][gPosZ]);
SetDynamicObjectRot(GateInfo[gateid][gGATE], GateInfo[gateid][gRotX], GateInfo[gateid][gRotY], GateInfo[gateid][gRotZ]);
EditDynamicObject(playerid, GateInfo[gateid][gGATE]);
format(string, sizeof(string), "You are now editing the open position of Gate %d.", gateid);

SendMessage(playerid, COLOR_WHITE, string);
SaveGates();
SendClientMessage(playerid, COLOR_WHITE, string);
SendClientMessage(playerid, 0xFFFFAAAA, "HINT: Hold {8000FF}~k~~PED_SPRINT~ {FFFFAA}to move your camera, press escape to cancel");
}
------------------
sever log10:30:27] [debug] Run time error 4: "Array index out of bounds"
[10:30:27] [debug] Accessing element at negative index -1
[10:30:27] [debug] AMX backtrace:
[10:30:27] [debug] #0 001f057c in ?? (0x00000000, 0x000007c3, 0x00000002, 0x44bf3333, 0xc4d36666, 0x41562000, 0x00000000, 0x00000000, 0x00000000) from OOAK.amx
[10:30:27] [debug] #1 00011b50 in public OnPlayerEditDynamicObject (0x00000000, 0x000007c3, 0x00000002, 0x44bf3333, 0xc4d36666, 0x41562000, 0x00000000, 0x00000000, 0x00000000) from OOAK.amx
[10:30:27] [debug] #2 native Streamer_CallbackHook () from streamer.DLL
[10:30:27] [debug] #3 00006c40 in public OnPlayerEditObject (0x00000000, 0x00000001, 0x000003e6, 0x00000002, 0x44bf3333, 0xc4d36666, 0x41562000, 0x00000000, 0x00000000, 0x00000000) from OOAK.amx
[10:30:28] [debug] Run time error 4: "Array index out of bounds"
[10:30:28] [debug] Accessing element at negative index -1
Help me


Re: help bug - Antoniohl - 16.04.2015

have you tried to compile OOAK.pwn?