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

Index
« Dátum: 2013. augusztus 28. - 12:59:32 »
0 Show voters
Használat: Num 4, Num 6
 
#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_ANALOG_LEFT)||PRESSED(KEY_ANALOG_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_ANALOG_LEFT))?1:0;
               indexf(veh,oldal2);
      }
   }
}
}
return 1;
}

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Index
« Válasz #1 Dátum: 2013. augusztus 28. - 13:37:02 »
0 Show voters
lacoss már csinált 1-et, de ez se rossz :D

Index
« Válasz #2 Dátum: 2013. augusztus 28. - 13:44:31 »
0 Show voters
Nálam nem mûködött

Index
« Válasz #3 Dátum: 2013. augusztus 28. - 13:50:33 »
0 Show voters
Idézetet írta: Flash date=1377689822\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"42038\" data-ipsquote-contentclass=\"forums_Topic
lacoss már csinált 1-et, de ez se rossz :D
 
Ez az enyém átalakított verziója :D Amúgy 2-es weather kell hozzá általánosságban.

Nem elérhető CANNONN

  • 2139
    • Profil megtekintése
Index
« Válasz #4 Dátum: 2013. augusztus 28. - 16:45:06 »
0 Show voters
[mod]Van már egy teljesen ugyan ilyen a fórumon. Zárok.[/mod]

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal