Quote:
Originally Posted by CesarLT
I am not sure, but try that?
pawn Код:
if(VehicleEnum[playerid][playervehicleid][veh_id] == INVALID_PLAYER_VEHICLE_ID);
|
not working this is the complete function:
Код:
stock CreatePlayerVehicle(playerid, playervehicleid, modelid, Float: x, Float: y, Float: z, Float: angle, color1, color2, price)
{
if(VehicleEnum[playerid][playervehicleid][veh_id] == INVALID_PLAYER_VEHICLE_ID)
{
PlayerCars++;
carsforplayer[playerid]++;
PlayerVehicleInfo[playerid][playervehicleid][veh_model] = modelid;
PlayerVehicleInfo[playerid][playervehicleid][veh_x] = x;
PlayerVehicleInfo[playerid][playervehicleid][veh_y] = y;
PlayerVehicleInfo[playerid][playervehicleid][veh_z] = z;
PlayerVehicleInfo[playerid][playervehicleid][veh_rot] = angle;
PlayerVehicleInfo[playerid][playervehicleid][veh_world] = GetPlayerVirtualWorld(playerid);
PlayerVehicleInfo[playerid][playervehicleid][veh_colors[1]] = color1;
PlayerVehicleInfo[playerid][playervehicleid][veh_colors[2]] = color2;
PlayerVehicleInfo[playerid][playervehicleid][veh_price] = price;
PlayerVehicleInfo[playerid][playervehicleid][veh_locked] = 0;
PlayerVehicleInfo[playerid][playervehicleid][veh_impounded] = 0;
for(new m = 0; m < MAX_MODS; m++)
{
PlayerVehicleInfo[playerid][playervehicleid][veh_comp][m] = 0;
}
new carcreated = CreateVehicle(modelid,x,y,z,angle,color1,color2,-1);
PlayerVehicleInfo[playerid][playervehicleid][veh_id] = carcreated;
SetVehicleVirtualWorld(carcreated, PlayerVehicleInfo[playerid][playervehicleid][pvVW]);
//SetVehicleNumberPlate(carcreated, PlayerVehicleInfo[playerid][playervehicleid][pvNumberPlate]);
return carcreated;
}
return INVALID_PLAYER_VEHICLE_ID;
}
VehicleEnum:
Код:
enum VEnum
{
veh_id,
veh_plate[MAX_PLATE_LENGTH+1],
veh_owner[MAX_PLAYER_NAME],
veh_model,
veh_owned,
veh_price,
Float:veh_x,
Float:veh_y,
Float:veh_z,
Float:veh_rot,
veh_comp[18],
veh_colors[3],
veh_paintjob,
veh_locked,
veh_slot,
veh_int,
veh_world,
veh_neon,
veh_impounded,
veh_impoundprice,
veh_haslock,
veh_registerdate[7],
veh_trunkgun1,
veh_trunkgun2,
veh_trunkgun3,
veh_trunkgun4,
Float:veh_trunkarmor,
veh_trunkcocaine,
veh_trunkweed,
veh_trunkmeth,
veh_trunkheroin,
veh_trunkmats,
veh_trunkcash,
veh_plateset
};