Advertisement
iXdoctor

Untitled

May 26th, 2014
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include < amxmodx >
  4. #include < amxmisc >
  5. #include < cstrike >
  6. #include < hamsandwich >
  7. #include < SurfLevels >
  8.  
  9.  
  10. public plugin_init()
  11. {
  12. register_event( "DeathMsg", "evDeathMsg", "a" );
  13.  
  14. register_clcmd( "say /xp", "CmdShowXp" );
  15. }
  16.  
  17. public CmdShowXp( client )
  18. {
  19. client_print( client, print_chat, "You have %i xp", surf_get_user_xp( client ) );
  20. }
  21.  
  22. public evDeathMsg( client )
  23. {
  24.  
  25. new iAttacker, iVictim, Headshot;
  26.  
  27. iAttacker = read_data( 1 );
  28.  
  29. iVictim = read_data( 2 );
  30.  
  31. Headshot = read_data( 3 );
  32.  
  33. if ( is_user_alive( iAttacker ) && is_user_connected( iVictim ) )
  34. {
  35. new CsTeams:iTeam[ 2 ];
  36.  
  37. iTeam[ 0 ] = cs_get_user_team( iAttacker );
  38.  
  39. iTeam[ 1 ] = cs_get_user_team( iVictim );
  40.  
  41. if ( iTeam[ 0 ] == CS_TEAM_CT && iTeam[ 1 ] == CS_TEAM_T )
  42. {
  43. new xp = ( Headshot ? 3 : 2 ) + ( szPowers[ surf_get_user_level( client ) ][ iXpBonus ] );
  44.  
  45. client_print( 0, print_chat, "^4%s^1 killed the player^4%s ^1 and recived ^3 %s xp", GetUserName( iAttacker ), GetUserName( iVictim ), xp );
  46.  
  47. surf_set_user_xp( iAttacker, surf_get_user_xp( iAttacker ) + xp );
  48. }
  49. }
  50. }
  51.  
  52. stock GetUserName( const Index )
  53. {
  54. new szNick [ 32 ];
  55.  
  56. get_user_name( Index, szNick, charsmax( szNick ) );
  57.  
  58. return szNick;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement