07.12.2014, 02:11
So you want it to printf proceed every time car loads or you just want to printf when ever the Cartime is called?
Here's how you do it if you want it to print when ever Cartime is called:
And if you want it to print on the loop. just use this one:
OR if you want it to show max vehicle on printf, just do
Not tested.
Here's how you do it if you want it to print when ever Cartime is called:
Код:
public Cartime()
{
new bool:vehicleused[MAX_VEHICLES];
foreach (new x : Player)
{
if(IsPlayerConnected(x) && IsPlayerInAnyVehicle(x))
{
vehicleused[GetPlayerVehicleID(x)] = true;
}
}
for(new i=1; i <= MAX_CAR; i++)
{
if(CarInfo[Carid[i]][cType] == 3)
{
if(CarInfo[Carid[i]][cTime] <= 1 && strcmp(CarInfo[Carid[i]][cOwner], "None", true))
{
strmid(CarInfo[Carid[i]][cOwner], "None", 0, strlen("None"), 255);
SetVehicleToRespawn(Carid[i]);
CarInfo[Carid[i]][cTime] = 0;
}
if(CarInfo[Carid[i]][cTime] > 0)
{
CarInfo[Carid[i]][cTime] --;
}
if(!vehicleused[i] && !strcmp(CarInfo[Carid[i]][cOwner], "None", true))
{
SetVehicleToRespawn(i);
}
}
}
print("proceed");
}
Код:
public Cartime()
{
new bool:vehicleused[MAX_VEHICLES];
foreach (new x : Player)
{
if(IsPlayerConnected(x) && IsPlayerInAnyVehicle(x))
{
vehicleused[GetPlayerVehicleID(x)] = true;
}
}
for(new i=1; i <= MAX_CAR; i++)
{
if(CarInfo[Carid[i]][cType] == 3)
{
if(CarInfo[Carid[i]][cTime] <= 1 && strcmp(CarInfo[Carid[i]][cOwner], "None", true))
{
strmid(CarInfo[Carid[i]][cOwner], "None", 0, strlen("None"), 255);
SetVehicleToRespawn(Carid[i]);
CarInfo[Carid[i]][cTime] = 0;
}
if(CarInfo[Carid[i]][cTime] > 0)
{
CarInfo[Carid[i]][cTime] --;
}
if(!vehicleused[i] && !strcmp(CarInfo[Carid[i]][cOwner], "None", true))
{
SetVehicleToRespawn(i);
print("proceed");
}
}
}
}
Код:
public Cartime()
{
new bool:vehicleused[MAX_VEHICLES];
new VehicleSpawnedCount;
foreach (new x : Player)
{
if(IsPlayerConnected(x) && IsPlayerInAnyVehicle(x))
{
vehicleused[GetPlayerVehicleID(x)] = true;
}
}
for(new i=1; i <= MAX_CAR; i++)
{
if(CarInfo[Carid[i]][cType] == 3)
{
if(CarInfo[Carid[i]][cTime] <= 1 && strcmp(CarInfo[Carid[i]][cOwner], "None", true))
{
strmid(CarInfo[Carid[i]][cOwner], "None", 0, strlen("None"), 255);
SetVehicleToRespawn(Carid[i]);
CarInfo[Carid[i]][cTime] = 0;
}
if(CarInfo[Carid[i]][cTime] > 0)
{
CarInfo[Carid[i]][cTime] --;
}
if(!vehicleused[i] && !strcmp(CarInfo[Carid[i]][cOwner], "None", true))
{
SetVehicleToRespawn(i);
VehicleSpawnedCount++;
}
}
}
printf("max vehicle respawned: %d", VehicleSpawnedCount);
}

