04.05.2013, 11:37
I have this code for my player vehicle system:
As you can see, I made it print the vehicle ID thats assigned to a vehicle when they spawn one.
I spawn two of my vehicles and it prints "Vehicle ID 1" and will do it if I spawn all of my vehicles, I don't know?
(And it can't be a problem with the vehicle they select since it spawns the right vehicle model, etc)
Thanks
pawn Код:
GameTextForPlayer(playerid, "~g~VEHICLE SPAWNED!", 1500, 4);
if(VehicleInfo[playerid][iVehicle][pv_Plate][0]) { VehicleInfo[playerid][iVehicle][pv_vID] = SetVehicleNumberPlate(CreateVehicle(VehicleInfo[playerid][iVehicle][pv_ModelID], VehicleInfo[playerid][iVehicle][pv_Pos][0], VehicleInfo[playerid][iVehicle][pv_Pos][1], VehicleInfo[playerid][iVehicle][pv_Pos][2], VehicleInfo[playerid][iVehicle][pv_Pos][3], VehicleInfo[playerid][iVehicle][pv_Colours][0], VehicleInfo[playerid][iVehicle][pv_Colours][1], -1), VehicleInfo[playerid][iVehicle][pv_Plate]); }
if(!VehicleInfo[playerid][iVehicle][pv_Plate][0]) { VehicleInfo[playerid][iVehicle][pv_vID] = SetVehicleNumberPlate(CreateVehicle(VehicleInfo[playerid][iVehicle][pv_ModelID], VehicleInfo[playerid][iVehicle][pv_Pos][0], VehicleInfo[playerid][iVehicle][pv_Pos][1], VehicleInfo[playerid][iVehicle][pv_Pos][2], VehicleInfo[playerid][iVehicle][pv_Pos][3], VehicleInfo[playerid][iVehicle][pv_Colours][0], VehicleInfo[playerid][iVehicle][pv_Colours][1], -1), "SFRP"); }
SetVehicleHealth(VehicleInfo[playerid][iVehicle][pv_vID], VehicleInfo[playerid][iVehicle][pv_Health]);
VehicleInfo[playerid][iVehicle][pv_Spawned] = 1;
printf("Vehicle ID %d", VehicleInfo[playerid][iVehicle][pv_vID]);
I spawn two of my vehicles and it prints "Vehicle ID 1" and will do it if I spawn all of my vehicles, I don't know?
(And it can't be a problem with the vehicle they select since it spawns the right vehicle model, etc)
Thanks