Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include < amxmodx >
- #include < amxmisc >
- #include < cstrike >
- #include < hamsandwich >
- #include < SurfLevels >
- public plugin_init()
- {
- register_event( "DeathMsg", "evDeathMsg", "a" );
- register_clcmd( "say /xp", "CmdShowXp" );
- }
- public CmdShowXp( client )
- {
- client_print( client, print_chat, "You have %i xp", surf_get_user_xp( client ) );
- }
- public evDeathMsg( client )
- {
- new iAttacker, iVictim, Headshot;
- iAttacker = read_data( 1 );
- iVictim = read_data( 2 );
- Headshot = read_data( 3 );
- if ( is_user_alive( iAttacker ) && is_user_connected( iVictim ) )
- {
- new CsTeams:iTeam[ 2 ];
- iTeam[ 0 ] = cs_get_user_team( iAttacker );
- iTeam[ 1 ] = cs_get_user_team( iVictim );
- if ( iTeam[ 0 ] == CS_TEAM_CT && iTeam[ 1 ] == CS_TEAM_T )
- {
- new xp = ( Headshot ? 3 : 2 ) + ( szPowers[ surf_get_user_level( client ) ][ iXpBonus ] );
- client_print( 0, print_chat, "^4%s^1 killed the player^4%s ^1 and recived ^3 %s xp", GetUserName( iAttacker ), GetUserName( iVictim ), xp );
- surf_set_user_xp( iAttacker, surf_get_user_xp( iAttacker ) + xp );
- }
- }
- }
- stock GetUserName( const Index )
- {
- new szNick [ 32 ];
- get_user_name( Index, szNick, charsmax( szNick ) );
- return szNick;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement