[Ajuda] Gas
#1

Aee pessoal tipo... eu fiz um sistema de gas + n pego... ajudem ae:

pawn Код:
new GasVeh[MAX_VEHICLES];
forward Gas();
forward GasAtualizar();
//OnGameModeInit
    for(new v; v <MAX_VEHICLES; v++)
    {
    GasVeh[v] = 100;
    }
    SetTimer("Gas",10000, 1);
    SetTimer("GasAtualizar",10000, 1);

//Publics

public GasAtualizar()
{
    for(new i; i <MAX_PLAYERS; i++)
    {
/*  for(new v; v <MAX_VEHICLES; v++)
    {*/

        new vehicleid = GetPlayerVehicleID(i);
        if(IsPlayerInVehicle(i,vehicleid))
        {
            if(GasVeh[vehicleid] >= 11)
            {
            new string[256];
            format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~y~Gasolina: %d", GasVeh[vehicleid]);
            GameTextForPlayer(i, string, 9500, 5);
            }
            if(GasVeh[vehicleid] <= 10 && GasVeh[vehicleid] > 0)
            {
            new string[256];
            format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~p~Gasolina esta acabando: %d", GasVeh[vehicleid]);
            GameTextForPlayer(i, string, 9500, 5);
            }
            if(GasVeh[vehicleid] == 0)
            {
            new string[256];
            format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~Gasolina acabou.", GasVeh[vehicleid]);
            GameTextForPlayer(i, string, 9500, 5);
            }
        }
    }
//  }
    return 1;
}

public Gas()
{
    for(new i; i <MAX_PLAYERS; i++)
    {
/*  for(new v; v <MAX_VEHICLES; v++)
    {*/

        new vehicleid = GetPlayerVehicleID(i);
        if(IsPlayerInVehicle(i,vehicleid))
        {
            if(GasVeh[vehicleid] > 0)
            {
            GasVeh[vehicleid] --;
            }
            if(GasVeh[vehicleid] == 0)
            {
//          RemovePlayerFromVehicle(i);
            SendClientMessage(i, COLOR_GRAD2, "A Gasolina do veiculo acabou");
            TogglePlayerControllable(i, false);
            }
        }
    }
//  }
    return 1;
}
ajudem ae... O ERRO Й: O GAS NГO ABAIXA.
Reply
#2

Tenho 70% de certeza que vocк nгo fez esse sistema do 0, somente modificou alguns nomes.


Quanto ao erro... tente ao invйs de GasVeh[vehicleid] --; colocar GasVeh[vehicleid] =- 1;
Reply
#3

eu fiz isso do zero sim. e esse seu treco nгo deu serto. AJUDEM AEE...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)