View Single Post
Old 21/11/2018, 12:13 AM   #23
RiqueP
Gangsta
 
RiqueP's Avatar
 
Join Date: Jan 2014
Location: 01010011 01010000
Posts: 875
Reputation: 66
Default Re: error 001: expected token: ",", but found "["

Agora entendi, só um minuto.

@EDIT
Ainda estou meio confuso, então acabei fazendo algumas opções.

Pegar o ID dos components.
PHP Code:
new components[13], current;
new 
model GetVehicleModel(GetPlayerVehicleID(playerid));

for(new 
0MAX_COMPONENTS; ++i) {
    for(new 
0211; ++x) {
        if(
AllComponents[i][vehUsing][x] == model) {
            
components[current] = AllComponents[i][cID];
            ++
current;
        }
    }
}

printf("%d"components[0]); 
Pegar o nome dos components.
PHP Code:
new components[13][30], current;
new 
model GetVehicleModel(GetPlayerVehicleID(playerid));

for(new 
0MAX_COMPONENTS; ++i) {
    for(new 
0211; ++x) {
        if(
AllComponents[i][vehUsing][x] == model) {
            
format(components[current], 30AllComponents[i][cName]);
            ++
current;
        }
    }
}

printf("%s"components[0]); 
Pegar o ID de um componente especificando ID do veículo e o tipo do componente.
PHP Code:
stock GetComponentID(modeltype) {
    new 
component;

    for(new 
0MAX_COMPONENTS; ++i) {
        if(
component) break;

        if(
AllComponents[i][cType] == type) {
            for(new 
0211; ++x) {
                if(
AllComponents[i][vehUsing][x] == model) {
                    
component AllComponents[i][cID];
                    break;
                }
            }
        }
    }
    return 
component;

RiqueP is offline   Reply With Quote