Szerző Téma: Seb.váltó rendszer (Segítség)  (Megtekintve 1972 alkalommal)

Seb.váltó rendszer (Segítség)
« Dátum: 2012. július 07. - 09:25:15 »
0 Show voters
Sziasztok :)
Egy olyat szeretnék csinálni,hogy sebváltó...pl.: ha a kocsi sebessége 90km/h egy tex-draw kijön: válts! és elindul egy idõzítõ,melynek dolga:ha 10-mp-n belül nem váltunk,lefullad a motor...
Kérdések: Mivel lehetne lekérdezni a kocsi sebességét?  Hogyan lehetne megoldani,hogy ha eléri a 20km/h-t megakad (nem gyorsul tovább) és csak akkor megy tovább,ha megnyomunk egy gombot...stb...
 Hogyan kellene megcsinálni az idõzítõs cuccot? (hogy lefullad a motor X idõ múlva)
Bónusz: Textdraw-al kiírni,hogy VÁLTS :)   (Erre én is képes vagyok,de ha van kedvetek,megoldhatjátok)
Elkezdtem a scriptet,nagyjából a negyedénél vagyok :D
Azt hiszem ennyi...
Elõre köszi: ReMoTe

Nem elérhető RolePlay

  • 2100
    • Profil megtekintése
Seb.váltó rendszer (Segítség)
« Válasz #1 Dátum: 2012. július 07. - 09:32:29 »
0 Show voters
(( Uhh ember, tudod mióta szeretnék ilyen rendszert RP szeróra :/ De sose készítette el nekem senki :( ))

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Seb.váltó rendszer (Segítség)
« Válasz #2 Dátum: 2012. július 07. - 09:38:26 »
0 Show voters
Lehet meg csinálom.  ;)
Csak kénne a lefulladás kód..

Seb.váltó rendszer (Segítség)
« Válasz #3 Dátum: 2012. július 07. - 09:57:06 »
0 Show voters
ZyZu...elkezdtem,és ennyire jutottam:
 
#include <a_samp>
#define Loop(%0,%1) \\
for(new %0; %0 != %1; %0++) // Macro :)
 
#define GEAR_KEY KEY_FIRE // Váltáshoz használandó gomb
new
timer[MAX_PLAYERS], // Idõzítõ
Text: GearInfo[MAX_PLAYERS], // R N D
Text: Speedo[MAX_PLAYERS], // Sebmérõ
Text: General[5], // Struktúra
Text: Gear[6], //
cGear[MAX_VEHICLES], // current gear
warn[MAX_VEHICLES], // Sebesség magas/alacsony
gul[MAX_VEHICLES] //
;
 
forward ShiftFunction(playerid);
public OnFilterScriptInit()
{
General[0] = TextDrawCreate(554.000000, 414.000000, \"_\");
TextDrawBackgroundColor(General[0], 255);
TextDrawFont(General[0], 1);
TextDrawLetterSize(General[0], 0.500000, 2.599999);
TextDrawColor(General[0], -1);
TextDrawSetOutline(General[0], 0);
TextDrawSetProportional(General[0], 1);
TextDrawSetShadow(General[0], 1);
TextDrawUseBox(General[0], 1);
TextDrawBoxColor(General[0], 70);
TextDrawTextSize(General[0], 628.000000, 0.000000);
General[1] = TextDrawCreate(554.000000, 440.000000, \"_\");
TextDrawBackgroundColor(General[1], 255);
TextDrawFont(General[1], 1);
TextDrawLetterSize(General[1], 0.500000, -0.300000);
TextDrawColor(General[1], -1);
TextDrawSetOutline(General[1], 0);
TextDrawSetProportional(General[1], 1);
TextDrawSetShadow(General[1], 1);
TextDrawUseBox(General[1], 1);
TextDrawBoxColor(General[1], 120);
TextDrawTextSize(General[1], 628.000000, 0.000000);
General[2] = TextDrawCreate(554.000000, 414.000000, \"_\");
TextDrawBackgroundColor(General[2], 255);
TextDrawFont(General[2], 1);
TextDrawLetterSize(General[2], 0.500000, -0.300000);
TextDrawColor(General[2], -1);
TextDrawSetOutline(General[2], 0);
TextDrawSetProportional(General[2], 1);
TextDrawSetShadow(General[2], 1);
TextDrawUseBox(General[2], 1);
TextDrawBoxColor(General[2], 120);
TextDrawTextSize(General[2], 628.000000, 0.000000);
General[3] = TextDrawCreate(631.000000, 414.000000, \"_\");
TextDrawBackgroundColor(General[3], 255);
TextDrawFont(General[3], 1);
TextDrawLetterSize(General[3], 0.500000, 2.599999);
TextDrawColor(General[3], -1);
TextDrawSetOutline(General[3], 0);
TextDrawSetProportional(General[3], 1);
TextDrawSetShadow(General[3], 1);
TextDrawUseBox(General[3], 1);
TextDrawBoxColor(General[3], 120);
TextDrawTextSize(General[3], 629.000000, 0.000000);
General[4] = TextDrawCreate(554.000000, 414.000000, \"_\");
TextDrawBackgroundColor(General[4], 255);
TextDrawFont(General[4], 1);
TextDrawLetterSize(General[4], 0.500000, 2.599999);
TextDrawColor(General[4], -1);
TextDrawSetOutline(General[4], 0);
TextDrawSetProportional(General[4], 1);
TextDrawSetShadow(General[4], 1);
TextDrawUseBox(General[4], 1);
TextDrawBoxColor(General[4], 120);
TextDrawTextSize(General[4], 550.000000, 0.000000);
Gear[0] = TextDrawCreate(558.000000, 430.000000, \"_\");
TextDrawBackgroundColor(Gear[0], 255);
TextDrawFont(Gear[0], 1);
TextDrawLetterSize(Gear[0], 0.500000, 0.399999);
TextDrawColor(Gear[0], -1);
TextDrawSetOutline(Gear[0], 0);
TextDrawSetProportional(Gear[0], 1);
TextDrawSetShadow(Gear[0], 1);
TextDrawUseBox(Gear[0], 1);
TextDrawBoxColor(Gear[0], -1);
TextDrawTextSize(Gear[0], 553.000000, 0.000000);
Gear[1] = TextDrawCreate(562.000000, 427.399993, \"_\");
TextDrawBackgroundColor(Gear[1], 255);
TextDrawFont(Gear[1], 1);
TextDrawLetterSize(Gear[1], 0.549999, 0.699999);
TextDrawColor(Gear[1], -1);
TextDrawSetOutline(Gear[1], 0);
TextDrawSetProportional(Gear[1], 1);
TextDrawSetShadow(Gear[1], 1);
TextDrawUseBox(Gear[1], 1);
TextDrawBoxColor(Gear[1], -151807233);
TextDrawTextSize(Gear[1], 557.000000, 0.000000);
Gear[2] = TextDrawCreate(566.000000, 424.600006, \"_\");
TextDrawBackgroundColor(Gear[2], 255);
TextDrawFont(Gear[2], 1);
TextDrawLetterSize(Gear[2], 0.549999, 1.000000);
TextDrawColor(Gear[2], -1);
TextDrawSetOutline(Gear[2], 0);
TextDrawSetProportional(Gear[2], 1);
TextDrawSetShadow(Gear[2], 1);
TextDrawUseBox(Gear[2], 1);
TextDrawBoxColor(Gear[2], -1823745);
TextDrawTextSize(Gear[2], 561.000000, 0.000000);
Gear[3] = TextDrawCreate(570.000000, 422.000000, \"_\");
TextDrawBackgroundColor(Gear[3], 255);
TextDrawFont(Gear[3], 1);
TextDrawLetterSize(Gear[3], 0.549999, 1.300000);
TextDrawColor(Gear[3], -1);
TextDrawSetOutline(Gear[3], 0);
TextDrawSetProportional(Gear[3], 1);
TextDrawSetShadow(Gear[3], 1);
TextDrawUseBox(Gear[3], 1);
TextDrawBoxColor(Gear[3], -1813566465);
TextDrawTextSize(Gear[3], 565.000000, 0.000000);
Gear[4] = TextDrawCreate(574.000000, 419.299987, \"_\");
TextDrawBackgroundColor(Gear[4], 255);
TextDrawFont(Gear[4], 1);
TextDrawLetterSize(Gear[4], 0.549999, 1.600000);
TextDrawColor(Gear[4], -1);
TextDrawSetOutline(Gear[4], 0);
TextDrawSetProportional(Gear[4], 1);
TextDrawSetShadow(Gear[4], 1);
TextDrawUseBox(Gear[4], 1);
TextDrawBoxColor(Gear[4], -1813566465);
TextDrawTextSize(Gear[4], 569.000000, 0.000000);
Gear[5] = TextDrawCreate(578.000000, 417.299987, \"_\");
TextDrawBackgroundColor(Gear[5], 255);
TextDrawFont(Gear[5], 1);
TextDrawLetterSize(Gear[5], 0.549999, 1.800000);
TextDrawColor(Gear[5], -1);
TextDrawSetOutline(Gear[5], 0);
TextDrawSetProportional(Gear[5], 1);
TextDrawSetShadow(Gear[5], 1);
TextDrawUseBox(Gear[5], 1);
TextDrawBoxColor(Gear[5], -16776961);
TextDrawTextSize(Gear[5], 573.000000, 0.000000);
print(\"\\n--------------------------------------\");
print(\"Sebességváltó rendszer by ReMoTe\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(timer[playerid]);
TextDrawDestroy(GearInfo[playerid]);
TextDrawDestroy(Speedo[playerid]);
return 1;
}
public OnPlayerConnect(playerid)
{
    GearInfo[playerid] = TextDrawCreate(596.000000, 425.000000, \"~w~R ~g~~h~N ~w~D\");
TextDrawBackgroundColor(GearInfo[playerid], 255);
TextDrawFont(GearInfo[playerid], 1);
TextDrawLetterSize(GearInfo[playerid], 0.320000, 1.299999);
TextDrawColor(GearInfo[playerid], -1);
TextDrawSetOutline(GearInfo[playerid], 0);
TextDrawSetProportional(GearInfo[playerid], 1);
TextDrawSetShadow(GearInfo[playerid], 1);
Speedo[playerid] = TextDrawCreate(579.000000, 414.000000, \"255 ~w~km/h\");
TextDrawBackgroundColor(Speedo[playerid], 0x000000FF);
TextDrawFont(Speedo[playerid], 1);
TextDrawLetterSize(Speedo[playerid], 0.170000, 0.799999);
TextDrawColor(Speedo[playerid], 0xA803D0FF);
TextDrawSetOutline(Speedo[playerid], 0);
TextDrawSetProportional(Speedo[playerid], 1);
TextDrawSetShadow(Speedo[playerid], 1);
    timer[playerid] = SetTimerEx(\"ShiftFunction\",150,true,\"i\",playerid);
return 1;
}
stock GetSpeed(playerid)
{
new Float:ST[3];
GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
return floatround(1.61*floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3);
}
public ShiftFunction(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
static
    Float: Speed,
    string[24],
   veh,
   model;
veh = GetPlayerVehicleID(playerid),
model = GetVehicleModel(veh);
if(model == 481 || model == 510 || model == 509) return 1; // Motorok
Loop(x, 5) TextDrawShowForPlayer(playerid, General
  • );

if(!IsVehicleDrivingBackwards(veh))
{
   Speed = GetSpeed(playerid);
   format(string, sizeof(string), \"%0.0f ~w~km/h\", Speed);
   TextDrawSetString(Speedo[playerid], string);
   TextDrawShowForPlayer(playerid, Speedo[playerid]);
   TextDrawShowForPlayer(playerid, GearInfo[playerid]);
   switch(cGear[veh])
   {
      case 6:
      {
         if(Speed > 180)
          {
              Loop(s, 6) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=6;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~6\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
            return 1;
         }
         else if(Speed > 165)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 5) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=5;
            warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~6\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 160)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 4) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=4;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~6\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 155)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 3) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=3;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~6\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 150)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 2) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=2;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~6\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 130)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 1) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=1;
              warn[veh]=0;
                TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~6\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed < 130)
          {
              warn[veh]++;
             if(warn[veh]==20)
             {
               cGear[veh]--;
               warn[veh]=0;
            }
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 1) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=1;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~g~~h~N ~w~6\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
      }
      case 5:
      {
         if(Speed > 150)
          {
              Loop(s, 6) TextDrawShowForPlayer(playerid, Gear);
             warn[veh]++;
             if(warn[veh]==15)
             {
               cGear[veh]++;
               SlowenVehicle(veh, 1.5);
               warn[veh]=0;
            }
            gul[veh]=6;
            TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~5\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 135)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 5) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=5;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~5\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 130)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 4) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=4;
            warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~5\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 125)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 3) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=3;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~5\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 120)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 2) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=2;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~5\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed < 120)
          {
              warn[veh]++;
             if(warn[veh]==20)
             {
               cGear[veh]--;
               warn[veh]=0;
            }
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 1) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=1;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~g~~h~N ~w~5\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
      }
      case 4:
      {
         if(Speed > 120)
          {
              Loop(s, 6) TextDrawShowForPlayer(playerid, Gear);
             warn[veh]++;
             if(warn[veh]==15)
             {
               cGear[veh]++;
               SlowenVehicle(veh, 1.5);
               warn[veh]=0;
            }
            gul[veh]=6;
            TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~4\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 110)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 5) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=5;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~4\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 105)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 4) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=4;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~4\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 100)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 3) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=3;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~4\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 90)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 2) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=2;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~4\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed < 90)
          {
              warn[veh]++;
             if(warn[veh]==20)
             {
               cGear[veh]--;
               warn[veh]=0;
            }
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 1) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=1;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~g~~h~N ~w~4\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
      }
      case 3:
      {
         if(Speed > 90)
          {
              Loop(s, 6) TextDrawShowForPlayer(playerid, Gear);
             warn[veh]++;
             if(warn[veh]==15)
             {
               cGear[veh]++;
               SlowenVehicle(veh, 1.5);
               warn[veh]=0;
            }
            gul[veh]=6;
            TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~3\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 80)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 5) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=5;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~3\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 75)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 4) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=4;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~3\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 70)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 3) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=3;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~3\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 60)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 2) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=2;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~3\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed < 60)
          {
              warn[veh]++;
             if(warn[veh]==20)
             {
               cGear[veh]--;
               warn[veh]=0;
            }
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 1) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=1;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~g~~h~N ~w~3\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
      }
      case 2:
      {
         if(Speed > 60)
          {
              Loop(s, 6) TextDrawShowForPlayer(playerid, Gear);
             warn[veh]++;
             if(warn[veh]==15)
             {
               cGear[veh]++;
               SlowenVehicle(veh, 1.5);
               warn[veh]=0;
            }
            gul[veh]=6;
            TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~2\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 50)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 5) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=5;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~2\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 45)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 4) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=4;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~2\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 40)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 3) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=3;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~2\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 30)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 2) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=2;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~2\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed < 30)
          {
              warn[veh]++;
             if(warn[veh]==20)
             {
               cGear[veh]--;
               warn[veh]=0;
            }
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 1) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=1;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~g~~h~N ~w~2\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
      }
      case 1:
      {
          if(Speed > 30)
          {
              Loop(s, 6) TextDrawShowForPlayer(playerid, Gear);
             warn[veh]++;
             if(warn[veh]==15)
             {
               cGear[veh]++;
               SlowenVehicle(veh, 1.5);
               warn[veh]=0;
            }
            gul[veh]=6;
            TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~1\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 20)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 5) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=5;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~1\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 15)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 4) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=4;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~1\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 10)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 3) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=3;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~1\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 5)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 2) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=2;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~w~N ~g~~h~1\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         else if(Speed > 0)
          {
              Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
              Loop(s, 1) TextDrawShowForPlayer(playerid, Gear);
              gul[veh]=1;
              warn[veh]=0;
              TextDrawSetString(GearInfo[playerid], \"~w~R ~g~~h~N ~w~Állsz\"), TextDrawShowForPlayer(playerid, GearInfo[playerid]);
                    return 1;
         }
         }
   }
}
else
{
    cGear[veh]=1;
   Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
            TextDrawSetString(GearInfo[playerid], \"~g~~h~R ~w~N D\");
            TextDrawSetString(Speedo[playerid], \"- ~w~km/h\");
            TextDrawShowForPlayer(playerid, Speedo[playerid]);
   TextDrawShowForPlayer(playerid, GearInfo[playerid]);
            return 1;
}
}
else
{
Loop(x, 5) TextDrawHideForPlayer(playerid, General
  • );

TextDrawHideForPlayer(playerid, Speedo[playerid]);
TextDrawHideForPlayer(playerid, GearInfo[playerid]);
Loop(s, 6) TextDrawHideForPlayer(playerid, Gear);
}
return 1;
}
 
stock IsVehicleDrivingBackwards(vehicleid) // By Joker
{
static
Float:Float[3]
;
if(GetVehicleVelocity(vehicleid, Float[1], Float[2], Float[0]))
{
GetVehicleZAngle(vehicleid, Float[0]);
if(Float[0] < 90)
{
   if(Float[1] > 0 && Float[2] < 0) return true;
}
else if(Float[0] < 180)
{
   if(Float[1] > 0 && Float[2] > 0) return true;
}
else if(Float[0] < 270)
{
   if(Float[1] < 0 && Float[2] > 0) return true;
}
else if(Float[1] < 0 && Float[2] < 0) return true;
}
return false;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER) cGear[GetPlayerVehicleID(playerid)]=1;
return 1;
}
stock SlowenVehicle(vid,Float:howmuch)
{
    static Float:T[3];
GetVehicleVelocity(vid, T[0], T[1], T[2]);
    return
   SetVehicleVelocity(vid,T[0] / howmuch , T[1] / howmuch , T[2]);
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    new veh = GetPlayerVehicleID(playerid);
if(newkeys & GEAR_KEY)
{
    if(cGear[veh] !=6)
    {
               if(gul[veh] == 4 || gul[veh] == 5)
      {
         cGear[veh]++;
         gul[veh]=1;
         warn[veh]=0;
      }
               else if(gul[veh] == 6 || gul[veh] == 3)
               {
                   cGear[veh]++;
                   warn[veh]=0;
                   gul[veh]=1;
                   SlowenVehicle(veh,1.3);
      }
   }
}
}
return 1;
}

 
Ebbe,már csak a \"lefulladást\" és a \"válts\"-ot kellene eilleszteni :)

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Seb.váltó rendszer (Segítség)
« Válasz #4 Dátum: 2012. július 07. - 10:19:46 »
0 Show voters
Probáld ezt most írtam..
 

#include <a_samp>
forward motor( playerid );
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" ZyZu Jármû sebesség szkript betöltve!\");
print(\"--------------------------------------\\n\");
return 1;
}
stock GetPlayerSpeed(playerid,bool:kmh)
{
  new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
  if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
  rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
  return kmh?floatround(rtn * 90 * 1.61):floatround(rtn * 90);
  GameTextForPlayer(playerid,\"MOTOR FULLAD!\", 3000, 1);
  SendClientMessage(playerid,\"Vigyázz a motor migyárt lefuladd! Nyomd meg a SPACE gombot!\");
  SetTimer(\"motor\", 2000, false);
}
public motor( playerid )
{
new vehicle = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0);
RemovePlayerFromVehicle(playerid);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SPRINT)
{
KillTimer( motor );
}
return 1;
}

 
Beszálsz a kocsiba ha mész gyorsan eléred a 90/km a kocsival akkor ki írja neked GameText -ben nem TextDrawban ki írja a motor fullad! És nyomd meg a space gombot és megöli a timert, és nem fullad le. De ha lefullad leáll és kidobja a kocsibol.. Mikor kiírja nyomg meg a SPACE gombot!
« Utoljára szerkesztve: 2012. július 07. - 10:23:31 írta ZyZu »

dexi

  • Vendég
Seb.váltó rendszer (Segítség)
« Válasz #5 Dátum: 2012. július 07. - 10:37:45 »
0 Show voters
Remote, azt nem te kezdted el.. (Google a barátom)
Zyzu, ha jól látom alapvetõen hibás:
return kmh?floatround(rtn * 90 * 1.61):floatround(rtn * 90);

 
így minden esetben lesz visszatérés.. nem fog eljutni a GameTextForPlayer(..); -ig.

Nem elérhető JBauer

  • 1407
    • Profil megtekintése
Seb.váltó rendszer (Segítség)
« Válasz #6 Dátum: 2012. július 07. - 10:40:28 »
+1 Show voters
megöli a timert[/quote]
Jesszus..

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Seb.váltó rendszer (Segítség)
« Válasz #7 Dátum: 2012. július 07. - 10:50:24 »
0 Show voters
Mi jesszus? KILLTIMER
F0rián gyere skype..

Nem elérhető JBauer

  • 1407
    • Profil megtekintése
Seb.váltó rendszer (Segítség)
« Válasz #8 Dátum: 2012. július 07. - 10:57:23 »
0 Show voters
Hátõõõ.. azt nem így szoktuk mondani.

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Seb.váltó rendszer (Segítség)
« Válasz #9 Dátum: 2012. július 07. - 11:10:06 »
0 Show voters
magyarul úgy jönne ki :D  :laugh:

Seb.váltó rendszer (Segítség)
« Válasz #10 Dátum: 2012. július 07. - 11:18:18 »
0 Show voters
http://sampforum.hu/index.php?topic=27551.0 --> ez kell hozzá
 

#include <a_samp>
#include <setvehiclespeed>
#define function%0(%1)  forward%0(%1);public%0(%1)
new DieTimer[MAX_PLAYERS],
bool:pWarned[MAX_PLAYERS] = false;
public OnFilterScriptInit() SetTimer(\"UpdateSpeed\", 1000, true);
public OnFilterScriptExit() for(new i = 0; i < MAX_PLAYERS; i++) KillTimer(DieTimer);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
if(newkeys == KEY_SPRINT) KillTimer(motor), pWarned[playerid] = false;
return 1;
}
function UpdateSpeed() {
for(new i = 0; i < MAX_PLAYERS; i++) {
if(!IsPlayerConnected(i)) continue;
if(!IsPlayerInAnyVehicle(i)) continue;
if(GetVehicleSpeed(GetPlayerVehicleID(i)) > 90) {
    if(pWarned) continue;
    pWarned = true;
    GameTextForPlayer(playerid,\"MOTOR FULLAD!\", 3000, 1);
           SendClientMessage(playerid,\"Vigyázz a motor migyárt lefuladd! Nyomd meg a SPACE gombot!\");
           DieTimer = SetTimerEx(\"motor\", 3000, false, \"d\", i);
}
}
}
function motor(playerid) {
new vehicle = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0);
SetVehiclespeed(GetPlayervehicleID(playerid), 0);
pWarned[playerid] = false;
return 1;
}

 
Nem teszteltem, de ránézésre jónak néz ki xD

Nem elérhető Casamiro

  • 1046
    • Profil megtekintése
Seb.váltó rendszer (Segítség)
« Válasz #11 Dátum: 2012. július 07. - 16:10:42 »
0 Show voters

Seb.váltó rendszer (Segítség)
« Válasz #12 Dátum: 2012. július 07. - 16:41:22 »
0 Show voters
Idézetet írta: TengeriMalac date=1341652698\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"23905\" data-ipsquote-contentclass=\"forums_Topic
http://sampforum.hu/index.php?topic=27551.0 --> ez kell hozzá
 

#include <a_samp>
#include <setvehiclespeed>
#define function%0(%1)  forward%0(%1);public%0(%1)
new DieTimer[MAX_PLAYERS],
bool:pWarned[MAX_PLAYERS] = false;
public OnFilterScriptInit() SetTimer(\"UpdateSpeed\", 1000, true);
public OnFilterScriptExit() for(new i = 0; i < MAX_PLAYERS; i++) KillTimer(DieTimer);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
if(newkeys == KEY_SPRINT) KillTimer(motor), pWarned[playerid] = false;
return 1;
}
function UpdateSpeed() {
for(new i = 0; i < MAX_PLAYERS; i++) {
if(!IsPlayerConnected(i)) continue;
if(!IsPlayerInAnyVehicle(i)) continue;
if(GetVehicleSpeed(GetPlayerVehicleID(i)) > 90) {
    if(pWarned) continue;
    pWarned = true;
    GameTextForPlayer(playerid,\"MOTOR FULLAD!\", 3000, 1);
           SendClientMessage(playerid,\"Vigyázz a motor migyárt lefuladd! Nyomd meg a SPACE gombot!\");
           DieTimer = SetTimerEx(\"motor\", 3000, false, \"d\", i);
}
}
}
function motor(playerid) {
new vehicle = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0);
SetVehiclespeed(GetPlayervehicleID(playerid), 0);
pWarned[playerid] = false;
return 1;
}

 
Nem teszteltem, de ránézésre jónak néz ki xD
 
Deleted...Szerkesztve
4-error
(13)->error 076: syntax error in the expression, or invalid function call
(23)->error 017: undefined symbol \"playerid\"
(24)->error 017: undefined symbol \"playerid\"
(24)->error 017: undefined symbol \"SetVehiclespeed\"
Pawn compiler 3.2.3664           Copyright © 1997-2006, ITB CompuPhase
4 Errors.
« Utoljára szerkesztve: 2012. július 07. - 16:50:43 írta ReMoTe »

Seb.váltó rendszer (Segítség)
« Válasz #13 Dátum: 2012. július 08. - 11:32:34 »
0 Show voters
#include <a_samp>
#include <setvehiclespeed>
#define function%0(%1)  forward%0(%1);public%0(%1)
#define PRESSED(%0)      (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define RELEASED(%0)   (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
new PlayerText:Valto,
DieTimer[MAX_PLAYERS],
ValtoSebesseg[MAX_PLAYERS],
bool:pWarned[MAX_PLAYERS] = false,
pSpeed[] = { 30, 60, 90, 120, 150, 180 }; //sebességek, amiknél váltani kell.
public OnFilterScriptInit() SetTimer(\"UpdateSpeed\", 200, true);
public OnFilterScriptExit() for(new i = 0; i < MAX_PLAYERS; i++) KillTimer(DieTimer);
public OnPlayerConnect(playerid) {
    Valto = CreatePlayerTextDraw(playerid, 550.000000, 350.000000, \"_\");
PlayerTextDrawBackgroundColor(playerid, Valto, -1);
PlayerTextDrawFont(playerid, Valto, 1);
PlayerTextDrawLetterSize(playerid, Valto, 0.500000, 1.000000);
PlayerTextDrawColor(playerid, Valto, 255);
PlayerTextDrawSetOutline(playerid, Valto, 1);
PlayerTextDrawSetProportional(playerid, Valto, 1);
PlayerTextDrawUseBox(playerid, Valto, 1);
PlayerTextDrawBoxColor(playerid, Valto, 255);
PlayerTextDrawTextSize(playerid, Valto, 640.000000, 0.000000);
PlayerTextDrawHide(playerid, Valto);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate) {
if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawShow(playerid, Valto), ValtoSebesseg[playerid] = 0;
else PlayerTextDrawHide(playerid, Valto);
if(newstate == PLAYER_STATE_DRIVER) {
     new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, lights, alarm, doors, bonnet, boot, objective);
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
if(PRESSED(KEY_YES)) {
KillTimer(DieTimer[playerid]);
pWarned[playerid] = false;
ValtoSebesseg[playerid] += 1;
}
if(RELEASED(KEY_NO)) {
ValtoSebesseg[playerid] -= 1;
}
return 1;
}
function UpdateSpeed() {
    new   string[32];
for(new i = 0; i < MAX_PLAYERS; i++) {
if(!IsPlayerConnected(i)) continue;
if(!IsPlayerInAnyVehicle(i)) continue;
for(new j = 0; j < sizeof(pSpeed); j++) {
   if((GetVehicleSpeed(GetPlayerVehicleID(i)) > pSpeed[j]) && ValtoSebesseg == j) {
       if(pWarned) continue;
       pWarned = true;
      
      format(string, sizeof(string), \"Valto: %d~n~Limit: %d\", ValtoSebesseg, pSpeed[j]);
       PlayerTextDrawSetString(i, Valto, string);
       GameTextForPlayer(playerid, \"~r~Motor Fullad!\", 2000, 6); //kiírja, hogy mi a gond
           DieTimer = SetTimerEx(\"motor\", 3000, false, \"d\", i);
   }
   else if(GetVehicleSpeed(GetPlayerVehicleID(i) < pSpeed[j])) {
       pWarned = false;
       KillTimer(DieTimer);
   }
}
}
}
function motor(playerid) {
new vehicle = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0);
SetVehicleSpeed(GetPlayerVehicleID(playerid), 0);
SetVehicleHealth(GetPlayerVehicleID(playerid), 400.0);
pWarned[playerid] = false;
ValtoSebesseg[playerid] = 0;
return 1;
}

 
Kijavítva, TextDrawval, de fogalmam nincs miért, nem tudok vele váltani.. Nincs türelmem megcsinálni >.>
« Utoljára szerkesztve: 2012. július 09. - 09:41:11 írta TengeriMalac »

Seb.váltó rendszer (Segítség)
« Válasz #14 Dátum: 2012. július 09. - 08:38:46 »
0 Show voters
És itt,hol lehet megadni hogy mekkora seb-nél kelljen váltani??
+ itt nincs figyelmeztetés,hogy a motor fullad válts pedig az kéne :)
Azért köszi...ezeket ha tudod akkor mond meg ... :D

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal