Advertisement
Guest User

[FS] Head-Shot System

a guest
Jul 17th, 2012
986
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.25 KB | None | 0 0
  1. // Head-Shot System
  2. // By: dEvasT._
  3. // Optimizado por: MiqueiasBarros
  4.  
  5. #include <a_samp>
  6.  
  7. #define TIMER_INTERVAL 150
  8.  
  9. static
  10.     maxPlayers
  11. ;
  12.  
  13. public
  14.         OnFilterScriptInit( ) {
  15.     maxPlayers = GetMaxPlayers();
  16.     SetTimer("CheckHeadShot", TIMER_INTERVAL, 1);
  17.     print("\n----------------------------------");
  18.     print(" System dEvasT._ Não Retire Os Creditos!");
  19.     print("----------------------------------\n");
  20.     return true;
  21. }
  22.  
  23. public
  24.         OnPlayerDeath( playerid, killerid, reason ) {
  25.     if( GetPVarInt( playerid, "Headshotted" ) == 1 ) {
  26.         static
  27.             var1[128]
  28.         ;
  29.         SetPVarInt( playerid, "Headshotted", 0 );
  30.         GameTextForPlayer( playerid, "~g~] KiLLaH ~y~HeaD ~r~ShoT~g~Porra! ]", 3000, 3 );
  31.         GameTextForPlayer( killerid, "~g~] KiLLaH ~y~HeaD ~r~ShoT~g~Porra! ]", 3000, 3 );
  32.         SendClientMessageToAll( 16711935, var1 );
  33.     }
  34.     return true;
  35. }
  36.  
  37. forward
  38.         CheckHeadShot( );
  39. public
  40.         CheckHeadShot( ) {
  41.     static
  42.         index
  43.     ;
  44.     for( new playerid; playerid < maxPlayers; playerid++ ) {
  45.         if( IsPlayerConnected( playerid ) ) {
  46.             index = GetPlayerAnimationIndex( playerid );
  47.             if( index == 1173 || index == 1175 || index == 1177 || index == 1178 ) {
  48.                 SetPVarInt( playerid, "Headshotted", 1 );
  49.                 SetPlayerHealth( playerid, 0 );
  50.             }
  51.         }
  52.     }
  53.     return true;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement