[HELP] Finding a cars colour
#7

Thanks to all responses. After this:
Quote:
Originally Posted by TimmehBoy
No, you have to make your own function(s).
I started making my own.
For the sake of anybody else who has had this problem, this is the code i used:
Код:
new CarColour[256];
.....
public OnGameModeInit()
{
  ColourAddStaticVehicle(476,-1657.362061,-155.683640,15.318590, 270,1,1);
  ColourAddStaticVehicle(476,-1647.219849,-165.189056,15.318590, 270,1,1);
  return 1;
}
.....
stock FindCarColour(playerid)
{
  if (!IsPlayerConnected(playerid) || !IsPlayerInAnyVehicle(playerid)) return 0;
  return CarColour[GetPlayerVehicleID(playerid)];
}

stock ColourAddStaticVehicle(ModelID,Float:spawn_X,Float:spawn_Y,Float:spawn_Z, Float:zangle, C1,C2)
{
  new carID;
  carID = AddStaticVehicle(ModelID,spawn_X,spawn_Y,spawn_Z,zangle,C1,C2);
  CarColour[carID] = C1;
  return carID;
}
To all nitpickers (lots of you out there): My script doesn't have more than 256 cars, so there won't be a problem with it.
Reply


Messages In This Thread
[HELP] Finding a cars colour - by jonrb - 12.09.2009, 12:04
Re: [HELP] Finding a cars colour - by [eLg]Timmy - 12.09.2009, 12:07
Re: [HELP] Finding a cars colour - by x-unit - 12.09.2009, 12:08
Re: [HELP] Finding a cars colour - by jonrb - 12.09.2009, 12:14
Re: [HELP] Finding a cars colour - by [eLg]Timmy - 12.09.2009, 12:25
Re: [HELP] Finding a cars colour - by dice7 - 12.09.2009, 12:27
Re: [HELP] Finding a cars colour - by jonrb - 12.09.2009, 14:40

Forum Jump:


Users browsing this thread: 1 Guest(s)