Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Head-Shot System
- // By: dEvasT._
- // Optimizado por: MiqueiasBarros
- #include <a_samp>
- #define TIMER_INTERVAL 150
- static
- maxPlayers
- ;
- public
- OnFilterScriptInit( ) {
- maxPlayers = GetMaxPlayers();
- SetTimer("CheckHeadShot", TIMER_INTERVAL, 1);
- print("\n----------------------------------");
- print(" System dEvasT._ Não Retire Os Creditos!");
- print("----------------------------------\n");
- return true;
- }
- public
- OnPlayerDeath( playerid, killerid, reason ) {
- if( GetPVarInt( playerid, "Headshotted" ) == 1 ) {
- static
- var1[128]
- ;
- SetPVarInt( playerid, "Headshotted", 0 );
- GameTextForPlayer( playerid, "~g~] KiLLaH ~y~HeaD ~r~ShoT~g~Porra! ]", 3000, 3 );
- GameTextForPlayer( killerid, "~g~] KiLLaH ~y~HeaD ~r~ShoT~g~Porra! ]", 3000, 3 );
- SendClientMessageToAll( 16711935, var1 );
- }
- return true;
- }
- forward
- CheckHeadShot( );
- public
- CheckHeadShot( ) {
- static
- index
- ;
- for( new playerid; playerid < maxPlayers; playerid++ ) {
- if( IsPlayerConnected( playerid ) ) {
- index = GetPlayerAnimationIndex( playerid );
- if( index == 1173 || index == 1175 || index == 1177 || index == 1178 ) {
- SetPVarInt( playerid, "Headshotted", 1 );
- SetPlayerHealth( playerid, 0 );
- }
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement