Show All Of MAX_VEHICLES in Dialog
#8

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?

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;
Reply


Messages In This Thread
Show All Of MAX_VEHICLES in Dialog - by jakejohnsonusa - 26.04.2013, 21:44
Re: Show All Of MAX_VEHICLES in Dialog - by jakejohnsonusa - 27.04.2013, 19:51
Re: Show All Of MAX_VEHICLES in Dialog - by Pottus - 27.04.2013, 19:59
Re: Show All Of MAX_VEHICLES in Dialog - by Chenko - 27.04.2013, 20:18
Re: Show All Of MAX_VEHICLES in Dialog - by Pottus - 27.04.2013, 20:22
Re: Show All Of MAX_VEHICLES in Dialog - by Chenko - 27.04.2013, 20:30
Re: Show All Of MAX_VEHICLES in Dialog - by Vince - 27.04.2013, 21:04
Re: Show All Of MAX_VEHICLES in Dialog - by jakejohnsonusa - 28.04.2013, 20:06
Re: Show All Of MAX_VEHICLES in Dialog - by jakejohnsonusa - 30.04.2013, 20:20
Re: Show All Of MAX_VEHICLES in Dialog - by Chenko - 30.04.2013, 22:13

Forum Jump:


Users browsing this thread: 1 Guest(s)