Kvarenje motora

Započeo Rex, Januar 15, 2023, 01:20:24 PRE PODNE

prethodna tema - sledeća tema

0 članova i 4 gostiju pregledaju ovu temu.

Rex

*

Pitanje/savjet: Kako da odradim kvarenje motora sistem
Opširnije: Ja u mom modu od 0 imam odradjen Engine sistem, e sad zeleo bih da odradim da se nakon sto autu padne health ispod 400 pokvari motor. Ja sam nesto pokusavao ali nisam uspeo zbog neuskladjivanja engine sistema i kvarenja.
Dodatno: Ispod je ceo Engine Sistem da moze da se uskladi sa njime.
[pawn]
   if(newkeys & KEY_FIRE) // Paljenje i gasenje auta na alt
   {
      if(IsPlayerInAnyVehicle(playerid))
      {
          new vehid = GetPlayerVehicleID(playerid);
          if(VehInfo[vehid][vEngine] == 0)
          {
              SetTimer("UpaliAuto", 3000, false);
            TogglePlayerControllable(playerid, 0);
              new str[256], pName[MAX_PLAYER_NAME + 1];
            GetPlayerName(playerid, pName, sizeof(pName));
            format(str, sizeof(str), "*%s okrece kljuc i pokusava da upali motor", pName);
            SendMes(20.0, playerid, RPBOJA, str);
          }
          else
          {
              VehInfo[vehid][vEngine] = 0;
              SetVehicleParamsEx(vehid, 0, VehInfo[vehid][vEngine], VehInfo[vehid][vLights], VehInfo[vehid][vAlarm], VehInfo[vehid][vDoor],VehInfo[vehid][vBonnet],VehInfo[vehid][vObj]);
              new str[256], pName[MAX_PLAYER_NAME + 1];
            GetPlayerName(playerid, pName, sizeof(pName));
            format(str, sizeof(str), "*%s okrece kljuc i gasi motor", pName);
            SendMes(20.0, playerid, RPBOJA, str);
          }
      }
   }
forward UpaliAuto(playerid);
public UpaliAuto(playerid)
{
   new broj;
   broj = random(3);
   if(broj == 1)
   {
       TogglePlayerControllable(playerid, 1);
      new str[256], pName[MAX_PLAYER_NAME + 1];
      GetPlayerName(playerid, pName, sizeof(pName));
      format(str, sizeof(str), "*%s motor se nije upalio", pName);
      SendMes(20.0, playerid, RPBOJA, str);
   }
   else
   {
       new vehid = GetPlayerVehicleID(playerid);
       new str[256], pName[MAX_PLAYER_NAME + 1];
         GetPlayerName(playerid, pName, sizeof(pName));
      format(str, sizeof(str), "*%s motor se upalio", pName);
      SendMes(20.0, playerid, RPBOJA, str);
       TogglePlayerControllable(playerid, 1);
      VehInfo[vehid][vEngine] = 1;
       SetVehicleParamsEx(vehid, 1, VehInfo[vehid][vEngine], VehInfo[vehid][vLights], VehInfo[vehid][vAlarm], VehInfo[vehid][vDoor],VehInfo[vehid][vBonnet],VehInfo[vehid][vObj]);
   }
}
[/pawn]

na principu healtha(ostecenja) vozila
Upwork Skills
Back-end:
• PHP Frameworks (Laravel, Symfony,Codeigniter)
• Python/Django
• Node.js

Front-end:
• HTML
• CSS pre-processing (SASS, LESS)
• Javascript (JQuery, Ajax, Vue, Angular, React, etc.)
• Bootstrap

CMS
• Wordpress (Woocommerce)
• Shopify, Magento

Rex

*

Citat: Grella™ poslato Januar 15, 2023, 01:59:17 PRE PODNE
na principu healtha(ostecenja) vozila
Bio sam uradio ja sve to, ali mi je doslo do buga jer kada de pokvari motor igraca ne freezuje i auto idalje moze da ide, onda sam freezo igraca i ne moze da upali auto.

Citat: Rex poslato Januar 15, 2023, 02:14:45 PRE PODNE
Bio sam uradio ja sve to, ali mi je doslo do buga jer kada de pokvari motor igraca ne freezuje i auto idalje moze da ide, onda sam freezo igraca i ne moze da upali auto.
zasto bi freeze igraca kad mu se pokvari motor od auta? samo ugasis motor sa Get/SetVehicleParamsEx
najjaci skripter

Rex

*

Citat: deksyseksy (mozda emmett?) poslato Januar 15, 2023, 02:24:27 PRE PODNE
zasto bi freeze igraca kad mu se pokvari motor od auta? samo ugasis motor sa Get/SetVehicleParamsEx
Ok probacu sutra pa se javljam

Citat: Rex poslato Januar 15, 2023, 01:20:24 PRE PODNE
Pitanje/savjet: Kako da odradim kvarenje motora sistem
Opširnije: Ja u mom modu od 0 imam odradjen Engine sistem, e sad zeleo bih da odradim da se nakon sto autu padne health ispod 400 pokvari motor. Ja sam nesto pokusavao ali nisam uspeo zbog neuskladjivanja engine sistema i kvarenja.
Dodatno: Ispod je ceo Engine Sistem da moze da se uskladi sa njime.
[pawn]
   if(newkeys & KEY_FIRE) // Paljenje i gasenje auta na alt
   {
      if(IsPlayerInAnyVehicle(playerid))
      {
          new vehid = GetPlayerVehicleID(playerid);
          if(VehInfo[vehid][vEngine] == 0)
          {
              SetTimer("UpaliAuto", 3000, false);
            TogglePlayerControllable(playerid, 0);
              new str[256], pName[MAX_PLAYER_NAME + 1];
            GetPlayerName(playerid, pName, sizeof(pName));
            format(str, sizeof(str), "*%s okrece kljuc i pokusava da upali motor", pName);
            SendMes(20.0, playerid, RPBOJA, str);
          }
          else
          {
              VehInfo[vehid][vEngine] = 0;
              SetVehicleParamsEx(vehid, 0, VehInfo[vehid][vEngine], VehInfo[vehid][vLights], VehInfo[vehid][vAlarm], VehInfo[vehid][vDoor],VehInfo[vehid][vBonnet],VehInfo[vehid][vObj]);
              new str[256], pName[MAX_PLAYER_NAME + 1];
            GetPlayerName(playerid, pName, sizeof(pName));
            format(str, sizeof(str), "*%s okrece kljuc i gasi motor", pName);
            SendMes(20.0, playerid, RPBOJA, str);
          }
      }
   }
forward UpaliAuto(playerid);
public UpaliAuto(playerid)
{
   new broj;
   broj = random(3);
   if(broj == 1)
   {
       TogglePlayerControllable(playerid, 1);
      new str[256], pName[MAX_PLAYER_NAME + 1];
      GetPlayerName(playerid, pName, sizeof(pName));
      format(str, sizeof(str), "*%s motor se nije upalio", pName);
      SendMes(20.0, playerid, RPBOJA, str);
   }
   else
   {
       new vehid = GetPlayerVehicleID(playerid);
       new str[256], pName[MAX_PLAYER_NAME + 1];
         GetPlayerName(playerid, pName, sizeof(pName));
      format(str, sizeof(str), "*%s motor se upalio", pName);
      SendMes(20.0, playerid, RPBOJA, str);
       TogglePlayerControllable(playerid, 1);
      VehInfo[vehid][vEngine] = 1;
       SetVehicleParamsEx(vehid, 1, VehInfo[vehid][vEngine], VehInfo[vehid][vLights], VehInfo[vehid][vAlarm], VehInfo[vehid][vDoor],VehInfo[vehid][vBonnet],VehInfo[vehid][vObj]);
   }
}
[/pawn]
zašto radiš mod od nule ako ćeš već da kopiraš balkanske smeće skripte?

[pawn]foreach(Player,i) // foreach(new i:Player)
{
   if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
   {
      new Float:HP;
      GetVehicleHealth(GetPlayerVehicleID(i), HP);
      if(HP < 400.0)
      {
         new engine, lights, alarm, doors, bonnet, boot, objective, string[80];
         GetVehicleParamsEx(GetPlayerVehicleID(i), engine, lights, alarm, doors, bonnet, boot, objective);
         SetVehicleParamsEx(GetPlayerVehicleID(i), 0, lights, alarm, doors, bonnet, boot, objective);
         SendClientMessage(i,-1,""SIVA"Vas Motor je pokvaren pozovite mehanicara!");
         VehInfo[GetPlayerVehicleID(i)][vEngine] = 0;
      }
   }
}[/pawn]
Upwork Skills
Back-end:
• PHP Frameworks (Laravel, Symfony,Codeigniter)
• Python/Django
• Node.js

Front-end:
• HTML
• CSS pre-processing (SASS, LESS)
• Javascript (JQuery, Ajax, Vue, Angular, React, etc.)
• Bootstrap

CMS
• Wordpress (Woocommerce)
• Shopify, Magento

Citat: Grella™ poslato Januar 15, 2023, 11:20:00 PRE PODNE
[pawn]foreach(Player,i) // foreach(new i:Player)
{
   if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
   {
      new Float:HP;
      GetVehicleHealth(GetPlayerVehicleID(i), HP);
      if(HP < 400.0)
      {
         new engine, lights, alarm, doors, bonnet, boot, objective, string[80];
         GetVehicleParamsEx(GetPlayerVehicleID(i), engine, lights, alarm, doors, bonnet, boot, objective);
         SetVehicleParamsEx(GetPlayerVehicleID(i), 0, lights, alarm, doors, bonnet, boot, objective);
         SendClientMessage(i,-1,""SIVA"Vas Motor je pokvaren pozovite mehanicara!");
         VehInfo[GetPlayerVehicleID(i)][vEngine] = 0;
      }
   }
}[/pawn]
kakav crni foreach debilčino

Rex

*

Citat: Spejs poslato Januar 15, 2023, 08:02:07 PRE PODNE
zašto radiš mod od nule ako ćeš već da kopiraš balkanske smeće skripte?

Engine sistem sam ja pisao, ne znam po cemu je smece.

Rex

*

Citat: Grella™ poslato Januar 15, 2023, 11:20:00 PRE PODNE
[pawn]foreach(Player,i) // foreach(new i:Player)
{
   if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
   {
      new Float:HP;
      GetVehicleHealth(GetPlayerVehicleID(i), HP);
      if(HP < 400.0)
      {
         new engine, lights, alarm, doors, bonnet, boot, objective, string[80];
         GetVehicleParamsEx(GetPlayerVehicleID(i), engine, lights, alarm, doors, bonnet, boot, objective);
         SetVehicleParamsEx(GetPlayerVehicleID(i), 0, lights, alarm, doors, bonnet, boot, objective);
         SendClientMessage(i,-1,""SIVA"Vas Motor je pokvaren pozovite mehanicara!");
         VehInfo[GetPlayerVehicleID(i)][vEngine] = 0;
      }
   }
}[/pawn]

Gde ja da stavim ovaj deo koda?




Iskomplikovao si sistem koji moze imati svega par linija koda   :D

Pali motor i ravno sa kodom u smeće.
You'll be always in my heart, the end and thanks for amazing times. #WeAreLords