help [debug] Run time error 4: "Array index out of bounds"
#6

Change your CloseGate function to this:

PHP код:
forward CloseGate(gateidlinkidFloat:fXFloat:fYFloat:fZFloat:speedFloat:fRotXFloat:fRotYFloat:fRotZ);
public 
CloseGate(gateidlinkidFloat:fXFloat:fYFloat:fZFloat:speedFloat:fRotXFloat:fRotYFloat:fRotZ)
{
    new 
id = -1;
    if (
GateData[gateid][gateExists] && GateData[gateid][gateOpened])
     {
         
MoveDynamicObject(GateData[gateid][gateObject], fXfYfZspeedfRotXfRotYfRotZ);
         if ((
id GetGateByID(linkid)) != -1)
        {
            
MoveDynamicObject(GateData[id][gateObject], GateData[id][gatePos][0], GateData[id][gatePos][1], GateData[id][gatePos][2], speedGateData[id][gatePos][3], GateData[id][gatePos][4], GateData[id][gatePos][5]);
            
GateData[id][gateOpened] = 0;
            return 
1;
        }
    }
    return 
0;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)