Isn't this logic?
#1

I have this enum
vInfo aka VehicleInfo[MAX_PLAYERS]

I load the vehicles by this public using a loop.

PHP код:
public OnVehiclesAvailable()
{
    new 
rows;
    
cache_get_row_count(rows);
    for(new 
irowsi++)
    {
        
cache_get_value_int(i"ID"VehicleInfo[i][ID]);
        
cache_get_value(i"Owner"VehicleInfo[i][vOwner], 24);
        
cache_get_value_int(i"vModel"VehicleInfo[i][vModel]);
        
cache_get_value_float(i"Pos_x"VehicleInfo[i][vPos_x]);
        
cache_get_value_float(i"Pos_y"VehicleInfo[i][vPos_y]);
        
cache_get_value_float(i"Pos_z"VehicleInfo[i][vPos_z]);
        
cache_get_value_float(i"Rot"VehicleInfo[i][vRot]);
        
cache_get_value_int(i"Fuel"VehicleInfo[i][vFuel]);
        
cache_get_value_int(i"Type"VehicleInfo[i][vType]);
        
cache_get_value(i"Plate"VehicleInfo[i][vPlate], 120);
        
cache_get_value_int(i"vLock"VehicleInfo[i][vLock]);
        
cache_get_value_int(i"Color1"VehicleInfo[i][vColor1]);
        
cache_get_value_int(i"Color2"VehicleInfo[i][vColor2]);
        
cache_get_value_int(i"RespawnDelay"VehicleInfo[i][vRespawnDelay]);
        
cache_get_value_int(i"Price"VehicleInfo[i][vPrice]);
        
//VehicleInfo[i][Vehicle_Cache] = cache_save();
        
pvehicle[i] = CreateVehicle(VehicleInfo[i][vModel], VehicleInfo[i][vPos_x], VehicleInfo[i][vPos_y], VehicleInfo[i][vPos_z], VehicleInfo[i][vRot], VehicleInfo[i][vColor1], VehicleInfo[i][vColor2], VehicleInfo[i][vRespawnDelay]);
        
SetVehicleNumberPlate(pvehicle[i], VehicleInfo[i][vPlate]);
    }
    return 
1;

From that I understand that the loop will run until it loops trough all the cars in the database, example 3 at the moment.
Each car will be assigned to a vehicle info in this way
VehicleInfo[1]...
VehicleInfo[2]...
VehicleInfo[3]...
and stop because thats all the vehicles.

Isn't it normal to get the data from that enum when I call it? Example this command:
PHP код:
CMD:testcar(playeridparams[])
{
    new 
string[200];
    for(new 
iMAX_PVEHICLESi++)
    
format(stringsizeof(string), "Vehicle ID: %d | Vehicle Type: %d, Plate: %s | Owner: %s"VehicleInfo[i][ID], VehicleInfo[i][vType], VehicleInfo[i][vPlate], VehicleInfo[i][vOwner] );
    
SCM(playeridCOLOR_YELLOWstring);
    return 
1;

This loop will run until it reaches 200, max pvehicles.
And it starts
VehicleInfo[1]...
VehicleInfo[2]...
VehicleInfo[3]...

But if I use the command, I get 0 on vehicle ID, vtype etc
Shouldn't this command take the information that was stored in the enum and use it in that format..?
This is my logic..
Reply


Messages In This Thread
Isn't this logic? - by AndreiWow - 06.02.2017, 17:31
Re: Isn't this logic? - by Logic_ - 06.02.2017, 17:34
Re: Isn't this logic? - by AndreiWow - 06.02.2017, 17:39
Re: Isn't this logic? - by Logic_ - 06.02.2017, 17:42
Re: Isn't this logic? - by AndreiWow - 06.02.2017, 17:47
Re: Isn't this logic? - by Logic_ - 06.02.2017, 17:51
Re: Isn't this logic? - by AndreiWow - 06.02.2017, 17:54
Re: Isn't this logic? - by JesterlJoker - 06.02.2017, 19:56
Re: Isn't this logic? - by AndreiWow - 06.02.2017, 20:21
Re: Isn't this logic? - by princejeet1510 - 07.02.2017, 06:09

Forum Jump:


Users browsing this thread: 2 Guest(s)