SA-MP Forums Archive
Opening vehicle file to change the colour. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Opening vehicle file to change the colour. (/showthread.php?tid=450978)



Opening vehicle file to change the colour. - cloudysky - 15.07.2013

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



Re: Opening vehicle file to change the colour. - Passout - 15.07.2013

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

Search how to use those


Re: Opening vehicle file to change the colour. - cloudysky - 15.07.2013

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.