Код:
public DespawnOwnedCar(playerid)
{
DynamicCars[PlayerCarID[playerid]][CarType] = 3;
GetVehiclePos(PlayerCarID[playerid], pStats[playerid][pCarX], pStats[playerid][pCarY], pStats[playerid][pCarZ]);
new car = PlayerCarID[playerid] - 1;
printf("[DEBUG] Vehice Pos Saved");
printf("[DEBUG] Vehicle %d (owned by %s) has/is being de-spawned.", PlayerCarID[playerid], GetPlayerNameEx(playerid));
DestroyVehicle(PlayerCarID[playerid]);
printf("[DEBUG] Vehice Destroyed");
CreateVehicle(572, 2554.1904, -2536.1890, 12.8843, DynamicCars[car][CarAngle], 4, 4, -1);
printf("[DEBUG] Vehice Created");
PlayerCarID[playerid] = 0;
return 0;
}
Код:
public GenerateOwnedCar(playerid)
{
new sum = 200;
sum += random(200);
if(DynamicCars[sum][CarType] == 3)
{
new car = sum - 1;
PlayerCarID[playerid] = sum;
DestroyVehicle(sum);
printf("[DEBUG] Vehicle %d (owned by %s) has been destroyed.", sum, GetPlayerNameEx(playerid));
CreateVehicle(pStats[playerid][pCarModel], pStats[playerid][pCarX], pStats[playerid][pCarY], pStats[playerid][pCarZ], DynamicCars[car][CarAngle],pStats[playerid][pCarColor1],pStats[playerid][pCarColor2], -1);
printf("[DEBUG] Vehicle %d (owned by %s) has been created", sum, GetPlayerNameEx(playerid));
DynamicCars[sum][CarType] = 4;
printf("[DEBUG] Vehicle %d (owned by %s) car type set to 4t", sum, GetPlayerNameEx(playerid));
printf("[DEBUG] Vehicle %d (owned by %s) has been spawned.", sum, GetPlayerNameEx(playerid));
ChangeVehicleColor(PlayerCarID[playerid], pStats[playerid][pCarColor1], pStats[playerid][pCarColor2]);
}
else
{
sum = 200;
sum += random(200);
if(DynamicCars[sum][CarType] == 3)
{
new car = sum - 1;
PlayerCarID[playerid] = sum;
DestroyVehicle(sum);
printf("[DEBUG] Vehicle %d (owned by %s) has been destroyed.", sum, GetPlayerNameEx(playerid));
CreateVehicle(pStats[playerid][pCarModel], pStats[playerid][pCarX], pStats[playerid][pCarY], pStats[playerid][pCarZ], DynamicCars[car][CarAngle],pStats[playerid][pCarColor1],pStats[playerid][pCarColor2], -1);
printf("[DEBUG] Vehicle %d (owned by %s) has been created", sum, GetPlayerNameEx(playerid));
DynamicCars[sum][CarType] = 4;
printf("[DEBUG] Vehicle %d (owned by %s) car type set to 4", sum, GetPlayerNameEx(playerid));
printf("[DEBUG] Vehicle %d (owned by %s) has been spawned.", sum, GetPlayerNameEx(playerid));
ChangeVehicleColor(PlayerCarID[playerid], pStats[playerid][pCarColor1], pStats[playerid][pCarColor2]);
}
}
if(pStats[playerid][pCarNos] != 0)
{
new carmodel = GetVehicleModel(PlayerCarID[playerid]);
for (new i=0; i<sizeof(UnmodifiableVehicles); i++)
{
if (carmodel != UnmodifiableVehicles[i])
{
AddVehicleComponent(PlayerCarID[playerid], 1010);
}
}
}
return 0;
}
Got this from the log
Код:
[00:02:52] [DEBUG] Vehice Pos Saved
[00:02:52] [DEBUG] Vehicle 0 (owned by name here) has/is being de-spawned.
[00:02:52] [DEBUG] Vehice Destroyed