// Luces Intermitentens by TiNcH010// http://www.forum.sa-mp.com#define FILTERSCRIPT#include <a_samp>#if defined FILTERSCRIPTnew PLuces
[MAX_PLAYERS
];
new TLI, TLI2;
forward TimerLucesIntermitentes
(vehicleid
);
forward TimerLucesIntermitentes2
(vehicleid
);
forward LucesIntermitentes
(playerid
);
forward ApagarLucesIntermitentes
(playerid
);
forward encode_lights
(light1, light2, light3, light4
);
#elsemain
(){}#endifpublic OnPlayerConnect
(playerid
){PLuces
[playerid
] = 0;
return 1;
}public OnPlayerDeath
(playerid, killerid, reason
){return 1;
}public OnPlayerCommandText
(playerid, cmdtext
[]){if(strcmp(cmdtext,
"/hnada", true
) == 0){new enginem, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx
(GetPlayerVehicleID
(playerid
), enginem, lights, alarm, doors, bonnet, boot, objective
);
SetVehicleParamsEx
(GetPlayerVehicleID
(playerid
), VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective
);
return 1;
}if(strcmp(cmdtext,
"/prioritario", true
) == 0){if(GetVehicleModel
(GetPlayerVehicleID
(playerid
)) != 596) // Cambiar si se desea.{SendClientMessage
(playerid,
-1,
"{FF0000}Debes subirte a un coche de policia de Los Santos!");
return 1;
}new enginem, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx
(GetPlayerVehicleID
(playerid
), enginem, lights, alarm, doors, bonnet, boot, objective
);
if(lights
== VEHICLE_PARAMS_OFF
){SendClientMessage
(playerid,
-1,
"{FF0000}Las luces deben estar encendidas!");
return 1;
}if(PLuces
[playerid
] == 0){LucesIntermitentes
(playerid
);
PLuces
[playerid
] = 1;
}else if(PLuces
[playerid
] == 1){ApagarLucesIntermitentes
(playerid
);
PLuces
[playerid
] = 0;
}return 1;
}return 0;
}public OnPlayerKeyStateChange
(playerid, newkeys, oldkeys
){if(newkeys
& KEY_YES
) // Si presiona la tecla Y.{new enginem, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx
(GetPlayerVehicleID
(playerid
), enginem, lights, alarm, doors, bonnet, boot, objective
);
if(lights
== VEHICLE_PARAMS_OFF
){SendClientMessage
(playerid,
-1,
"{FF0000}Las luces deben estar encendidas!");
return 1;
}if(PLuces
[playerid
] == 0){LucesIntermitentes
(playerid
);
PLuces
[playerid
] = 1;
}}if(newkeys
& KEY_NO
) // Si presiona la tecla N.{new enginem, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx
(GetPlayerVehicleID
(playerid
), enginem, lights, alarm, doors, bonnet, boot, objective
);
if(lights
== VEHICLE_PARAMS_OFF
){SendClientMessage
(playerid,
-1,
"{FF0000}Las luces deben estar encendidas!");
return 1;
}if(PLuces
[playerid
] == 1){ApagarLucesIntermitentes
(playerid
);
PLuces
[playerid
] = 0;
}}return 1;
}public LucesIntermitentes
(playerid
){if ( IsPlayerInAnyVehicle
(playerid
) && GetPlayerVehicleSeat
(playerid
) == 0 ){new Panels, Doors1, Lights, Tires;
GetVehicleDamageStatus
(GetPlayerVehicleID
(playerid
), Panels, Doors1, Lights, Tires
);
UpdateVehicleDamageStatus
(GetPlayerVehicleID
(playe rid
), Panels, Doors1, encode_lights
(0,
0,
1,
1), Tires
);
TLI
= SetTimerEx
("TimerLucesIntermitentes",
100, false,
"d", GetPlayerVehicleID
(playerid
));
}}public ApagarLucesIntermitentes
(playerid
){if ( IsPlayerInAnyVehicle
(playerid
) && GetPlayerVehicleSeat
(playerid
) == 0 ){KillTimer
(TLI
);
KillTimer
(TLI2
);
new Panels, Doors1, Lights, Tires;
GetVehicleDamageStatus
(GetPlayerVehicleID
(playerid
), Panels, Doors1, Lights, Tires
);
UpdateVehicleDamageStatus
(GetPlayerVehicleID
(playe rid
), Panels, Doors1, encode_lights
(0,
0,
0,
0), Tires
);
}}public encode_lights
(light1, light2, light3, light4
){return light1 |
(light2
<< 1) |
(light3
<< 2) |
(light4
<< 3);
}public TimerLucesIntermitentes
(vehicleid
){new Panels, Doors1, Lights, Tires;
GetVehicleDamageStatus
(vehicleid, Panels, Doors1, Lights, Tires
);
UpdateVehicleDamageStatus
(vehicleid, Panels, Doors1, encode_lights
(1,
1,
0,
0), Tires
);
TLI2
= SetTimerEx
("TimerLucesIntermitentes2",
100, false,
"d", vehicleid
);
}public TimerLucesIntermitentes2
(vehicleid
){new Panels, Doors1, Lights, Tires;
GetVehicleDamageStatus
(vehicleid, Panels, Doors1, Lights, Tires
);
UpdateVehicleDamageStatus
(vehicleid, Panels, Doors1, encode_lights
(0,
0,
1,
1), Tires
);
TLI
= SetTimerEx
("TimerLucesIntermitentes",
100, false,
"d", vehicleid
);