Szerző Téma: Elakadásjelzõ  (Megtekintve 652 alkalommal)

Nem elérhető Cappsy

  • Adminisztrátor
  • 2754
    • Profil megtekintése
Elakadásjelzõ
« Dátum: 2012. május 20. - 22:25:55 »
0 Show voters
Hali :D
Kérnék egy elakadásjelzõ ami olyan hogy pl: /elakadva és villog az index mind a 2 helyen :D
Indexscript:
 
#include <a_samp>
enum index2
{
obj1,
obj2,
bool:indexing
}
#define VEHICLE_NONE 0
#define VEHICLE_CAR 1
#define VEHICLE_BOAT 2
#define VEHICLE_TRAIN 3
#define VEHICLE_HELI 4
#define VEHICLE_PLANE 5
#define VEHICLE_BIKE 6
#define VEHICLE_MONSTERTRUCK 7
#define VEHICLE_QUADBIKE 8
#define VEHICLE_BMX 9
#define VEHICLE_TRAILER 10
new gs_vehicleTypes [] = {
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_MONSTERTRUCK,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_BOAT,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_TRAILER, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_MONSTERTRUCK, VEHICLE_CAR,
    VEHICLE_BOAT, VEHICLE_HELI, VEHICLE_BIKE, VEHICLE_TRAIN, VEHICLE_TRAILER, VEHICLE_CAR, VEHICLE_BOAT,
    VEHICLE_BOAT, VEHICLE_BOAT, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_PLANE,
    VEHICLE_BIKE, VEHICLE_BIKE, VEHICLE_BIKE, VEHICLE_PLANE, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_BIKE, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_QUADBIKE, VEHICLE_BOAT, VEHICLE_BOAT, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_PLANE, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_BMX, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_BOAT, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_BOAT, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_BMX, VEHICLE_BMX, VEHICLE_PLANE, VEHICLE_PLANE, VEHICLE_PLANE,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_PLANE, VEHICLE_PLANE, VEHICLE_BIKE,
    VEHICLE_BIKE, VEHICLE_BIKE, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_TRAIN,
    VEHICLE_TRAIN, VEHICLE_PLANE, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_PLANE,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_MONSTERTRUCK, VEHICLE_MONSTERTRUCK, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_TRAIN, VEHICLE_TRAIN, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_MONSTERTRUCK, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_PLANE, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_BIKE, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_TRAILER, VEHICLE_CAR, VEHICLE_BIKE, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_TRAIN,
    VEHICLE_TRAILER, VEHICLE_PLANE, VEHICLE_PLANE, VEHICLE_CAR, VEHICLE_BOAT, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_TRAILER, VEHICLE_TRAILER, VEHICLE_TRAILER, VEHICLE_CAR, VEHICLE_TRAILER, VEHICLE_TRAILER
};
stock indexcompatible(veh)
{
new model=GetVehicleModel(veh);
/*
new compatible=1;
switch(model)
{
    case 460,476,511,512,513,519,520,553,577,592,593,548,425,417,487,488,497,563,447,469,509,481,510,462,448,581,522,461,521,523,463,586,468,471,435,450,569,570,584,590,591,606,607,608,610,611,485,538,457,532,486,406,530,537,571,572,574,449,525,583,539,441,464,465,501,564,594,472..473,493,595,484,430,452..453,446,454:
    {
        compatible=0;
    }
}
*/
return (gs_vehicleTypes[model-400]==VEHICLE_CAR)?1:0;
}
new index[MAX_VEHICLES][index2];
forward indexf(vehicleid,oldal);
public indexf(vehicleid,oldal)
{
new v=vehicleid;
if(v!=INVALID_VEHICLE_ID)
{
index[v][obj1]=CreateObject(19294,0,0,0,0,0,0);
AttachObjectToVehicle(index[v][obj1],v,(oldal==0)?1:-1, 2.5, -0.2, 0,0,0);
index[v][obj2]=CreateObject(19294,0,0,0,0,0,0);
AttachObjectToVehicle(index[v][obj2],v,(oldal==0)?1:-1, -2.5, -0.2, 0,0,0);
index[v][indexing]=true;
}
return 1;
}
// PRESSED(keys)
#define PRESSED(%0) \\
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
{
    if(PRESSED(KEY_LOOK_LEFT)||PRESSED(KEY_LOOK_RIGHT))
    {
    new veh=GetPlayerVehicleID(playerid);
    if(index[veh][indexing])
    {
        DestroyObject(index[veh][obj1]);
        DestroyObject(index[veh][obj2]);
        index[veh][indexing]=false;
    } else {
        if(indexcompatible(veh))
        {
               new oldal2=(PRESSED(KEY_LOOK_LEFT))?1:0;
               indexf(veh,oldal2);
      }
   }
}
}
return 1;
}

Nem elérhető Cappsy

  • Adminisztrátor
  • 2754
    • Profil megtekintése
Elakadásjelzõ
« Válasz #1 Dátum: 2012. május 20. - 22:25:55 »
0 Show voters
Hali :D
Kérnék egy elakadásjelzõ ami olyan hogy pl: /elakadva és villog az index mind a 2 helyen :D
Indexscript:
 
#include <a_samp>
enum index2
{
obj1,
obj2,
bool:indexing
}
#define VEHICLE_NONE 0
#define VEHICLE_CAR 1
#define VEHICLE_BOAT 2
#define VEHICLE_TRAIN 3
#define VEHICLE_HELI 4
#define VEHICLE_PLANE 5
#define VEHICLE_BIKE 6
#define VEHICLE_MONSTERTRUCK 7
#define VEHICLE_QUADBIKE 8
#define VEHICLE_BMX 9
#define VEHICLE_TRAILER 10
new gs_vehicleTypes [] = {
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_MONSTERTRUCK,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_BOAT,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_TRAILER, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_MONSTERTRUCK, VEHICLE_CAR,
    VEHICLE_BOAT, VEHICLE_HELI, VEHICLE_BIKE, VEHICLE_TRAIN, VEHICLE_TRAILER, VEHICLE_CAR, VEHICLE_BOAT,
    VEHICLE_BOAT, VEHICLE_BOAT, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_PLANE,
    VEHICLE_BIKE, VEHICLE_BIKE, VEHICLE_BIKE, VEHICLE_PLANE, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_BIKE, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_QUADBIKE, VEHICLE_BOAT, VEHICLE_BOAT, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_PLANE, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_BMX, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_BOAT, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_BOAT, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_BMX, VEHICLE_BMX, VEHICLE_PLANE, VEHICLE_PLANE, VEHICLE_PLANE,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_PLANE, VEHICLE_PLANE, VEHICLE_BIKE,
    VEHICLE_BIKE, VEHICLE_BIKE, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_TRAIN,
    VEHICLE_TRAIN, VEHICLE_PLANE, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_PLANE,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_MONSTERTRUCK, VEHICLE_MONSTERTRUCK, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_HELI, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_TRAIN, VEHICLE_TRAIN, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_MONSTERTRUCK, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_PLANE, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_BIKE, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_TRAILER, VEHICLE_CAR, VEHICLE_BIKE, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_TRAIN,
    VEHICLE_TRAILER, VEHICLE_PLANE, VEHICLE_PLANE, VEHICLE_CAR, VEHICLE_BOAT, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR, VEHICLE_CAR,
    VEHICLE_TRAILER, VEHICLE_TRAILER, VEHICLE_TRAILER, VEHICLE_CAR, VEHICLE_TRAILER, VEHICLE_TRAILER
};
stock indexcompatible(veh)
{
new model=GetVehicleModel(veh);
/*
new compatible=1;
switch(model)
{
    case 460,476,511,512,513,519,520,553,577,592,593,548,425,417,487,488,497,563,447,469,509,481,510,462,448,581,522,461,521,523,463,586,468,471,435,450,569,570,584,590,591,606,607,608,610,611,485,538,457,532,486,406,530,537,571,572,574,449,525,583,539,441,464,465,501,564,594,472..473,493,595,484,430,452..453,446,454:
    {
        compatible=0;
    }
}
*/
return (gs_vehicleTypes[model-400]==VEHICLE_CAR)?1:0;
}
new index[MAX_VEHICLES][index2];
forward indexf(vehicleid,oldal);
public indexf(vehicleid,oldal)
{
new v=vehicleid;
if(v!=INVALID_VEHICLE_ID)
{
index[v][obj1]=CreateObject(19294,0,0,0,0,0,0);
AttachObjectToVehicle(index[v][obj1],v,(oldal==0)?1:-1, 2.5, -0.2, 0,0,0);
index[v][obj2]=CreateObject(19294,0,0,0,0,0,0);
AttachObjectToVehicle(index[v][obj2],v,(oldal==0)?1:-1, -2.5, -0.2, 0,0,0);
index[v][indexing]=true;
}
return 1;
}
// PRESSED(keys)
#define PRESSED(%0) \\
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
{
    if(PRESSED(KEY_LOOK_LEFT)||PRESSED(KEY_LOOK_RIGHT))
    {
    new veh=GetPlayerVehicleID(playerid);
    if(index[veh][indexing])
    {
        DestroyObject(index[veh][obj1]);
        DestroyObject(index[veh][obj2]);
        index[veh][indexing]=false;
    } else {
        if(indexcompatible(veh))
        {
               new oldal2=(PRESSED(KEY_LOOK_LEFT))?1:0;
               indexf(veh,oldal2);
      }
   }
}
}
return 1;
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal