Loop doesn't get run properly
#1

Title.

PHP код:
/* ============================================================================= */
forward RespawnAllCars1();
public 
RespawnAllCars1()
{
    new 
query[256];
    
format(query,sizeof(query),"SELECT * from vehicles");
    
mysql_tquery(connection,query,"RespawnAllCars","");
    return 
1;
}
/* ============================================================================= */
forward RespawnAllCars();
public 
RespawnAllCars()
{
    for(new 
i=0i<cache_get_row_count(); i++)
        {
        new 
vid cache_get_field_content_int(i"id");
        if(
IsVehicleOccupied(vid)) return 1;
        else if(!
strcmp(Vehicle[vid][vOwner], "Nobody")) return 1;
        
ReloadVehicle(vid);
         }
    
SendClientMessageToAll(-1,"{FFC300}Unoccupied vehicles have been respawned.");
    return 
1;
}
/* ============================================================================= */ 
It doesnt do the reloadvehicle, and doesnt send the "Have been respawned".
The vehicle isnt occupied and the owner isnt nobody.
What's the problem here?
Reply


Messages In This Thread
Loop doesn't get run properly - by justjamie - 14.08.2016, 10:07
Re: Loop doesn't get run properly - by Shinja - 14.08.2016, 11:49

Forum Jump:


Users browsing this thread: 1 Guest(s)