Advertisement
Guest User

Untitled

a guest
May 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.37 KB | None | 0 0
  1.         case '1': // Awp
  2.         {
  3.             new money = cs_get_user_money( id );
  4.             new cost = get_pcvar_num( pCvar_AwpCost );
  5.            
  6.             if( money >= cost )
  7.             {
  8.                 if( !g_Items[ id ][ Awp ] )
  9.                 {
  10.                     if( is_user_alive( id ) )
  11.                     {
  12.                         if( get_user_team( id ) == 1 )
  13.                         {
  14.                             cs_set_user_money( id, money - cost );
  15.                            
  16.                             give_item( id, "weapon_awp" );
  17.                             cs_set_weapon_ammo( find_ent_by_owner( 1, "weapon_awp", id ), 1 );
  18.                             g_Items[ id ][ Awp ] = true;
  19.                            
  20.                             new szName[ 32 ];
  21.                             get_user_name( id, szName, 31 );
  22.                             set_hudmessage( 255, 255, 0, -1.0, 0.35, 0, 0.0, 12.0, 0.1, 0.2, 4 );
  23.                             show_hudmessage( 0, "%s bought an AWP with 1 bullet! BEWARE CTS!!", szName );
  24.                         }
  25.                         else
  26.                         {
  27.                             client_print( id, print_chat, "%s You must be a terrorist to buy this item!", prefix );
  28.                             return PLUGIN_HANDLED;
  29.                         }
  30.                     }
  31.                     else if( !is_user_alive( id ) )
  32.                     {
  33.                         client_print( id, print_chat, "%s You must be alive to use the shop!", prefix );
  34.                         return PLUGIN_HANDLED;
  35.                     }
  36.                 }
  37.                 else if( g_Items[ id ][ Awp ] )
  38.                 {
  39.                     client_print( id, print_chat, "%s You already bought this item!", prefix );
  40.                     return PLUGIN_HANDLED;
  41.                 }
  42.             }
  43.             else if( money < cost )
  44.             {
  45.                 client_print( id, print_chat, "%s You do not have enough money for this!", prefix );
  46.                 return PLUGIN_HANDLED;
  47.             }
  48.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement