Getting a Vehicle's color?
#1

I am wondering on how to get a Vehicle's color? Like what should I use?
Reply
#2

try this:
https://sampforum.blast.hk/showthread.php?tid=176496
Reply
#3

Quote:
Originally Posted by Anthonyx3'
Посмотреть сообщение
Thanks, Also I need to know how I can get the Vehicles ID as my code it just mixing with the Server Vehicles..

pawn Код:
if(strcmp(cmd, "/saveveh", true) == 0)
    {
        new file[128];
        /*for(new i = 1; i < sizeof(vInfo); i++)
        {*/

            format(file, sizeof(file), "Vehicles/%d.ini", vehicleid);
            if(PlayerInfo[playerid][pAdmin] >= 1337)
            {
                new Float:X, Float:Y, Float:Z, Float:A, Color1, Color2, Plate;
                GetVehiclePos(vehicleid, X, Y, Z);
                GetVehicleZAngle(vehicleid, A);
                GetVehicleColor(vehicleid, Color1, Color2);
                dini_Create(file);
                dini_IntSet(file, "Model", vehicleid);
                dini_FloatSet(file, "PosX", X);
                dini_FloatSet(file, "PosY", Y);
                dini_FloatSet(file, "PosZ", Z);
                dini_FloatSet(file, "PosA", A);
                dini_IntSet(file, "Plate", Plate);
                dini_IntSet(file, "Col1", Color1);
                dini_IntSet(file, "Col2", Color2);
            //}
        }
        SendClientMessage(playerid, COLOR_YELLOW, "[VEHICLE-INFO] Vehicle Saved");
        return 1;
    }
    if(strcmp(cmd, "/loadveh", true) == 0)
    {
        new file[128];
        for(new i = 1; i < sizeof(vInfo); i++)
        {
            format(file, sizeof(file), "Vehicles/%d.ini", i);
            if(!fexist(file))
                continue;
               
            vInfo[i][vModel] = dini_Int(file, "Model");
            vInfo[i][vPosX] = dini_Float(file, "PosX");
            vInfo[i][vPosY] = dini_Float(file, "PosY");
            vInfo[i][vPosZ] = dini_Float(file, "PosZ");
            vInfo[i][vPosA] = dini_Float(file, "PosA");
            vInfo[i][vPlate] = dini_Int(file, "Plate");
            vInfo[i][vColor1] = dini_Int(file, "Col1");
            vInfo[i][vColor2] = dini_Int(file, "Col2");
            CreateVehicle(vInfo[i][vModel], vInfo[i][vPosX],  vInfo[i][vPosY], vInfo[i][vPosZ],  vInfo[i][vPosA], vInfo[i][vColor1], vInfo[i][vColor2], true);
            ChangeVehicleColor(vehicleid, vInfo[i][vColor1], vInfo[i][vColor2]);
            /*SetVehicleNumberPlate(vehicleid, vInfo[i][vPlate]);*/
        }
        SendClientMessage(playerid, COLOR_YELLOW, "[VEHICLE INFO] Vehicles Loaded");
    }
Reply
#4

The GetVehicleColor() is the one fucking up your vehicle IDs.
Reply
#5

Quote:
Originally Posted by hanzen
Посмотреть сообщение
The GetVehicleColor() is the one fucking up your vehicle IDs.
It aint, As it was fucking it before I added it..
Reply
#6

I'm sure this will make it even worse, I only have bad experience with it. You need to return the vehicleids yourself.
Reply
#7

Well, If I removed it could you see a fix that will set the Vehicle's ID's right?
Reply
#8

I'm relaly not sure what you want.
Reply
#9

Try saving the vehicle id, GetPlayerVehicleID(playerid) or something like that
Reply
#10

I really don't understand this what so ever :S, I have tried everything to get the Vehicle ID, GetVehiclePlayerID(playerid), GetVehicleModel(vehicleid)..
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)