Limit Mysql 500 vehicles ?
#1

hello everyone

Sorry for the language
I have trouble loading mysql vehicle. When the number reaches 499 it stops.

Here is the script loading vehicle:

Код:
new VEHICULE_BOT = 16;
enum VehInfo
{
     //enum hear
}
new VehiculeInfo[MAX_VEHICLES][VehInfo];

public LoadVehicule()
{
    AddStaticVehicleEx(538,1462.0745,2630.8787,10.8203,200.0,-1,-1,-1);// LV passenger 1
	AddStaticVehicleEx(538,-1942.7950,168.4164,27.0006,200.0,-1,-1,-1);// SF passenger 5
	AddStaticVehicleEx(538,1700.7551,-1953.6531,14.8756,200.0,-1,-1,-1);// LS passenger 9

    AddStaticVehicleEx(577,1477.4631,1647.4589,10.7281,180.2741,8,7,-1);// at400 LV rwy 13
	AddStaticVehicleEx(577,-1513.0963,-21.4589,14.0641,314.4915,8,7,-1);// at400 SF rwy 14
	AddStaticVehicleEx(577,2014.6605,-2493.9668,13.4887,89.6533,8,7,-1);// at400 LS rwy 

    new vehicleid = VEHICULE_BOT, result[128];
    mysql_query("SELECT * FROM vehicule");
   	mysql_store_result();
	while(mysql_retrieve_row())
	{
		mysql_get_field("VehID", result), VehiculeInfo[vehicleid][VehID] = strval(result);
		mysql_get_field("Model", result), VehiculeInfo[vehicleid][Model] = strval(result);
		mysql_get_field("XSpawn", result), VehiculeInfo[vehicleid][XSpawn] = floatstr(result);
		mysql_get_field("YSpawn", result), VehiculeInfo[vehicleid][YSpawn] = floatstr(result);
		mysql_get_field("ZSpawn", result), VehiculeInfo[vehicleid][ZSpawn] = floatstr(result);
		mysql_get_field("ASpawn", result), VehiculeInfo[vehicleid][ASpawn] = floatstr(result);
		mysql_get_field("Couleur1", result), VehiculeInfo[vehicleid][Couleur1] = strval(result);
		mysql_get_field("Couleur2", result), VehiculeInfo[vehicleid][Couleur2] = strval(result);
		mysql_get_field("Prix", result), VehiculeInfo[vehicleid][Prix] = strval(result);
		mysql_get_field("Status", result), VehiculeInfo[vehicleid][Status] = strval(result);
		mysql_get_field("Alarme", result), VehiculeInfo[vehicleid][Alarme] = strval(result);
		mysql_get_field("PackLuxe", result), VehiculeInfo[vehicleid][PackLuxe] = strval(result);
		mysql_get_field("cInterior", result), VehiculeInfo[vehicleid][cInterior] = strval(result);
		mysql_get_field("cVirWorld", result), VehiculeInfo[vehicleid][cVirWorld] = strval(result);
		mysql_get_field("Peinture", result), VehiculeInfo[vehicleid][Peinture] = strval(result);
		mysql_get_field("Kilometrage", result), VehiculeInfo[vehicleid][Kilometrage] = strval(result);
		mysql_get_field("Proprio", result), strmid(VehiculeInfo[vehicleid][Proprio], result, 0, strlen(result), 255);
		mysql_get_field("Plaque", result), strmid(VehiculeInfo[vehicleid][Plaque], result, 0, strlen(result), 255);
		mysql_get_field("Nom", result), strmid(VehiculeInfo[vehicleid][Nom], result, 0, strlen(result), 255);
		mysql_get_field("Essence", result), VehiculeInfo[vehicleid][Essence] = strval(result);
		mysql_get_field("MaxEssence", result), VehiculeInfo[vehicleid][MaxEssence] = strval(result);
		mysql_get_field("vNeonVeh", result), VehiculeInfo[vehicleid][vNeonVeh] = strval(result);
		mysql_get_field("vFaction", result), VehiculeInfo[vehicleid][vFaction] = strval(result);
		mysql_get_field("vJob", result), VehiculeInfo[vehicleid][vJob] = strval(result);
		mysql_get_field("vJobIllegal", result), VehiculeInfo[vehicleid][vJobIllegal] = strval(result);
		mysql_get_field("vLocation", result), VehiculeInfo[vehicleid][vLocation] = strval(result);
		mysql_get_field("vVIP", result), VehiculeInfo[vehicleid][vVIP] = strval(result);
		mysql_get_field("vAutre", result), VehiculeInfo[vehicleid][vAutre] = strval(result);
		mysql_get_field("vBiz", result), VehiculeInfo[vehicleid][vBiz] = strval(result);
		mysql_get_field("vClignotant", result), VehiculeInfo[vehicleid][vClignotant] = strval(result);
		mysql_get_field("vGyrophare", result), VehiculeInfo[vehicleid][vGyrophare] = strval(result);
		mysql_get_field("Amende", result), VehiculeInfo[vehicleid][Amende] = strval(result);
		mysql_get_field("vGyroPosX", result), VehiculeInfo[vehicleid][vGyroPosX] = floatstr(result);
		mysql_get_field("vGyroPosY", result), VehiculeInfo[vehicleid][vGyroPosY] = floatstr(result);
		mysql_get_field("vGyroPosZ", result), VehiculeInfo[vehicleid][vGyroPosZ] = floatstr(result);
		mysql_get_field("vGarantie", result), VehiculeInfo[vehicleid][vGarantie] = strval(result);
		mysql_get_field("vMaxCoffrePlace", result), VehiculeInfo[vehicleid][vMaxCoffrePlace] = strval(result);
		mysql_get_field("Tuning0", result), VehiculeInfo[vehicleid][Tuning0] = strval(result);
		mysql_get_field("Tuning1", result), VehiculeInfo[vehicleid][Tuning1] = strval(result);
		mysql_get_field("Tuning2", result), VehiculeInfo[vehicleid][Tuning2] = strval(result);
		mysql_get_field("Tuning3", result), VehiculeInfo[vehicleid][Tuning3] = strval(result);
		mysql_get_field("Tuning4", result), VehiculeInfo[vehicleid][Tuning4] = strval(result);
		mysql_get_field("Tuning5", result), VehiculeInfo[vehicleid][Tuning5] = strval(result);
		mysql_get_field("Tuning6", result), VehiculeInfo[vehicleid][Tuning6] = strval(result);
		mysql_get_field("Tuning7", result), VehiculeInfo[vehicleid][Tuning7] = strval(result);
		mysql_get_field("Tuning8", result), VehiculeInfo[vehicleid][Tuning8] = strval(result);
		mysql_get_field("Tuning9", result), VehiculeInfo[vehicleid][Tuning9] = strval(result);
		mysql_get_field("Tuning10", result), VehiculeInfo[vehicleid][Tuning10] = strval(result);
		mysql_get_field("Tuning11", result), VehiculeInfo[vehicleid][Tuning11] = strval(result);
		mysql_get_field("Tuning12", result), VehiculeInfo[vehicleid][Tuning12] = strval(result);
		mysql_get_field("Tuning13", result), VehiculeInfo[vehicleid][Tuning13] = strval(result);
		mysql_get_field("AchatVIP", result), VehiculeInfo[vehicleid][AchatVIP] = strval(result);
		RestartVeh(vehicleid);
		vehicleid++;
	}
	mysql_free_result();
	printf("[Info]: %d vйhicules charger.\r\n", vehicleid);
	return 1;
}
Thank you for your answers.
Reply
#2

How many vehicles do you have stored in the database? If you have 500, but "vehicleid" only prints 499, then it should be working fine because variables start at 0, not 1.
Reply
#3

thank you

There are 500 vehicles saved.

499 charged, then the server stops charging (home bizz ...)

Crash Detect:

[22:59:50] [debug] Run time error 4: "Array index out of bounds"
[22:59:50] [debug] Accessing element at index 500 past array upper bound 499
[22:59:50] [debug] AMX backtrace:
[22:59:50] [debug] #0 002b94a0 in ?? () from lmrp.amx
[22:59:50] [debug] #1 002b0e10 in ?? () from lmrp.amx
[22:59:50] [debug] #2 00094294 in ?? () from lmrp.amx
[22:59:50] [debug] #3 000a0ea4 in public Itter_OnGameModeInit () from lmrp.amx
[22:59:50] [debug] #4 native CallLocalFunction () [00471e90] from samp-server.exe
[22:59:50] [debug] #5 000013d0 in public Streamer_OnGameModeInit () from lmrp.amx
[22:59:50] [debug] #6 native CallLocalFunction () [00471e90] from samp-server.exe
[22:59:50] [debug] #7 00000a5c in public OnGameModeInit () from lmrp.amx
Reply
#4

Fail

Sorry Flood
Reply
#5

Try not to double post- it'll get you in trouble.

Did you re-define MAX_VEHICLES in your script?

For example:

pawn Код:
#undef MAX_VEHICLES
#define MAX_VEHICLES 500
Reply
#6

agree

MAX_VEHICLES is original SA MP

In pawno /include/a_samp

Код:
#define MAX_VEHICLES							(2000)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)