new string[800 char];
new CurrentCars;
CurrentCars = 0;
for(new i = 0; i < MAX_VEHICLES; i++) // MY WIP Police Vehicle Info system. Includes Health, driver, passengers, Location?, and Veh ID
{
if(IsACopCar(i))//All Cop Cars
{
for(new q = 0; q < MAX_PLAYERS; q++)
{
if(IsPlayerInVehicle(q, i))//All Cop Cars with People in the vehicle
{
if(GetPlayerVehicleSeat(q) == 0)//All cop cars with a driver
{
new vehicle[24];
new player[800];
new Float:engine;
GetVehicleHealth(i, engine);
new Float:currenthealth;
currenthealth = engine / 10;
GetVehicleName(i, vehicle, sizeof(vehicle));
new zone[MAX_ZONE_NAME];
GetVehicle2DZone(i, zone, MAX_ZONE_NAME);
new atext[20];
if(gEngine[i] == 1) { atext = "{76EE00}ON{FFFFFF}"; }
else if(gEngine[i] == 0) { atext = "{EE0000}OFF{FFFFFF}"; }
new kmh = GetPlayerSpeed(q, true);
format(player, sizeof(player), "{FFFFFF}Vehicle: %s (%d) | Gov ID: %d | Driver: %s (%d) \n", vehicle, GetVehicleModel(i), i, Nick(q), q);// Want to add more stuff here...
strcat(string, player)
format(player, sizeof(player), " {FFFFFF}Engine Status: %s | Health: %.1f %% | Speed: %d | Location: %s \n", atext, currenthealth, kmh, zone);// Want to add more stuff here...
strcat(string, player)
ShowPlayerDialog(playerid, 1592, DIALOG_STYLE_MSGBOX, "Dispatch Vehicles Display System (DVDS)", string, "Close", "");
strdel(string, 0, strlen(string));
CurrentCars = 1;
return 1;
}
}
}
}
Get rid of return 1; all together. Don't replace it with break, you will have the same problem. Also, move ShowPlayerDialog outside both loops.
|
new string[800 char];
new CurrentCars;
CurrentCars = 0;
for(new i = 0; i < MAX_VEHICLES; i++) // MY WIP Police Vehicle Info system. Includes Health, driver, passengers, Location?, and Veh ID
{
if(IsACopCar(i))//All Cop Cars
{
for(new q = 0; q < MAX_PLAYERS; q++)
{
if(IsPlayerInVehicle(q, i))//All Cop Cars with People in the vehicle
{
if(GetPlayerVehicleSeat(q) == 0)//All cop cars with a driver
{
new vehicle[24];
new player[800];
new Float:engine;
GetVehicleHealth(i, engine);
new Float:currenthealth;
currenthealth = engine / 10;
GetVehicleName(i, vehicle, sizeof(vehicle));
new zone[MAX_ZONE_NAME];
GetVehicle2DZone(i, zone, MAX_ZONE_NAME);
new atext[20];
if(gEngine[i] == 1) { atext = "{76EE00}ON{FFFFFF}"; }
else if(gEngine[i] == 0) { atext = "{EE0000}OFF{FFFFFF}"; }
new kmh = GetPlayerSpeed(q, true);
format(player, sizeof(player), "{FFFFFF}Vehicle: %s (%d) | Gov ID: %d | Driver: %s (%d) \n", vehicle, GetVehicleModel(i), i, Nick(q), q);// Info Line #1
strcat(string, player)
format(player, sizeof(player), " {FFFFFF}Engine Status: %s | Health: %.1f %% | Speed: %d | Location: %s \n", atext, currenthealth, kmh, zone);// Info Line #2
strcat(string, player)
}
}
}
}
ShowPlayerDialog(playerid, 1592, DIALOG_STYLE_MSGBOX, "Dispatch Vehicles Display System (DVDS)", string, "Close", "");
strdel(string, 0, strlen(string));
CurrentCars = 1;