Szerző Téma: Irányjelzõ  (Megtekintve 1019 alkalommal)

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Irányjelzõ
« Dátum: 2013. Augusztus 14. - 18:34:19 »
0 Show voters
Hali. Kellene nekem egy olyan irányjelzõ ami nem oldalt van hanem a kocsinak a lámpájába ami világít mindig arra gondolnék és ha én meg nyomom a e q gombot akkor indexel jobbra balra.
Köszönöm a segítséget.

Irányjelzõ
« Válasz #1 Dátum: 2013. Augusztus 14. - 18:38:11 »
0 Show voters
http://sampforum.hu/index.php?topic=20101.0
[mod]
Spoiler for 7 pecsétes titok:
Elõször is, olvasd el a szabályzatot, mert még mindig nem tetted meg. Nem kell odaírni, hogy google. :) Másodszor ez a 7 pecsétes dolog nem vicces. :(
[/mod]
« Utoljára szerkesztve: 2013. Augusztus 15. - 11:52:01 írta Benceee »

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Irányjelzõ
« Válasz #2 Dátum: 2013. Augusztus 14. - 19:28:52 »
0 Show voters
Kösz de nem ez kell ilyen nekem is van tudod van a lámpa és ott villogjon ne mellette mer ez így nem jó

Irányjelzõ
« Válasz #3 Dátum: 2013. Augusztus 14. - 22:12:23 »
0 Show voters
tehát, ha jól értelmezem, akkor olyan, ami a lámpa egyik oldalát villogtatja nem mellette egy sárga cucc villok?

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Irányjelzõ
« Válasz #4 Dátum: 2013. Augusztus 14. - 23:01:03 »
0 Show voters
ja az kell ami a lámpába van annyi elég

Irányjelzõ
« Válasz #5 Dátum: 2013. Augusztus 18. - 14:42:12 »
0 Show voters
#include <a_samp>
#define BLINK_RATE     400
#define PFLASH_RATE     300
#define LIGHT_KEY      KEY_SUBMISSION
#undef MAX_PLAYERS
#define MAX_PLAYERS 50
#define PRESSED(%0) \\
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
new BlinkTime[MAX_PLAYERS];
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(BlinkTime[playerid]);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
lights = encode_lights(1, 1, 1, 1);
SetPVarInt(playerid, \"vMainOn\", 0);
UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
}
else if(newstate == PLAYER_STATE_ONFOOT)
{
KillTimer(BlinkTime[playerid]);
SetPVarInt(playerid, \"CopFlash\", 0);
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(LIGHT_KEY))
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0)
{
   if(GetPVarInt(playerid, \"CopFlash\") == 0)
   {
       new panels, doors, lights, tires;
       new carid = GetPlayerVehicleID(playerid);
      GetVehicleDamageStatus(carid, panels, doors, lights, tires);
      switch(GetPVarInt(playerid, \"vMainOn\"))
      {
          case 0:{
              lights = encode_lights(0, 0, 0, 0);
               SetPVarInt(playerid, \"vMainOn\", 1);
         }
         case 1:{
            lights = encode_lights(1, 1, 1, 1);
            SetPVarInt(playerid, \"vMainOn\", 0);
         }
      }
      UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
   }
}
}
if(PRESSED(KEY_CROUCH))
{
    if(IsPublicService(GetPlayerVehicleID(playerid)) && GetPlayerVehicleSeat(playerid) == 0)
{
   switch(GetPVarInt(playerid, \"CopFlash\"))
   {
      case 0:{
          KillTimer(BlinkTime[playerid]);
         BlinkTime[playerid] = SetTimerEx(\"vBlinker\", PFLASH_RATE, 1, \"i\", playerid);
         SetPVarInt(playerid, \"CopFlash\", 1);
      }
      case 1:{
            KillTimer(BlinkTime[playerid]);
                  new panels, doors, lights, tires;
                  new carid = GetPlayerVehicleID(playerid);
         GetVehicleDamageStatus(carid, panels, doors, lights, tires);
         lights = encode_lights(1, 1, 1, 1);
         UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
         SetPVarInt(playerid, \"CopFlash\", 0);
      }
   }
}
}
if(PRESSED(KEY_LOOK_LEFT))
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
   if(GetPVarInt(playerid, \"vBLeft\") == 0)
   {
      new lights;
      KillTimer(BlinkTime[playerid]);
      BlinkTime[playerid] = SetTimerEx(\"vBlinker\", BLINK_RATE, 1, \"i\", playerid);
              lights = encode_lights(1, 1, 1, 1);
         SetPVarInt(playerid, \"vBLeft\", 1);
            SetPVarInt(playerid, \"vBRight\", 0);
   }else{
       KillTimer(BlinkTime[playerid]);
      new panels, doors, lights, tires;
      new carid = GetPlayerVehicleID(playerid);
      GetVehicleDamageStatus(carid, panels, doors, lights, tires);
       switch(GetPVarInt(playerid, \"vMainOn\")){
           case 0:{
              lights = encode_lights(1, 1, 1, 1);
         }
         case 1:{
                    lights = encode_lights(0, 0, 0, 0);
         }
      }
      UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
                    lights = encode_lights(0, 0, 0, 0);
      SetPVarInt(playerid, \"vBLeft\", 0);
   }
}
}
if(PRESSED(KEY_LOOK_RIGHT))
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
   if(GetPVarInt(playerid, \"vBRight\") == 0)
   {
      new lights;
      KillTimer(BlinkTime[playerid]);
      BlinkTime[playerid] = SetTimerEx(\"vBlinker\", BLINK_RATE, 1, \"i\", playerid);
            SetPVarInt(playerid, \"vBRight\", 1);
              lights = encode_lights(1, 1, 1, 1);
                    lights = encode_lights(0, 0, 0, 0);
         SetPVarInt(playerid, \"vBLeft\", 0);
   }else{
       KillTimer(BlinkTime[playerid]);
      new panels, doors, lights, tires;
      new carid = GetPlayerVehicleID(playerid);
      GetVehicleDamageStatus(carid, panels, doors, lights, tires);
       switch(GetPVarInt(playerid, \"vMainOn\")){
           case 0:{
              lights = encode_lights(1, 1, 1, 1);
         }
         case 1:{
                    lights = encode_lights(0, 0, 0, 0);
         }
      }
      UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
                    lights = encode_lights(0, 0, 0, 0);
      SetPVarInt(playerid, \"vBRight\", 0);
   }
}
}
return 1;
}
forward vBlinker(playerid);
public vBlinker(playerid)
{
if(IsPlayerInAnyVehicle(playerid) && GetPVarInt(playerid, \"CopFlash\") != 1)
{
    new Keys, ud, lr, panels, doors, lights, tires;
    new carid = GetPlayerVehicleID(playerid);
    GetPlayerKeys(playerid, Keys, ud, lr);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
if(lr > 0)
{
   if(GetPVarInt(playerid, \"vBLeft\") == 1)
   {
       KillTimer(BlinkTime[playerid]);
       switch(GetPVarInt(playerid, \"vMainOn\")){
           case 0:{
              lights = encode_lights(1, 1, 1, 1);
         }
         case 1:{
                    lights = encode_lights(0, 0, 0, 0);
         }
      }
      UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
       SetPVarInt(playerid, \"vBLeft\", 0);
       return 1;
   }
}
else if(lr < 0)
{
   if(GetPVarInt(playerid, \"vBRight\") == 1)
   {
       KillTimer(BlinkTime[playerid]);
       switch(GetPVarInt(playerid, \"vMainOn\")){
           case 0:{
              lights = encode_lights(1, 1, 1, 1);
         }
         case 1:{
                    lights = encode_lights(0, 0, 0, 0);
         }
      }
      UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
       SetPVarInt(playerid, \"vBRight\", 0);
       return 1;
   }
}
if(GetPVarInt(playerid, \"vBRight\") == 1)
{
   switch(GetPVarInt(playerid, \"vMainOn\")){
       case 0:{
               switch(GetPVarInt(playerid, \"vBlinkOn\")){
                   case 0:{
                 lights = encode_lights(1, 1, 0, 0);
                     SetPVarInt(playerid, \"vBlinkOn\", 1);
                   }
                   case 1:{
               lights = encode_lights(1, 1, 1, 1);
               SetPVarInt(playerid, \"vBlinkOn\", 0);
                   }
         }
      }
      case 1:{
                  switch(GetPVarInt(playerid, \"vBlinkOn\")){
                   case 0:{
                 lights = encode_lights(0, 0, 1, 1);
                     SetPVarInt(playerid, \"vBlinkOn\", 1);
                   }
                   case 1:{
               lights = encode_lights(0, 0, 0, 0);
               SetPVarInt(playerid, \"vBlinkOn\", 0);
                   }
         }
      }
   }
}
if(GetPVarInt(playerid, \"vBLeft\") == 1)
{
   switch(GetPVarInt(playerid, \"vMainOn\")){
       case 0:{
               switch(GetPVarInt(playerid, \"vBlinkOn\")){
                   case 0:{
                 lights = encode_lights(0, 0, 1, 1);
                     SetPVarInt(playerid, \"vBlinkOn\", 1);
                   }
                   case 1:{
               lights = encode_lights(1, 1, 1, 1);
               SetPVarInt(playerid, \"vBlinkOn\", 0);
                   }
         }
      }
      case 1:{
                  switch(GetPVarInt(playerid, \"vBlinkOn\")){
                   case 0:{
                 lights = encode_lights(1, 1, 0, 0);
                     SetPVarInt(playerid, \"vBlinkOn\", 1);
                   }
                   case 1:{
               lights = encode_lights(0, 0, 0, 0);
               SetPVarInt(playerid, \"vBlinkOn\", 0);
                   }
         }
      }
   }
}
UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
}
else if(GetPVarInt(playerid, \"CopFlash\") == 1)
{
    new d[4];
    new carid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(carid, d[0], d[1], d[2], d[3]);
switch(GetPVarInt(playerid, \"vBlinkOn\"))
{
   case 0:{
      d[2] = encode_lights(1, 1, 0, 0);
      SetPVarInt(playerid, \"vBlinkOn\", 1);
   }
   case 1:{
      d[2] = encode_lights(0, 0, 1, 1);
      SetPVarInt(playerid, \"vBlinkOn\", 0);
   }
}
UpdateVehicleDamageStatus(carid, d[0], d[1], d[2], d[3]);
return 1;
}
return 1;
}
encode_lights(light1, light2, light3, light4) {
return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
}
IsPublicService(carid)
{
    new PS[11] = { 416, 427, 490, 528, 407, 544, 596, 598, 597, 599, 601 };
    for(new i = 0; i < sizeof(PS); i++)
{
if(GetVehicleModel(carid) == PS) return 1;
}
return 0;
}

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Irányjelzõ
« Válasz #6 Dátum: 2013. Augusztus 18. - 18:54:14 »
0 Show voters
Köszi a segítséget és mûködik is ? Mer nem tudom tesztelni nem jó a samp a héten a gépet újra fogom rakni vagy valamikor és akkor lesz jó ha jó lesz egyáltalán

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal