[HELP]Problem with Positions car
#1

I use a system Car Ownership. I create a Command that the players saves the postions' car where he wants. But, when he saves the positions, the car appear in other positions. It appear in the street near the save positions.

the command is:
Код:
if(strcmp(cmd, "/estacionar", true) == 0)
  {
	  if(IsPlayerConnected(playerid))
	  {
			new Float:poswx, Float:poswy, Float:poswz;
			new Float:poswa, carx = GetPlayerVehicleID(playerid);
                   GetVehiclePos(carx, poswx, poswy, poswz);
                   GetVehicleZAngle(carx, poswa);
			CarInfo[PlayerInfo[playerid][pIdentificacao]-1][cNovaPos] = 1;
			CarInfo[PlayerInfo[playerid][pIdentificacao]-1][cLocationwx] = poswx;
			CarInfo[PlayerInfo[playerid][pIdentificacao]-1][cLocationwy] = poswy;
			CarInfo[PlayerInfo[playerid][pIdentificacao]-1][cLocationwz] = poswy;
			CarInfo[PlayerInfo[playerid][pIdentificacao]-1][cAnglew] = poswa;
			SaveCars();
			OnCarsUpdate();
			new string6[256];
		}
What Can I do??
Reply
#2

Well, i'm supposing that [pIdentificacao] saves the value of the vehicleid, so it might be equal to carx.

vehicleid's ID starts in 0, not in 1, so you don't need to substract 1 in CarInfo array. It seems you save car nє 2 in CarInfo[1], not in CarInfo[2].

if [pIdentificacao] saves another value, can't help without knowing what means that value.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)