[pomoc]speedo

Započeo Aldin Begovic, Novembar 20, 2011, 22:11:51 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:BN edit
Problem:speedo nece da se prikaze a sve sam prebacio iz afrika moda u svoj sve erore rijesio i waringe ali nece prikaze ! Takodje tako nece ni stats samo zaledi lika al nece izbaci stats ! Isto je i stats iz afrike ! ako neko moze pomoc neka pomogne ! hvala ipak
Dio skripte

public SpeedoMeterUp()
{
    new
      Float:PPosX,
      Float:PPosY,
      Float:PPosZ,
      Float:PlayerSpeedDistance,
      value,
      Float:VehHealth,
      vHealth[17],
      sOutput[4],
      vID;

   foreach(Player, i)
   {
      if(IsPlayerInAnyVehicle(i))
      {
         GetPlayerPos(i, PPosX, PPosY, PPosZ);
         vID = GetPlayerVehicleID(i);
         GetVehicleHealth(vID, VehHealth);
         PlayerSpeedDistance = floatsqroot(floatpower(floatabs(floatsub(PPosX, ReadPlayerPosition[ReadX])), 2) + floatpower(floatabs(floatsub(PPosY, ReadPlayerPosition[ReadY])), 2) + floatpower(floatabs(floatsub(PPosZ, ReadPlayerPosition[ReadZ])), 2));
         value = floatround(PlayerSpeedDistance * 5000);

         if(SpeedoMeter == 0)
         {
             for(new td; td < 8; td++)
             {
                 TextDrawShowForPlayer(i, TDSpeedo
);
            }

            TextDrawShowForPlayer(i, TDPSpeedo[1]);
            TextDrawShowForPlayer(i, TDPSpeedo[2]);

             if(!IsABicycle(vID))
            {
                TextDrawShowForPlayer(i, TDPSpeedo
  • );

                   format(vHealth, sizeof(vHealth), "%.2f L", vFuel[vID]);
                    TextDrawSetString(TDPSpeedo
    • , vHealth);
                  }
                      SpeedoMeter = 1;
               }
               new
                  KPH = floatround(value/1000);

               if(VehHealth > 700) vHealth = "~g~O~n~~w~O~n~O";
               else if(VehHealth > 400) vHealth = "O~n~~y~O~n~~w~O";
                  else if(VehHealth < 400) vHealth = "O~n~O~n~~r~O";

               TextDrawSetString(TDPSpeedo[2], vHealth);

               format(sOutput, sizeof(sOutput), "%i", KPH);
               TextDrawSetString(TDPSpeedo[1], sOutput);
            }

            ReadPlayerPosition[ReadX] = PPosX;
            ReadPlayerPosition[ReadY] = PPosY;
            ReadPlayerPosition[ReadZ] = PPosZ;

            if(!IsPlayerInAnyVehicle(i))
            {
               for(new td; td < 8; td++)
               {
                  TextDrawHideForPlayer(i, TDSpeedo
      );
               }

               TextDrawHideForPlayer(i, TDPSpeedo[1]);
               TextDrawHideForPlayer(i, TDPSpeedo[2]);
               SpeedoMeter = 0;

               if(!IsABicycle(vID)) TextDrawHideForPlayer(i, TDPSpeedo
      • );
              }
           }
           return 1;
        }

        public FuelDown()
        {
           new
               strFuel[8],
               vID;

            foreach(Player, i)
           {
              vID = GetPlayerVehicleID(i);

              if(IsPlayerInAnyVehicle(i) && !IsABicycle(vID))
              {
                    if(SpeedoMeter == 1)
                 {
                     if(IsACar(vID)) vFuel[vID] -= 0.25;
                     else if(IsABike(vID)) vFuel[vID] -= 0.1;
                     else vFuel[vID] -= 0.25;

                        new
                       engine, lights, alarm, doors,
                       bonnet, boot, objective;

                        if(vFuel[vID] == 0)
                        {
                            GetVehicleParamsEx(vID, engine, lights, alarm, doors, bonnet, boot, objective);
                       SetVehicleParamsEx(vID, 0, lights, alarm, doors, bonnet, boot, objective);
                        }
                        else
                        {
                       format(strFuel, sizeof(strFuel), "%.2f L", vFuel[vID]);
                       TextDrawSetString(TDPSpeedo
        • , strFuel);
                      }
                   }
                }
                else
                {
                   TextDrawHideForPlayer(i, TDPSpeedo
          • );
                  }
               }
               return 1;
            }

dragan12

Timer SpeedoMeterUp nisi prebacio.

jojj ne kontam ! jel treba tu da vam dam il nisam prebacio iz onog moda u svoj ??? Imas li jos podataka kakvi nisam razumio !?

dragan12

Citat: Aldin Begovic poslato Novembar 20, 2011, 22:32:50 POSLE PODNE
jojj ne kontam ! jel treba tu da vam dam il nisam prebacio iz onog moda u svoj ??? Imas li jos podataka kakvi nisam razumio !?
Iz tog moda nisi prebacio u svoj nesto ovako ima pod OnGameModeInit
SetTimer("SpeedoMeterUp"....

aa imam ja to sam sto sam aj to stavio ispod texdrawa tog sto sam ubacio !

dragan12

Citat: Aldin Begovic poslato Novembar 20, 2011, 22:39:14 POSLE PODNE
aa imam ja to sam sto sam aj to stavio ispod texdrawa tog sto sam ubacio !
Gde si to stavio. To stavi pod public OnGameModeInit.

stavio sam ga ispod textdraw tj gamemodeinit
   for(i=0; i<MAX_PLAYERS; i++)
   {
      Spectating
  • =-1;
       }
        SetTimer("WeaponTimer", 500, 1);
        SetTimer("BaseBallTimer", 500, 1);
          SetTimer("SpeedoMeterUp", 500, 1);
       SetTimer("FuelDown", 15 * 1000, 1);
       

    Evooo radi sad ! Al nep pokazuje brzinu ! sam Background ! hmm


    RIJESENO MOZE LOCK :d
    public SpeedoMeterUp()
    {
        new
          Float:PPosX,
          Float:PPosY,
          Float:PPosZ,
          Float:PlayerSpeedDistance,
          value,
          Float:VehHealth,
          vHealth[17],
          sOutput[4],
          vID;

       foreach(Player, i)
       {
          if(IsPlayerInAnyVehicle(i))
          {
             GetPlayerPos(i, PPosX, PPosY, PPosZ);
             vID = GetPlayerVehicleID(i);
             GetVehicleHealth(vID, VehHealth);
             PlayerSpeedDistance = floatsqroot(floatpower(floatabs(floatsub(PPosX, ReadPlayerPosition[ReadX])), 2) + floatpower(floatabs(floatsub(PPosY, ReadPlayerPosition[ReadY])), 2) + floatpower(floatabs(floatsub(PPosZ, ReadPlayerPosition[ReadZ])), 2));
             value = floatround(PlayerSpeedDistance * 5000);

             if(SpeedoMeter == 0)
             {
                 for(new td; td < 8; td++)
                 {
                     TextDrawShowForPlayer(i, TDSpeedo
    );
                }

                TextDrawShowForPlayer(i, TDPSpeedo[1]);
                TextDrawShowForPlayer(i, TDPSpeedo[2]);

                 if(!IsABicycle(vID))
                {
                    TextDrawShowForPlayer(i, TDPSpeedo
    • );

                     format(vHealth, sizeof(vHealth), "%.2f L", vFuel[vID]);
                      TextDrawSetString(TDPSpeedo
      • , vHealth);
                    }
                        SpeedoMeter = 1;
                 }
                 new
                    KPH = floatround(value/1000);

                 if(VehHealth > 700) vHealth = "~g~O~n~~w~O~n~O";
                 else if(VehHealth > 400) vHealth = "O~n~~y~O~n~~w~O";
                    else if(VehHealth < 400) vHealth = "O~n~O~n~~r~O";

                 TextDrawSetString(TDPSpeedo[2], vHealth);

                 format(sOutput, sizeof(sOutput), "%i", KPH);
                 TextDrawSetString(TDPSpeedo[1], sOutput);
              }

              ReadPlayerPosition[ReadX] = PPosX;
              ReadPlayerPosition[ReadY] = PPosY;
              ReadPlayerPosition[ReadZ] = PPosZ;

              if(!IsPlayerInAnyVehicle(i))
              {
                 for(new td; td < 8; td++)
                 {
                    TextDrawHideForPlayer(i, TDSpeedo
        );
                 }

                 TextDrawHideForPlayer(i, TDPSpeedo[1]);
                 TextDrawHideForPlayer(i, TDPSpeedo[2]);
                 SpeedoMeter = 0;

                 if(!IsABicycle(vID)) TextDrawHideForPlayer(i, TDPSpeedo
        • );
                }
             }
             return 1;
          }




           
Poslednja Izmena: Novembar 23, 2011, 03:13:29 PRE PODNE od Aldin Begovic