Getting ID of Vehicle from file
#3

EDIT:

This is what I now have, the problem is that it comes up all the cars in the server not just that individual car id. So for example if there is 4 cars on the server, i get in and it goes:

Car 1
Car 2
Car 3
Car 4

Instead of just Car 2.

This is the code
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new Vehiclefile[256];
    for(new i = 1; i < MAX_VEHICLES; i++)
    {
        format(Vehiclefile, sizeof(Vehiclefile), "vehicles/Vehicle_%d.ini", i);
        if(fexist(Vehiclefile) )
        {
            Vehicles[i][FILEID] = dini_Int(Vehiclefile, "FILEID");
            new string[128];
            format(string, sizeof(string), "Car %d", Vehicles[i][FILEID]);
            SendClientMessage(playerid, COLOUR_PURPLE, string);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Getting ID of Vehicle from file - by cloudysky - 21.04.2015, 13:23
Re: Getting ID of Vehicle from file - by Sithis - 21.04.2015, 13:48
Re: Getting ID of Vehicle from file - by cloudysky - 21.04.2015, 13:57
Re: Getting ID of Vehicle from file - by [KHK]Khalid - 21.04.2015, 15:47
Re: Getting ID of Vehicle from file - by Sithis - 21.04.2015, 16:00
Re: Getting ID of Vehicle from file - by cloudysky - 21.04.2015, 23:16
Re: Getting ID of Vehicle from file - by [KHK]Khalid - 22.04.2015, 00:56

Forum Jump:


Users browsing this thread: 2 Guest(s)