[AJUDA]Funзгo Failed
#1

Oi pessoal,
Nгo aguentei mais com sufoco do sistema que eu estou fazendo e vim pedir ajuda seguinte, eu criei um sistema de carros para os players, eles compram, vendem etc... dai fiz o seguinte coloquei para salvar os Tunnings(Modificaзхes) na variavel do carro fazendo o seguinte, vou por exemplo do Nitro:

pawn Код:
AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component5]);
Sendo que nesta variavel б o valor 1010(Nitro 10 Times), jб fiz atй 'debug' para verificar isto e estб, sendo que o nitro nгo й adicionado eu fiz uns testes colocando logo abaixo desse code assim:

pawn Код:
AddVehicleComponent(vehicleid, 1010);
E aconteceu que o Nitro foi adicionado, quebrei a cabeзa ontem o dia todo e nгo descobri a soluзгo e vim aqui pedir ajuda aos mais experientes...

Se alguem puder ajudar, eu agradeзo.
Reply
#2

Poste as variaveis. Components
Reply
#3

Denovo ?

Quote:
Originally Posted by GraziFerreira
Посмотреть сообщение
pawn Код:
AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component5]);
Reply
#4

af As variaveis! nгo somente essaa... Oq eu digo se estou certo й pra ser um 'enum'. poste!
Reply
#5

Ah sim, Enum (:

pawn Код:
enum cInfo
{
    Dono[MAX_PLAYER_NAME],
    Modelo,
    Float:Localx,
    Float:Localy,
    Float:Localz,
    Float:Angulo,
    Cor1,
    Cor2,
    Paintjob,
    VirWorld,
    Interior,
    Component0,
    Component1,
    Component2,
    Component3,
    Component4,
    Component5,
    Component6,
    Component7,
    Component8,
    Component9,
    Component10,
    Component11,
    Component12,
    Component13,
    Alarme,
    Preco,
}
new CarInfo[1200][cInfo];
Reply
#6

Hum... Esta correto nessa parte. Faзa uma confirmaзгo! Verifique se a variavel guarda o Componente! Para sabermos em q parte esta o erro!

pawn Код:
CMD:teste(playerid)
{
    format(string, sizeof(string), "ID: %d Component %d", GetPlayerVehicleID(playerid), CarInfo[vehicleid][Component0]);
    SendClientMessage(playerid, -1, string);
    return 1;
}
Reply
#7

Amigo se vocк leu acima, entгo vocк viu que fiz um "debug" que й exatamente isto que vocк acaba de mostrar, a verificaзгo foi feita mais nгo sei porque nгo й adicionado, o fato й eu carrego os valores do arquivo da conta do carro e jogo pra variavel e entгo uso deste modo para setar os componentes:

pawn Код:
stock SetVehicleModifications(vehicleid)
{
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component0]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component1]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component2]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component3]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component4]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component5]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component6]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component7]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component8]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component9]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component10]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component11]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component12]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component13]);
    printf("Variavel Component 5 Valor: %d",CarInfo[vehicleid][Component5]);
    return 1;
}
No Print aparece o valor 1010, mais se eu colocar assim:

pawn Код:
stock SetVehicleModifications(vehicleid)
{
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component0]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component1]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component2]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component3]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component4]);
    CarInfo[vehicleid][Component5] = 1010;
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component5]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component6]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component7]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component8]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component9]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component10]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component11]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component12]);
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][Component13]);
    printf("Variavel Component 5 Valor: %d",CarInfo[vehicleid][Component5]);
    return 1;
}
Dai funciona, nгo entendi porque o do problema D;
Reply
#8

Alguem? SUAHSUAHSUAHSUHA'
Reply
#9

Entгo ele nгo ta carregando corretamente! pois se vc seta a variavel e funciona entao й problema com o Get da include q vc utiliza q nгo esta salvando na variavel ou vc pode estar usando o Get da sua include de maneira incorreta!
Reply
#10

Avб -.-'

ta errado й ?
pawn Код:
CarInfo[idx][Component5] = DOF2_GetInt(arquivo, "Component5");
Como eu disse, o valor й jogado na variavel eu fiz um debug e verifiquei, mais nгo sei porque nгo й adicionado -.-'
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)