hlmod.hu
https://hlmod.hu/

frag lopás
https://hlmod.hu/viewtopic.php?f=101&t=12664
Oldal: 3 / 3

Szerző:  FonoK [ 2016.11.02. 12:16 ]
Hozzászólás témája:  Re: frag lopás

demon írta:
Használd ezt:
  1. #include < amxmodx >
  2. #include < hamsandwich >
  3. #include < colorchat >
  4.  
  5. new g_iSebzok[ 33 ];
  6. new g_iSebzesek[ 33 ];
  7. new g_iSebzettek[ 33 ];
  8. new g_iMaxPlayers;
  9.  
  10. public plugin_init( )
  11. {
  12.     register_plugin( "Frag Lopas Chat Uzenettel", "1.0", "Silent" );
  13.     register_event( "DeathMsg", "eDeath", "ae" );
  14.     register_event( "Damage", "eDamage", "be", "2!0", "3=0", "4!0" )
  15.     RegisterHam( Ham_Spawn, "player", "eSpawn", 1 )
  16.     g_iMaxPlayers = get_maxplayers();
  17. }
  18.  
  19. public eSpawn( iId ) { g_iSebzok[ iId ] = g_iSebzesek[ iId ] = g_iSebzettek[ iId ] = 0; }
  20.  
  21. public eDamage( iAldozat )
  22. {
  23.     if ( 0 < iAldozat < g_iMaxPlayers )
  24.     {
  25.         new iTamado = get_user_attacker( iAldozat );
  26.         if ( 0 < iTamado < g_iMaxPlayers )
  27.         {
  28.             new iDamage = read_data(2);
  29.             g_iSebzesek[ iTamado ] += iDamage;
  30.             if ( g_iSebzesek[ iTamado ] >= 50 )
  31.             {
  32.                 g_iSebzok[ iTamado ] = iAldozat;
  33.                 g_iSebzettek[ iAldozat ] = iTamado;
  34.             }
  35.         }
  36.     }
  37. }
  38.  
  39. public eDeath( )
  40. {
  41.     new iAldozat = read_data( 2 );
  42.     new iTamado = read_data( 1 );
  43.     if ( g_iSebzettek[ iAldozat ] && g_iSebzettek[ iAldozat ] != iTamado )
  44.     {
  45.         new iFragetKap = g_iSebzettek[ iAldozat ];
  46.         new sFragetKapNeve[ 32 ];
  47.        
  48.         g_iSebzok[ iFragetKap ] = g_iSebzesek[ iFragetKap ] = g_iSebzettek[ iAldozat ] = 0;
  49.        
  50.         get_user_name( iFragetKap, sFragetKapNeve, 31 );
  51.        
  52.         ExecuteHamB( Ham_AddPoints, iFragetKap, 1, false );
  53.        
  54.         ColorChat( 0, BLUE, "[Anti-Frag]^x04%s kapott +1 fraget.", sFragetKapNeve );
  55.     }
  56. }


Kitűnően műödik, köszönöm szépen.

Oldal: 3 / 3 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/