Ezt nem értem...
Amit csináltam hozzá index rendszert, az vmiért nem jó. azaz bugos
Ha indexel vki és egy másik player bekapcsolja az indexet akkor az elsõnek eltünik az indexe... ezt nem vágom.....
Valaki segítsen már én mindent megcsináltam benne vajon mi a hiba???
Kód: [Kijelölés]
//Index rendszer bí Peti134
//szabadon felhasználható, bárhova kirakható készítõ nevének feltûntetésével
#include <a_samp>
#include <a_objects>
#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
#define NEMINDEX 0
#define INDEXJOBBRA 1
#define INDEXBALRA 2
#define ADAKAS 3
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
};
new indexel[MAX_VEHICLES];
new indexobj1[MAX_VEHICLES];
new indexobj2[MAX_VEHICLES];
new indexobj3[MAX_VEHICLES];
new indexobj4[MAX_VEHICLES];
#define NEMINDEX 0
#define INDEXJOBBRA 1
#define INDEXBALRA 2
#define AKADAS 3
stock indexcompatible(veh)
{
new model=GetVehicleModel(veh);
return (gs_vehicleTypes[model-400]==VEHICLE_CAR)?1:0;
}
forward Index(vehicleid,oldal);
public Index(vehicleid,oldal)
{
new v=vehicleid;
if(v!=INVALID_VEHICLE_ID)
{
if(oldal == INDEXJOBBRA)
{
if(indexel[v] == INDEXJOBBRA)
{
Index(v,NEMINDEX);
indexel[v] = NEMINDEX;
} else if(indexel[v] == INDEXBALRA)
{
Index(v,NEMINDEX);
indexobj1[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj2[v] = CreateObject(19294,0,0,0,0,0,0);
AttachObjectToVehicle(indexobj1[v],v,1, 2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj2[v],v,1, -2.5, -0.2, 0,0,0);
indexel[v] = INDEXJOBBRA;
} else if(indexel[v] == AKADAS)
{
Index(v,NEMINDEX);
indexobj1[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj2[v] = CreateObject(19294,0,0,0,0,0,0);
AttachObjectToVehicle(indexobj1[v],v,1, 2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj2[v],v,1, -2.5, -0.2, 0,0,0);
indexel[v] = INDEXJOBBRA;
} else if(indexel[v] == NEMINDEX)
{
Index(v,NEMINDEX);
indexobj1[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj2[v] = CreateObject(19294,0,0,0,0,0,0);
AttachObjectToVehicle(indexobj1[v],v,1, 2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj2[v],v,1, -2.5, -0.2, 0,0,0);
indexel[v] = INDEXJOBBRA;
}
} else if(oldal == INDEXBALRA)
{
if(indexel[v] == INDEXBALRA)
{
Index(v,NEMINDEX);
indexel[v] = NEMINDEX;
} else if(indexel[v] == INDEXJOBBRA)
{
Index(v,NEMINDEX);
indexobj1[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj2[v] = CreateObject(19294,0,0,0,0,0,0);
AttachObjectToVehicle(indexobj1[v],v,-1, 2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj2[v],v,-1, -2.5, -0.2, 0,0,0);
indexel[v] = INDEXBALRA;
} else if(indexel[v] == AKADAS)
{
Index(v,NEMINDEX);
indexobj1[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj2[v] = CreateObject(19294,0,0,0,0,0,0);
AttachObjectToVehicle(indexobj1[v],v,-1, 2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj2[v],v,-1, -2.5, -0.2, 0,0,0);
indexel[v] = INDEXBALRA;
} else if(indexel[v] == NEMINDEX)
{
Index(v,NEMINDEX);
indexobj1[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj2[v] = CreateObject(19294,0,0,0,0,0,0);
AttachObjectToVehicle(indexobj1[v],v,-1, 2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj2[v],v,-1, -2.5, -0.2, 0,0,0);
indexel[v] = INDEXBALRA;
}
} else if(oldal == AKADAS)
{
if(indexel[v] == AKADAS)
{
Index(v,NEMINDEX);
indexel[v] = NEMINDEX;
} else if(indexel[v] == INDEXJOBBRA)
{
Index(v,NEMINDEX);
indexobj1[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj2[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj3[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj4[v] = CreateObject(19294,0,0,0,0,0,0);
AttachObjectToVehicle(indexobj1[v],v,-1, 2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj2[v],v,-1, -2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj3[v],v,1, 2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj4[v],v,1, -2.5, -0.2, 0,0,0);
indexel[v] = AKADAS;
} else if(indexel[v] == AKADAS)
{
Index(v,NEMINDEX);
indexobj1[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj2[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj3[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj4[v] = CreateObject(19294,0,0,0,0,0,0);
AttachObjectToVehicle(indexobj1[v],v,-1, 2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj2[v],v,-1, -2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj3[v],v,1, 2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj4[v],v,1, -2.5, -0.2, 0,0,0);
indexel[v] = AKADAS;
} else if(indexel[v] == NEMINDEX)
{
Index(v,NEMINDEX);
indexobj1[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj2[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj3[v] = CreateObject(19294,0,0,0,0,0,0);
indexobj4[v] = CreateObject(19294,0,0,0,0,0,0);
AttachObjectToVehicle(indexobj1[v],v,-1, 2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj2[v],v,-1, -2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj3[v],v,1, 2.5, -0.2, 0,0,0);
AttachObjectToVehicle(indexobj4[v],v,1, -2.5, -0.2, 0,0,0);
indexel[v] = AKADAS;
}
} else if(oldal == NEMINDEX)
{
DestroyObject(indexobj1[v]);
DestroyObject(indexobj2[v]);
DestroyObject(indexobj3[v]);
DestroyObject(indexobj4[v]);
}
}
return 1;
}
public OnFilterScriptInit()
{
print(\"\\n-------------------------------------------\");
print(\" Index rendszer by Peti134 alias William Levy\");
print(\"---------------------------------------------\\n\");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/akadasjelzo\", cmdtext, true, 10) == 0 || strcmp(\"/elakadasjelzo\", cmdtext, true, 10) == 0 || strcmp(\"/akadásjelzõ\", cmdtext, true, 10) == 0 || strcmp(\"/elakadásjelzõ\", cmdtext, true, 10) == 0)
{
if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
{
new v=GetPlayerVehicleID(playerid);
if(indexcompatible(v))
{
if(indexel[v] == INDEXJOBBRA || indexel[v] == INDEXBALRA)
{
Index(v,NEMINDEX);
Index(v,AKADAS);
}
else if(indexel[v] == AKADAS)
{
Index(v,NEMINDEX);
indexel[v] = NEMINDEX;
}
else if(indexel[v] == NEMINDEX)
{
Index(v,NEMINDEX);
Index(v,AKADAS);
}
}
}
return 1;
}
return 0;
}
#define PRESSED(%0) \\
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
{
new v=GetPlayerVehicleID(playerid);
if(PRESSED(KEY_LOOK_LEFT))
{
if(indexcompatible(v))
{
if(indexel[v] == INDEXBALRA)
{
Index(v,NEMINDEX);
indexel[v] = NEMINDEX;
} else if(indexel[v] == INDEXJOBBRA)
{
Index(v,NEMINDEX);
Index(v,INDEXBALRA);
} else if(indexel[v] == AKADAS)
{
Index(v,NEMINDEX);
Index(v,INDEXBALRA);
} else if(indexel[v] == NEMINDEX)
{
Index(v,NEMINDEX);
Index(v,INDEXBALRA);
}
}
} else if(PRESSED(KEY_LOOK_RIGHT))
{
if(indexcompatible(v))
{
if(indexel[v] == INDEXJOBBRA)
{
Index(v,NEMINDEX);
indexel[v] = NEMINDEX;
} else if(indexel[v] == INDEXBALRA)
{
Index(v,NEMINDEX);
Index(v,INDEXJOBBRA);
} else if(indexel[v] == AKADAS)
{
Index(v,NEMINDEX);
Index(v,INDEXJOBBRA);
} else if(indexel[v] == NEMINDEX)
{
Index(v,NEMINDEX);
Index(v,INDEXJOBBRA);
}
}
}
}
return 1;
}
EZ AZ ENYÉM TE SCRIPTLOPÓ PETI BANNOLJÁTOK AZONNAL!
[/quote]
Nem ertem miert kellene bannolni, talan nem azert raktad fel hogy mas felhasznalhassa?DE MOST KOMOLYAN!