[Ajuda]Ajuda com Velocнmetro (Rapidinho)
#7

Se Ocorrer tudo certinho , atй posto aqui no forum para vocкs desfrutarem!!
Achei esse aqui:
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new str[128];
    format(str, sizeof(str), "* Este carro esta com %d Litros de gasolina", Gasosa[vehicleid]);
    SendClientMessage(playerid,0xFFFF00AA, str);
    return 1;

}
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInAnyVehicle(playerid)) {
        new string[50],carid = GetPlayerVehicleID(playerid);
        GetVehicleVelocity(carid, velokm[0], velokm[1], velokm[2]);
        format(string, sizeof(string), "~w~Gasolina: ~r~%i", Gasosa[carid]);
        GameTextForPlayer(playerid,string,300,1);
        if(floatround(((floatsqroot(((velokm[0] * velokm[0]) + (velokm[1] * velokm[1]) + (velokm[2] * velokm[2]))) * (170.0))) * 1) > 5) {
            if(Gasosa[carid] == 0 && Avisado[playerid] == false) {
                SendClientMessage(playerid,0xFFFF00AA,"A Gasolina Deste carro acabou | Chame o Guincho ou /gasolina");
                TogglePlayerControllable(playerid, false);
                Avisado[playerid] = true;
            }
            if(Gasosa[carid] > 0) {
                Retirada[playerid]+=1;
                if(Retirada[playerid] >= (RETIRAR_KM*13)) {
                    Gasosa[carid]--;
                    Retirada[playerid]=0;
                    Avisado[playerid] = false;
                }
            }
        }
    }
    return 1;    
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)