Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new TempoAcionar[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("> Sistema de Alarme de Incendio Carregado");
- Create3DTextLabel("{FFFFFF}Alarme de incêndio\n{FFFFFF}Aperte F Para Acionar",-1,244.9254, 78.6766, 1004.2170,10.0,0);
- CreateObject(1613, 250.35959, 63.08064, 1007.70673, 0.00000, 0.00000, 0.00000);//Alarme DP
- CreateObject(2961, 244.9254, 78.6766, 1004.2170, 0.0000, 0.0000, 89.6096);//Alarme DP
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == 16 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, 244.9254, 78.6766, 1004.2170))//Pos DP
- {
- SetPlayerPos(playerid, 245.4665, 78.6039, 1003.6290);
- SetPlayerFacingAngle(playerid, 90.0000);
- ApplyAnimation(playerid, "CRIB","CRIB_Use_Switch",4.1,0,0,0,0,0);
- SetTimerEx("pararanim", 2000, false, "i", playerid);
- TocarAlarme(playerid);
- return 1;
- }
- }
- return 1;
- }
- stock TocarAlarme(playerid)
- {
- if(gettime() - TempoAcionar[playerid] < 150) return SendClientMessage(playerid, -1, "O alarme de incendio ja foi acionado! Espere 1 min e 20 segundos para acionar novamente!");
- TempoAcionar[playerid] = gettime();
- new str[128], Nome[30];
- GetPlayerName(playerid, Nome, 30);
- format(str, sizeof(str), "%s acionou o alarme de incêndio (%s), deixem o local!", Nome, LocalAlarme(playerid));
- SendClientMessageToAll(0x33AA33AA, str);
- for( new i; i < MAX_PLAYERS; i++ )
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 244.9254, 78.6766, 1004.2170))//Coord. DP
- {
- PlayAudioStreamForPlayer( i, "http://dc660.4shared.com/img/3475447006/1d3b9f0e/dlink__2Fdownload_2FSVBnU5WN_3Ftsid_3D20140417-063222-ba90b09c_26lgfp_3D1000_26dsid_3D2xuhu6.705dada847fa2bbbc0ac646e88905cea_26sbsr_3Dbc10f7f78d0971420d45b616c56dad25361500be27de10cd/preview.mp3", 250.3596, 63.0806, 1007.7067, 50, 1);
- }
- }
- return 1;
- }
- stock LocalAlarme(playerid)
- {
- new text[100];
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 244.9254, 78.6766, 1004.2170)) { text = "Departamento de Policia"; }
- return text;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement