aqui te dejo en formato FS un codigo sencillo luego si quieres se le puede agregar clave, horario de fincionamiento y todo lo demas. lo deje explicado para que puedas agregar tooodas las rejas a tú gusto..
#include <a_samp>
#include <streamer>
#define foreachEx(%0:%1) for(new %0=0;%0<%1;%0++)
//============= Rejas ======================================================//
enum EnumReja
{
pObjeto,
Float:cpPos[3],
Float:cpRot[3],
Float:apPos[3],
Float:apRot[3],
bool:pestado,
pID
};
new Rejas[][EnumReja] =
{
{989, {1936.98450, -2488.89648, 14.88024}, {0.0000, 0.0000, 0.5020}, {1944.00146, -2466.88818, 14.88024}, {0.0000, 0.0000, 0.5020}, false}//aero ls
//ID objeto reja | Posciones Cerradas | | Rotaciones Cerradas | | Posciones Abiertas | | Rotaciones Abiertas |
// {19912, {1503.2002, -698.0252, 96.4782}, {0.0000, 0.0000, 0.5020}, {1503.2002, -698.0252, 90.8645}, {0.0000, 0.0000, 0.5020}, false}//casa ls
};
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_CROUCH)
{
for(new p=0; p<sizeof(Rejas);p++)
{
if(IsPlayerInRangeOfPoint(playerid, 12.0, Rejas[p][cpPos][0], Rejas[p][cpPos][1], Rejas[p][cpPos][2]))
{
if(Rejas[p][pestado])
{
MoveDynamicObject(Rejas[p][pID], Rejas[p][cpPos][0], Rejas[p][cpPos][1], Rejas[p][cpPos][2], 2.0, Rejas[p][cpRot][0], Rejas[p][cpRot][1], Rejas[p][cpRot][2]);
PlayerPlaySound(playerid, 1035,Rejas[p][cpPos][0], Rejas[p][cpPos][1], Rejas[p][cpPos][2]);
Rejas[p][pestado] = false;
}
else
{
MoveDynamicObject(Rejas[p][pID], Rejas[p][apPos][0], Rejas[p][apPos][1], Rejas[p][apPos][2], 2.0, Rejas[p][apRot][0], Rejas[p][apRot][1], Rejas[p][apRot][2]);
PlayerPlaySound(playerid, 1035,Rejas[p][cpPos][0], Rejas[p][cpPos][1], Rejas[p][cpPos][2]);
Rejas[p][pestado] = true;
}
}
}
}
return 1;
}
public OnGameModeInit()
{
foreachEx(i:sizeof(Rejas))
{
CreateDynamic3DTextLabel("{ffffff}Presiona {FF0000}claxon o C {ffffff}para activar la entrada/salida.",0xFFFFFFFF, Rejas[cpPos][0],Rejas[cpPos][1],Rejas[cpPos][2], 18.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 18.0);
}
for(new p=0; p<sizeof(Rejas); p++)
{
Rejas[p][pID] = CreateDynamicObject(Rejas[p][pObjeto], Rejas[p][cpPos][0], Rejas[p][cpPos][1], Rejas[p][cpPos][2], Rejas[p][cpRot][0], Rejas[p][cpRot][1], Rejas[p][cpRot][2]);
}
return 1;
}