Getting a Vehicle's color? -
Luis- - 17.01.2011
I am wondering on how to get a Vehicle's color? Like what should I use?
Re: Getting a Vehicle's color? -
Anthonyx3' - 17.01.2011
try this:
https://sampforum.blast.hk/showthread.php?tid=176496
Re: Getting a Vehicle's color? -
Luis- - 17.01.2011
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");
}
Re: Getting a Vehicle's color? -
hanzen - 17.01.2011
The GetVehicleColor() is the one fucking up your vehicle IDs.
Re: Getting a Vehicle's color? -
Luis- - 17.01.2011
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..
Re: Getting a Vehicle's color? -
hanzen - 17.01.2011
I'm sure this will make it even worse, I only have bad experience with it. You need to return the vehicleids yourself.
Re: Getting a Vehicle's color? -
Luis- - 17.01.2011
Well, If I removed it could you see a fix that will set the Vehicle's ID's right?
Re: Getting a Vehicle's color? -
hanzen - 17.01.2011
I'm relaly not sure what you want.
Re: Getting a Vehicle's color? -
Anthonyx3' - 17.01.2011
Try saving the vehicle id, GetPlayerVehicleID(playerid) or something like that
Re: Getting a Vehicle's color? -
Luis- - 17.01.2011
I really don't understand this what so ever :S, I have tried everything to get the Vehicle ID,
GetVehiclePlayerID(playerid), GetVehicleModel(vehicleid)..