This Weird or Fixable?
#1

i just create public timer to respawn the car only car type rentable and witout driver

so

PHP код:
public Cartime()
{
    new 
bool:vehicleused[MAX_VEHICLES];
    foreach (new 
Player)
    {
        if(
IsPlayerConnected(x) && IsPlayerInAnyVehicle(x))
        {
            
vehicleused[GetPlayerVehicleID(x)] = true;
        }
    }
    for(new 
i=1<= MAX_CARi++)
    {
        if(
CarInfo[Carid[i]][cType] == 3)
        {
             if(
CarInfo[Carid[i]][cTime] <= && strcmp(CarInfo[Carid[i]][cOwner], "None"true))
            {
                
strmid(CarInfo[Carid[i]][cOwner], "None"0strlen("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);
            }
        }
    }
    
printf("proceed"); 
everything workfine but it don't send proceed printf

my max_car is 2000
Reply
#2

bumping the fucking problem
Reply
#3

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:
Код:
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"); 
}
And if you want it to print on the loop. just use this one:

Код:
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");  
            }
        }
    }

}
OR if you want it to show max vehicle on printf, just do

Код:
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);  
}
Not tested.
Reply
#4

nooo that that one


I mean why it doen't send proceed message

In my code cuz if it doen't send proceed message so

the next code down there are gonna be no responding code
Reply
#5

i fixed this fuckin problem noww if someone have question how ask me hahaha

This so fuckinn good problemmmmmm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)