28.04.2013, 20:06
Ok, I now have this:
But it still doesn't show all the vehicles, only the first one... Anyone see what I'm still doing wrong?
But it still doesn't show all the vehicles, only the first one... Anyone see what I'm still doing wrong?
pawn Код:
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;