20.08.2015, 00:21
(
Последний раз редактировалось JordanZaundd; 05.09.2016 в 06:46.
)
Hey, when I tried updating my script from 0.3z to 0.3.7 I encountered these errors. Before, it worked without a problem. I've tried using the search but I've still not picked up on the problem, so I apologize in advanced for making another thread.
[debug] from server_log.txt
OnCharacterLogin is a big function so I will leave it out and try to solve that on my own.
Any and all help is appreciated, thank you.
CreateVehicleEx() function
dialogid == 2569
[debug] from server_log.txt
PHP код:
[19:47:48] [debug] Run time error 4: "Array index out of bounds"
[19:47:48] [debug] Accessing element at index 65535 past array upper bound 1999
[19:47:48] [debug] AMX backtrace:
[19:47:48] [debug] #0 001e8d90 in public CreateVehicleEx (1, 0, 0, 0, 0, 1, 1, -1) from MLRPv4.3.3d.amx
[19:47:48] [debug] #1 000daf80 in public OnCharacterLogin (0, 354) from MLRPv4.3.3d.amx
[19:47:48] [debug] #2 0007c540 in public OnDialogResponse (0, 2569, 1, 0, 12324896) from MLRPv4.3.3d.amx
Any and all help is appreciated, thank you.
CreateVehicleEx() function
PHP код:
public CreateVehicleEx(model, Float:X, Float:Y, Float:Z, Float:A, color1, color2, spawntime)
{
// FuncLog("CreateVehicleEx");
new car = CreateVehicle(model, X, Y, Z, A, color1, color2, spawntime);
VehApproved[car] = 1;
VehLocked[car] = 0;
DeleteList[car] = 0;
if(IsLicensePlate(model))
{
SetVehicleNumberPlate(car, "MLRP");
}
// RespawnCar(car);
PlayerHaul[car][pCapasity] = VehicleCapasity(model);
PlayerHaul[car][pLoad] = 0;
Gas[car] = 100;
VehNeon[car][0] = 0;
VehNeon[car][1] = 0;
if(!IsACar(model))
{
SetVehicleParamsEx(car, 1, 0, 0, 0, 0, 0, 0);
}
else
{
SetVehicleParamsEx(car, 0, 0, 0, 0, 0, 0, 0);
}
for(new s; s<MAX_TRUNK_SLOTS; s++)
{
TrunkInfo[car][s][tItemAmount] = 0;
TrunkInfo[car][s][tItemID] = 0;
TrunkInfo[car][s][tItemType] = 0;
format(TrunkInfo[car][s][tItemTitle], 30, "Empty");
UpdateVehicleTrunk(car, s);
}
return car;
}
PHP код:
if(dialogid == 2569) { // Character Menu
if(!response) KickEx(playerid);
else {
new charQuery[128];
format(charQuery, sizeof(charQuery), "SELECT * FROM `accounts` WHERE `Username`='%s' LIMIT 1;", GPN(playerid));
mysql_query(charQuery);
mysql_store_result();
mysql_fetch_row(MySQLData, "|");
mysql_free_result();
split2(MySQLData, MySQLField, '|');
switch(listitem) {
case 0: {
if(strval(MySQLField[13]) > 0) OnCharacterLogin(playerid, strval(MySQLField[13]));
else {
ShowPlayerDialog(playerid, 2570, DIALOG_STYLE_INPUT, "Character Creation", "Please Input a name for your character.\n{FF0000}Example: John_Smith", "Create", "Cancel");
CreatingChar[playerid] = 1;
}
} case 1: {
if(strval(MySQLField[14]) > 0) OnCharacterLogin(playerid, strval(MySQLField[14]));
else {
ShowPlayerDialog(playerid, 2570, DIALOG_STYLE_INPUT, "Character Creation", "Please Input a name for your character.\n{FF0000}Example: John_Smith", "Create", "Cancel");
CreatingChar[playerid] = 2;
}
} case 2: {
if(strval(MySQLField[15]) > 0) OnCharacterLogin(playerid, strval(MySQLField[15]));
else {
ShowPlayerDialog(playerid, 2570, DIALOG_STYLE_INPUT, "Character Creation", "Please Input a name for your character.\n{FF0000}Example: John_Smith", "Create", "Cancel");
CreatingChar[playerid] = 3;
}
} case 3: {
if(strval(MySQLField[16]) > 0) OnCharacterLogin(playerid, strval(MySQLField[16]));
else {
ShowPlayerDialog(playerid, 2570, DIALOG_STYLE_INPUT, "Character Creation", "Please Input a name for your character.\n{FF0000}Example: John_Smith", "Create", "Cancel");
CreatingChar[playerid] = 4;
}
} case 4: {
if(strval(MySQLField[17]) > 0) OnCharacterLogin(playerid, strval(MySQLField[17]));
else {
ShowPlayerDialog(playerid, 2570, DIALOG_STYLE_INPUT, "Character Creation", "Please Input a name for your character.\n{FF0000}Example: John_Smith", "Create", "Cancel");
CreatingChar[playerid] = 5;
}
}
}
}
return 1;
}