Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ===============================
- Sistema de Respirar para Mirar feito por: JPedro
- Mantenha os créditos do Autor!
- ===================================*/
- #include <a_samp>
- /* ==================== [ Macros ] ===================== */
- #define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
- #define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- #define HOLDING(%0) ((newkeys & (%0)) == (%0))
- /* ========================================= */
- new bool:pMirando[MAX_PLAYERS] = false,
- bool:pRespirando[MAX_PLAYERS] = true;
- public OnFilterScriptInit()
- {
- print("\n\n\n| INFO |: Sistema de Respirar para Mirar | Carregado com sucesso!\n\n\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if(GetPlayerWeapon(playerid) == 34)
- {
- if(PRESSED(KEY_HANDBRAKE)) // Checa quando mira
- {
- if(pMirando[playerid] == false)
- {
- SoltarRespiracao(playerid);
- pMirando[playerid] = true;
- pRespirando[playerid] = false;
- }
- }
- if(RELEASED(KEY_HANDBRAKE)) // Checa quando solta a mira
- {
- if(pMirando[playerid] == true)
- {
- SegurarRespiracao(playerid);
- pMirando[playerid] = false;
- pRespirando[playerid] = true;
- }
- }
- if(HOLDING(KEY_WALK)) // Checa se esta segurando a respiracao
- {
- if(pMirando[playerid] == true)
- {
- if(pRespirando[playerid] == false)
- {
- pRespirando[playerid] = true;
- SegurarRespiracao(playerid);
- }
- }
- }
- if(RELEASED(KEY_WALK)) // Checa quando soltou a respiracao
- {
- if(pMirando[playerid] == true)
- {
- if(pRespirando[playerid] == true)
- {
- pRespirando[playerid] = false;
- SoltarRespiracao(playerid);
- }
- }
- }
- if(HOLDING(KEY_FIRE)) // caso o jogador segure o butao de atirar
- {
- if(pMirando[playerid] == true)
- {
- if(pRespirando[playerid] == true)
- {
- pRespirando[playerid] = false;
- SoltarRespiracao(playerid);
- }
- }
- }
- else if(RELEASED(KEY_FIRE)) // Checa se o jogador soltou o butao de atirar
- {
- if(pMirando[playerid] == true)
- {
- if(pRespirando[playerid] == true)
- {
- pRespirando[playerid] = false;
- SoltarRespiracao(playerid);
- }
- }
- }
- }
- }
- return 1;
- }
- stock SoltarRespiracao(playerid)
- {
- PlayerPlaySound(playerid, 31400, 0.0, 0.0, 0.0);
- SetPlayerDrunkLevel(playerid, 7000);
- return 1;
- }
- stock SegurarRespiracao(playerid)
- {
- PlayerPlaySound(playerid, 31400+1, 0.0, 0.0, 0.0);
- SetPlayerDrunkLevel(playerid, 0);
- return 1;
- }
- // www.homehots.com.br
- //Todos os direitos reservados a JPedro pela criação do filterscript.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement