Opening vehicle file to change the colour.
#1

Basically I have made my vehicle system in Dini. I'm unsure how to make the code open the vehicle file of the vehicle i am in to change the colour when they use this command.

pawn Код:
command(setvcolour, playerid, params[])
{
    if(PlayerInfo[playerid][Admin] >= 4)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new colour[2], string[128];
            if(sscanf(params, "dd", colour[0], colour[1]))return SendClientMessage(playerid, COLOUR_WHITE, "HINT: /setvcolour [Colour1] [Colour2]");
            {
                new Vehiclefile[256];
                new vcid;
                vcid = GetPlayerVehicleID(playerid);
                format(Vehiclefile, sizeof(Vehiclefile), "vehicles/Vehicle_%d.ini", id);
                {
                    Vehicles[id][Colour1] = colour[0];
                    Vehicles[id][Colour1] = colour[1];
                    SendClientMessage(playerid, COLOUR_WHITE, "CHANGED" );
                    ChangeVehicleColor(vcid, colour[0], colour[1]);
                }
            }
        }
    }
    return 1;
 }
Reply
#2

dini_IntSet to format file(change information)
dini_Int to get information

Search how to use those
Reply
#3

Hey, I know how to change the file information, i just can't figure out how to access that file, so if i wanted to change the colour of vehicle 42 for example and no other vehicles.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)