Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.53 KB | None | 0 0
  1. public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
  2. {
  3.     Admin_OnPlayerWeaponShot( playerid, hitid );
  4.    
  5.     new Float:x, Float:y, Float:z, i = 0;
  6.    
  7.     new weaponname[24];
  8.  
  9.     GetPlayerPos(playerid, x, y, z);
  10.  
  11.     for(; i != sizeof(gSAZones); i++ )
  12.     {
  13.         if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4]) break;
  14.     }
  15.    
  16.     if( weaponid >= 22 && weaponid != 23 )
  17.     {
  18.         new
  19.             server_tick = GetTickCount();
  20.  
  21.         if( GetPVarInt( playerid, "Player:ShotTime" ) > server_tick )
  22.         return 0;
  23.        
  24.         GetWeaponName(weaponid, weaponname, sizeof (weaponname));
  25.        
  26.         foreach(new j : Player)
  27.         {
  28.             if( !IsLogged( j ) || !Player[j][uRank] ) continue;
  29.  
  30.             if( Player[j][uMember] != FRACTION_POLICE || Player[j][uLeader]  != FRACTION_POLICE ) continue;
  31.  
  32.             new interior = GetPlayerVirtualWorld( playerid );
  33.            
  34.             if( interior == 0 )
  35.             {
  36.                 format:g_small_string( "** Зафиксирована стрельба в %s из %s!", gSAZones[i][SAZONE_NAME], weaponname );
  37.             }
  38.             else
  39.             {
  40.                 for( new d; d < COUNT_ENTERS; d++ )
  41.                 {
  42.                     format:g_small_string( "** Зафиксирована стрельба в помещении #%s из %s!", interior, weaponname );
  43.                 }
  44.             }
  45.             SendClientMessage( j, 0x00BFFFAA, g_small_string );
  46.         }
  47.        
  48.         clean:<g_small_string>;
  49.        
  50.         SetPVarInt( playerid, "Player:ShotTime", server_tick + 20000 );
  51.         clean:<g_small_string>;
  52.     }
  53.    
  54.     return 1;  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement