[Pomoc] Gorivo

Započeo Sandek_Biscic, Februar 04, 2011, 15:53:09 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Sandek_Biscic

Zamolio bi jednog da mi kaze kako da sredim gorivo..
imam on sistem TABLA: da mi prikazuje km/h i gorivo
e sad problem je to da km/h radi normalno a gorivo je skros 100 kako da sredim da se gorivo smanji (trosis)
i napuni (punjenje)
molim da mi neko pomaze evo kod  od goriva ;
Zamolio bi jednog da mi sredi.. jer stvarno mucim se vec 1 mjesec da popravim a nikako:s
Hvala!

kod : public CheckGas()
{
new string[256];
foreach (Player, i)
{
        if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
        {
        new vehicle = GetPlayerVehicleID(i);
        if(Gas[vehicle] >= 1)
    {
        if(Gas[vehicle] <= 10)
    {
    PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
    if(gGas[i] == 0) {
    GameTextForPlayer(i,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Rezervoar je skoro prazan",5000,3);
}
    }
        if(gGas[i] == 1) {
        if(IsAPlane(vehicle) || IsABoat(vehicle) || IsABike(vehicle) || IsAHarvest(vehicle) || IsADrugHarvest(vehicle) || IsASweeper(vehicle) || IsADjubretar(vehicle) || IsNpcVehicle(vehicle))
        {
      format(string, sizeof(string), "~b~~n~~n~~n~~n~~n~~n~~n~~n~~n~Gorivo:~w~ N/A");
}
else
{
                format(string, sizeof(string), "~b~~n~~n~~n~~n~~n~~n~~n~~n~~n~Gorivo:~w~ %d%",Gas[vehicle]);
}
      GameTextForPlayer(i,string,20500,3); }
if(IsAPlane(vehicle) || IsNpcVehicle(vehicle) || IsABoat(vehicle) || IsABike(vehicle) || IsAHarvest(vehicle) || IsADrugHarvest(vehicle) || IsASweeper(vehicle) || IsADjubretar(vehicle) || engineOn[vehicle] == 0) { Gas[vehicle]++; }
              Gas[vehicle]--;
    }
    else
            {
              NoFuel[i] = 1;
              TogglePlayerControllable(i, 0);
        GameTextForPlayer(i,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Nema goriva u vozilu",1500,3);
}
    }
}
return 1;
}


kod:
public CheckStatus()
{
foreach (Player, i)
{
if(IsPlayerInAnyVehicle(i))
{
if(TextShow[i] == false)
{
    TextDrawShowForPlayer(i, Text:Black0);
    TextDrawShowForPlayer(i, Text:Black1);
    TextDrawShowForPlayer(i, Text:Black2);
    TextDrawShowForPlayer(i, Text:Black3);
    TextDrawShowForPlayer(i, Text:LightBlack);
    TextShow[i] = true;
}
    new String[128];
        new Float:X, Float:Y, Float:Z, Float:Speed;
        new vehicle = GetPlayerVehicleID(i);
                GetVehicleVelocity(GetPlayerVehicleID(i), X, Y, Z);
                Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)),  floatpower(Z, 2))), 100.0);
format(String,sizeof(String),"~b~ Tabla~n~~r~Gorivo: ~w~%i~n~~r~km/h: ~w~%i", Gas[vehicle], floatround(Speed*2, floatround_floor));
if(VHSCreated[i] == true)
{
TextDrawDestroy(VHS[i]);
}
VHS[i] = TextDrawCreate(541.000000,137.000000,String);
TextDrawAlignment(VHS[i],0);
TextDrawBackgroundColor(VHS[i],0x000000ff);
TextDrawFont(VHS[i],1);
TextDrawLetterSize(VHS[i],0.259999,1.000000);
TextDrawColor(VHS[i],0xffffffff);
TextDrawSetOutline(VHS[i],1);
TextDrawSetProportional(VHS[i],1);
TextDrawSetShadow(VHS[i],1);
            TextDrawShowForPlayer(i, VHS[i]);
            VHSCreated[i] = true;

}
else
{
    if(TextShow[i] == true)
    {
TextDrawHideForPlayer(i, Text:Black0);
TextDrawHideForPlayer(i, Text:Black1);
TextDrawHideForPlayer(i, Text:Black2);
TextDrawHideForPlayer(i, Text:Black3);
TextDrawHideForPlayer(i, Text:LightBlack);
TextDrawHideForPlayer(i, Text:VHS[i]);
    TextShow[i] = false;
}
}
}
}