Jump to content
  • 0

Problema Array index out of bounds


DanielMayson

Question

Problema intalnita (descriere): Pur si simplu dupa ce dau drumu la server scrie la gamemode unknow
Ero(area / rile) / warning-(ul / urile):

[11:06:41] [debug] Run time error 4: "Array index out of bounds"
[11:06:41] [debug] Accessing element at index 65535 past array upper bound 1999
[11:06:41] [debug] AMX backtrace:
[11:06:41] [debug] #0 0079ab90 in ?? (0, 0, 0, 0, 0, 0, 0, 60000, 0, 0) from Untitled.amx
[11:06:41] [debug] #1 0001dcb8 in public SSCANF_OnGameModeInit () from Untitled.amx
[11:06:41] [debug] #2 native CallLocalFunction () from samp03svr
[11:06:41] [debug] #3 00003510 in public dc_cmd_OnGameModeInit () from Untitled.amx
[11:06:41] [debug] #4 0000079c in public OnGameModeInit () from Untitled.amx


Liniile de cod / sursa / script-ul(obligatoriu): ...
Imagini / Video (optional): ...
Ati incercat sa rezolvati singur?: Da.

Script Developer at Gta-Onyx.com

Creatiile mele:

Gamemode: Gta-Onyx #Build 10.5b

Gamemode: Country-Life v10 Final

Gamemode: Dream-Times v3.3.4 Final

Gamemode: Cartierul V1 (Curand)

AntiCheat Shock Final

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0
Acum 5 minute, DanielMayson a spus:

CreateTeamVehicle(org,rank,model,Float:X,Float:Y,Float:Z,Float:A,Color_1,Color_2,spawntime)
{
    new carid = J_AddStaticVehicleEx(model, X, Y, Z, A, Color_1, Color_2, spawntime);
    VehicleInfo[carid][vTeam] = org;
    VehicleInfo[carid][vRank] = rank;
    return carid;
}
CreateJobVehicle(job,model,Float:X,Float:Y,Float:Z,Float:A,Color_1,Color_2,spawntime)
{
    new carid = J_AddStaticVehicleEx(model, X, Y, Z, A, Color_1, Color_2, spawntime);
    VehicleInfo[carid][vJob] = job;
    return carid;
}


OwnableCar = J_AddStaticVehicleEx(CarInfo[cModel],CarInfo[cPos_X],CarInfo[cPos_Y],CarInfo[cPos_Z],CarInfo[cPos_A],CarInfo[cColor_1],CarInfo[cColor_2],60000);

J_AddStaticVehicleEx(462, 2230.0129, -1173.5667, 25.2544, 90.0000, -1, -1, 100);

Te.ai complicat prea mult făcând 1000 de funcții în cascadă..problema aici este J_AddStaticVehicleEx, se creează un vehicul cu id 0 coordonate 0 culoare 0 etc, identifica problema si remediaz.o, sau fa o singură funcție mai complexă decât 10 care dau din una în alta

 

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
[15:45:56] [debug] Run time error 4: "Array index out of bounds"
[15:45:56] [debug]  Accessing element at index 65535 past array upper bound 1999
[15:45:56] [debug] AMX backtrace:
[15:45:56] [debug] #0 0097486c in J_AddStaticVehicleEx (model=0, Float:x=0.00000, Float:y=0.00000, Float:z=0.00000, Float:a=0.00000, color_1=0, color_2=0, spawntime=60000, interior=0, world=0) at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\gamemodes\Untitled.pwn:54943
[15:45:56] [debug] #1 00024ff0 in public SSCANF_OnGameModeInit () at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\gamemodes\Untitled.pwn:7185
[15:45:56] [debug] #2 native CallLocalFunction () from samp03svr
[15:45:56] [debug] #3 00004358 in public dc_cmd_OnGameModeInit () at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\pawno\include\sscanf2.inc:84
[15:45:56] [debug] #4 000008e0 in public OnGameModeInit () at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\pawno\include\dc_cmd.inc:97

Script Developer at Gta-Onyx.com

Creatiile mele:

Gamemode: Gta-Onyx #Build 10.5b

Gamemode: Country-Life v10 Final

Gamemode: Dream-Times v3.3.4 Final

Gamemode: Cartierul V1 (Curand)

AntiCheat Shock Final

Link to comment
Share on other sites

  • 0
Acum 11 minute, DanielMayson a spus:
[15:45:56] [debug] Run time error 4: "Array index out of bounds"
[15:45:56] [debug]  Accessing element at index 65535 past array upper bound 1999
[15:45:56] [debug] AMX backtrace:
[15:45:56] [debug] #0 0097486c in J_AddStaticVehicleEx (model=0, Float:x=0.00000, Float:y=0.00000, Float:z=0.00000, Float:a=0.00000, color_1=0, color_2=0, spawntime=60000, interior=0, world=0) at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\gamemodes\Untitled.pwn:54943
[15:45:56] [debug] #1 00024ff0 in public SSCANF_OnGameModeInit () at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\gamemodes\Untitled.pwn:7185
[15:45:56] [debug] #2 native CallLocalFunction () from samp03svr
[15:45:56] [debug] #3 00004358 in public dc_cmd_OnGameModeInit () at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\pawno\include\sscanf2.inc:84
[15:45:56] [debug] #4 000008e0 in public OnGameModeInit () at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\pawno\include\dc_cmd.inc:97
54943 arată linia

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0

CMD:find(playerid, params[])
{
    if(sscanf(params,"d",params[0])) return SendClientMessage(playerid, COLOR_RED, "Foloseste: /find [id]");
    if(!IsACop(playerid)) return SendClientMessage(playerid,COLOR_RED, "Nu esti politist!");
    if(IsANotControllable(playerid)) return SendClientMessage(playerid, COLOR_RED, "Nu te poti misca!");
    if(playerid == params[0]) return false;
    if(PlayerInfo[params[0]][pMaskON]>0) return SendClientMessage(playerid, COLOR_VALIK, "[Eroare] {FFFFFF}Nu poti gasi locul unde se afla acest jucator!");
    if(GetPlayerInterior(params[0]) != GetPlayerInterior(playerid)) return SendClientMessage(playerid, COLOR_VALIK, "[Eroare] {FFFFFF}Acest jucator se afla intr-o cladire");
    if(PlayerInfo[params[0]][pWanted]==0) return SendClientMessage(playerid, COLOR_RED, "[Eroare] {FFFFFF}Nu poti gasi un jucator care nu este infractor!");
    if(!IsPlayerConnected(params[0])) return false;
    new Float:POS[3];
    GetPlayerPos(params[0], POS[0], POS[1], POS[2]);
    EnableGPSForPlayer(playerid, POS[0], POS[1], POS[2]);
    return true;
}

return true; e linia 

54943

Script Developer at Gta-Onyx.com

Creatiile mele:

Gamemode: Gta-Onyx #Build 10.5b

Gamemode: Country-Life v10 Final

Gamemode: Dream-Times v3.3.4 Final

Gamemode: Cartierul V1 (Curand)

AntiCheat Shock Final

Link to comment
Share on other sites

  • 0
Acum 8 minute, DanielMayson a spus:

CMD:find(playerid, params[])
{
    if(sscanf(params,"d",params[0])) return SendClientMessage(playerid, COLOR_RED, "Foloseste: /find [id]");
    if(!IsACop(playerid)) return SendClientMessage(playerid,COLOR_RED, "Nu esti politist!");
    if(IsANotControllable(playerid)) return SendClientMessage(playerid, COLOR_RED, "Nu te poti misca!");
    if(playerid == params[0]) return false;
    if(PlayerInfo[params[0]][pMaskON]>0) return SendClientMessage(playerid, COLOR_VALIK, "[Eroare] {FFFFFF}Nu poti gasi locul unde se afla acest jucator!");
    if(GetPlayerInterior(params[0]) != GetPlayerInterior(playerid)) return SendClientMessage(playerid, COLOR_VALIK, "[Eroare] {FFFFFF}Acest jucator se afla intr-o cladire");
    if(PlayerInfo[params[0]][pWanted]==0) return SendClientMessage(playerid, COLOR_RED, "[Eroare] {FFFFFF}Nu poti gasi un jucator care nu este infractor!");
    if(!IsPlayerConnected(params[0])) return false;
    new Float:POS[3];
    GetPlayerPos(params[0], POS[0], POS[1], POS[2]);
    EnableGPSForPlayer(playerid, POS[0], POS[1], POS[2]);
    return true;
}

return true; e linia 

54943

Arată EnableGpsForPlayer

Si acolo la sscanf încearcă să folosești o variabilă gen new id;

In loc de params[0]

Si vezi ca parametru pentru id sau nume este u nu d.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0

 

Acum 1 minut, DaEdRiC-FoX a spus:

Arată EnableGpsForPlayer

EnableGPSForPlayer(playerid, Float:x, Float:y, Float:z)
{
    gpss[playerid]=1;
    SetPlayerRaceCheckpoint(playerid, 1, Float:x, Float:y, Float:z, Float:x, Float:y, Float:z, 4.0);
    GameTextForPlayer(playerid, "GPS: ON", 0, 1);
    return true;
}

Script Developer at Gta-Onyx.com

Creatiile mele:

Gamemode: Gta-Onyx #Build 10.5b

Gamemode: Country-Life v10 Final

Gamemode: Dream-Times v3.3.4 Final

Gamemode: Cartierul V1 (Curand)

AntiCheat Shock Final

Link to comment
Share on other sites

  • 0
Chiar acum, DanielMayson a spus:

 

EnableGPSForPlayer(playerid, Float:x, Float:y, Float:z)
{
    gpss[playerid]=1;
    SetPlayerRaceCheckpoint(playerid, 1, Float:x, Float:y, Float:z, Float:x, Float:y, Float:z, 4.0);
    GameTextForPlayer(playerid, "GPS: ON", 0, 1);
    return true;
}

Vezi edit, si du.te în folderuk pawno, fă un fișier notepad si pune în el așa:

-d3

(Cu tot cu liniuță, exact cum ti.am dat)

salveaza cu numele de PAWN.cfg

Si da iar erorile din server log daca apar.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
Acum 11 minute, DaEdRiC-FoX a spus:

Vezi edit, si du.te în folderuk pawno, fă un fișier notepad si pune în el așa:

-d3

(Cu tot cu liniuță, exact cum ti.am dat)

salveaza cu numele de PAWN.cfg

Si da iar erorile din server log daca apar.

[16:37:27] [debug] Run time error 4: "Array index out of bounds"
[16:37:27] [debug]  Accessing element at index 65535 past array upper bound 1999
[16:37:27] [debug] AMX backtrace:
[16:37:27] [debug] #0 0097622c in J_AddStaticVehicleEx (model=0, Float:x=0.00000, Float:y=0.00000, Float:z=0.00000, Float:a=0.00000, color_1=0, color_2=0, spawntime=60000, interior=0, world=0) at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\gamemodes\Untitled.pwn:55072
[16:37:27] [debug] #1 00024ff0 in public SSCANF_OnGameModeInit () at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\gamemodes\Untitled.pwn:7187
[16:37:27] [debug] #2 native CallLocalFunction () from samp03svr
[16:37:27] [debug] #3 00004358 in public dc_cmd_OnGameModeInit () at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\pawno\include\sscanf2.inc:84
[16:37:27] [debug] #4 000008e0 in public OnGameModeInit () at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\pawno\include\dc_cmd.inc:97

-d3 deja era facut

Script Developer at Gta-Onyx.com

Creatiile mele:

Gamemode: Gta-Onyx #Build 10.5b

Gamemode: Country-Life v10 Final

Gamemode: Dream-Times v3.3.4 Final

Gamemode: Cartierul V1 (Curand)

AntiCheat Shock Final

Link to comment
Share on other sites

  • 0
Acum 3 minute, DanielMayson a spus:
[16:37:27] [debug] Run time error 4: "Array index out of bounds"
[16:37:27] [debug]  Accessing element at index 65535 past array upper bound 1999
[16:37:27] [debug] AMX backtrace:
[16:37:27] [debug] #0 0097622c in J_AddStaticVehicleEx (model=0, Float:x=0.00000, Float:y=0.00000, Float:z=0.00000, Float:a=0.00000, color_1=0, color_2=0, spawntime=60000, interior=0, world=0) at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\gamemodes\Untitled.pwn:55072
[16:37:27] [debug] #1 00024ff0 in public SSCANF_OnGameModeInit () at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\gamemodes\Untitled.pwn:7187
[16:37:27] [debug] #2 native CallLocalFunction () from samp03svr
[16:37:27] [debug] #3 00004358 in public dc_cmd_OnGameModeInit () at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\pawno\include\sscanf2.inc:84
[16:37:27] [debug] #4 000008e0 in public OnGameModeInit () at C:\Users\ONYX\Desktop\Gta-Onyx RolePlay\pawno\include\dc_cmd.inc:97

-d3 deja era facut

65535

Ia arată.mi linia asta

Si ce mașini creezi cu AddStaticVehicleEx

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
Chiar acum, DaEdRiC-FoX a spus:
65535

Ia arată.mi linia asta

sunt 63704 linii

Acum 3 minute, DaEdRiC-FoX a spus:
65535

Ia arată.mi linia asta

Si ce mașini creezi cu AddStaticVehicleEx

J_AddStaticVehicleEx(model,Float:x,Float:y,Float:z,Float:a,color_1,color_2,spawntime = 300,interior = 0,world = 0)
{
    new carid = AddStaticVehicleEx(model, x, y, z, a, color_1, color_2, spawntime);
    VehicleInfo[carid][vAntiRepair]=2;
    VehicleInfo[carid][vLock]=0;
    //VehicleHealth[carid] = 1000;
    VehicleInfo[carid][vModel] = model;
    VehicleInfo[carid][vPos_X] = x;
    VehicleInfo[carid][vPos_Y] = y;
    VehicleInfo[carid][vPos_Z] = z;
    VehicleInfo[carid][vPos_A] = a;
    VehicleInfo[carid][vColor_1] = color_1;
    VehicleInfo[carid][vColor_2] = color_2;
    VehicleInfo[carid][vSpawnTime] = spawntime;
    LinkVehicleToInterior(carid, interior);
    SetVehicleVirtualWorld(carid, world);
    VehicleInfo[carid][vTuning] = GetVehicleTuningState( model );
    switch(model)
    {
    case 430, 446, 452, 453, 454, 472, 473, 484, 493: VehicleState[carid] = VEHICLE_STATE_BOAT;
    case 417, 425, 447, 460, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520, 548, 553,
        563, 577, 592, 593:  VehicleState[carid] = VEHICLE_STATE_PLANE;
    case 581, 522, 461, 521, 523, 463, 468, 471, 586: VehicleState[carid] = VEHICLE_STATE_BIKE;
    case 509, 481, 510: VehicleState[carid] = VEHICLE_STATE_VELIK;
    case 462,448: VehicleState[carid] = VEHICLE_STATE_MOPED;
    case 538, 537: VehicleState[carid] = VEHICLE_STATE_TRAIN;
    default: VehicleState[carid] = VEHICLE_STATE_CAR;
    }
    return carid;
}

masinile din factiuni

Acum 6 minute, DaEdRiC-FoX a spus:
65535

Ia arată.mi linia asta

Si ce mașini creezi cu AddStaticVehicleEx

J_  e pentru AntiCheat

Script Developer at Gta-Onyx.com

Creatiile mele:

Gamemode: Gta-Onyx #Build 10.5b

Gamemode: Country-Life v10 Final

Gamemode: Dream-Times v3.3.4 Final

Gamemode: Cartierul V1 (Curand)

AntiCheat Shock Final

Link to comment
Share on other sites

  • 0
Acum 5 minute, DanielMayson a spus:

sunt 63704 linii

J_AddStaticVehicleEx(model,Float:x,Float:y,Float:z,Float:a,color_1,color_2,spawntime = 300,interior = 0,world = 0)
{
    new carid = AddStaticVehicleEx(model, x, y, z, a, color_1, color_2, spawntime);
    VehicleInfo[carid][vAntiRepair]=2;
    VehicleInfo[carid][vLock]=0;
    //VehicleHealth[carid] = 1000;
    VehicleInfo[carid][vModel] = model;
    VehicleInfo[carid][vPos_X] = x;
    VehicleInfo[carid][vPos_Y] = y;
    VehicleInfo[carid][vPos_Z] = z;
    VehicleInfo[carid][vPos_A] = a;
    VehicleInfo[carid][vColor_1] = color_1;
    VehicleInfo[carid][vColor_2] = color_2;
    VehicleInfo[carid][vSpawnTime] = spawntime;
    LinkVehicleToInterior(carid, interior);
    SetVehicleVirtualWorld(carid, world);
    VehicleInfo[carid][vTuning] = GetVehicleTuningState( model );
    switch(model)
    {
    case 430, 446, 452, 453, 454, 472, 473, 484, 493: VehicleState[carid] = VEHICLE_STATE_BOAT;
    case 417, 425, 447, 460, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520, 548, 553,
        563, 577, 592, 593:  VehicleState[carid] = VEHICLE_STATE_PLANE;
    case 581, 522, 461, 521, 523, 463, 468, 471, 586: VehicleState[carid] = VEHICLE_STATE_BIKE;
    case 509, 481, 510: VehicleState[carid] = VEHICLE_STATE_VELIK;
    case 462,448: VehicleState[carid] = VEHICLE_STATE_MOPED;
    case 538, 537: VehicleState[carid] = VEHICLE_STATE_TRAIN;
    default: VehicleState[carid] = VEHICLE_STATE_CAR;
    }
    return carid;
}

masinile din factiuni

Arată.mi cum chemi funcția jAddStaticVehEx

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
Acum 9 minute, DaEdRiC-FoX a spus:

Arată.mi cum chemi funcția jAddStaticVehEx

CreateTeamVehicle(org,rank,model,Float:X,Float:Y,Float:Z,Float:A,Color_1,Color_2,spawntime)
{
    new carid = J_AddStaticVehicleEx(model, X, Y, Z, A, Color_1, Color_2, spawntime);
    VehicleInfo[carid][vTeam] = org;
    VehicleInfo[carid][vRank] = rank;
    return carid;
}
CreateJobVehicle(job,model,Float:X,Float:Y,Float:Z,Float:A,Color_1,Color_2,spawntime)
{
    new carid = J_AddStaticVehicleEx(model, X, Y, Z, A, Color_1, Color_2, spawntime);
    VehicleInfo[carid][vJob] = job;
    return carid;
}


OwnableCar = J_AddStaticVehicleEx(CarInfo[cModel],CarInfo[cPos_X],CarInfo[cPos_Y],CarInfo[cPos_Z],CarInfo[cPos_A],CarInfo[cColor_1],CarInfo[cColor_2],60000);

J_AddStaticVehicleEx(462, 2230.0129, -1173.5667, 25.2544, 90.0000, -1, -1, 100);

Script Developer at Gta-Onyx.com

Creatiile mele:

Gamemode: Gta-Onyx #Build 10.5b

Gamemode: Country-Life v10 Final

Gamemode: Dream-Times v3.3.4 Final

Gamemode: Cartierul V1 (Curand)

AntiCheat Shock Final

Link to comment
Share on other sites

  • 0
Acum 9 minute, DaEdRiC-FoX a spus:

Te.ai complicat prea mult făcând 1000 de funcții în cascadă..problema aici este J_AddStaticVehicleEx, se creează un vehicul cu id 0 coordonate 0 culoare 0 etc, identifica problema si remediaz.o, sau fa o singură funcție mai complexă decât 10 care dau din una în alta

 

Poate fi si de la /veh? el functioneaza cu  J_AddStaticVehicleEx

Script Developer at Gta-Onyx.com

Creatiile mele:

Gamemode: Gta-Onyx #Build 10.5b

Gamemode: Country-Life v10 Final

Gamemode: Dream-Times v3.3.4 Final

Gamemode: Cartierul V1 (Curand)

AntiCheat Shock Final

Link to comment
Share on other sites

  • 0
Acum 16 minute, DanielMayson a spus:

Poate fi si de la /veh? el functioneaza cu  J_AddStaticVehicleEx

Dacă te uiți atent, îți arată si o eroare către includeul dc cmd, deci e posibil să fie și de la o comandă.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.