Szerző Téma: Index  (Megtekintve 2465 alkalommal)

Index
« Dátum: 2013. március 21. - 22:46:58 »
+5 Show voters
Üdv.

Találtam a gépemen egy régi index szkriptet.

 
#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;
}

 
Ha bármi gond lenne írj privit.

Bekapcsolás \"E\" és a \"Q\" betûvel.


Üdv. Sajtiikaa

Index
« Válasz #1 Dátum: 2013. március 21. - 22:55:51 »
0 Show voters
Szép lett Sajtiikaa :)

Nem elérhető Rexii

  • 471
    • Profil megtekintése
Index
« Válasz #2 Dátum: 2013. március 22. - 19:44:19 »
0 Show voters
Hasznos  :thumbsup: Ment a +  8)

Nem elérhető Beckham

  • 1693
  • Noresz
  • Discord: Noresz#4265
    • Profil megtekintése
    • OctansV Alt:v szervere
Index
« Válasz #3 Dátum: 2013. március 23. - 00:36:34 »
0 Show voters
Nemrossz,bár jó lenne ha kilenne mérve összes kocsira :D
OFF:(mostanában mindenki ezzel a találtam a gépen cuccossal jön?):D

Nem elérhető scripter01

  • 1035
  • Ex Moderálisan Globális
    • Profil megtekintése
Index
« Válasz #4 Dátum: 2013. március 23. - 06:27:48 »
0 Show voters
Jó lett te elavult dolog és vagy 50x fent van már a fórumokon :)!

Index
« Válasz #5 Dátum: 2013. március 23. - 14:20:50 »
+1 Show voters
Idézetet írta: scripter01 date=1364016468\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"35147\" data-ipsquote-contentclass=\"forums_Topic
Jó lett te elavult dolog és vagy 50x fent van már a fórumokon :)!
 
Nah akkor linkelj már egy ugyanilyet léci..;)

Nem elérhető lusta19

  • 9084
  • £u$taÐi$znó
    • Profil megtekintése
Index
« Válasz #6 Dátum: 2013. március 23. - 14:31:43 »
+1 Show voters
    #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;
    }

 
Szép másolás:
http://sampforum.hu/index.php?topic=20101.0
« Utoljára szerkesztve: 2013. március 23. - 14:39:16 írta <[£u$ta]> »

Index
« Válasz #7 Dátum: 2013. március 23. - 14:35:55 »
+1 Show voters
No para hogy nem ugyan az ><\"

Nem elérhető lusta19

  • 9084
  • £u$taÐi$znó
    • Profil megtekintése
Index
« Válasz #8 Dátum: 2013. március 23. - 18:17:51 »
+1 Show voters
Kicsit se

Nem elérhető Beckham

  • 1693
  • Noresz
  • Discord: Noresz#4265
    • Profil megtekintése
    • OctansV Alt:v szervere
Index
« Válasz #9 Dátum: 2013. március 23. - 18:38:51 »
+1 Show voters
De bizony ugyanaz,változók is meg minden.

Index
« Válasz #10 Dátum: 2013. március 23. - 18:52:48 »
0 Show voters
Na mehete a Lock és Jó pár százalék Warn...

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal