SHARE
TWEET

Base builder shop v1.0

CheezPuff Jun 25th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxmodx>
  2. #include <fun>
  3. #include <cstrike>
  4.  
  5. #define PLUGIN  "Shop Menu"
  6. #define VERSION "1.0"
  7. #define AUTHOR  "CheezPuff"
  8.  
  9. public plugin_init()
  10. {
  11.     register_plugin( PLUGIN, VERSION, AUTHOR );
  12.     register_concmd( "say /shop", "ShowMenu" );
  13. }
  14. public ShowMenu( id )
  15. {
  16.     new t1[32]; get_user_team( id, t1, 31 );
  17.     if ( !equal( t1, "CT" ) )
  18.     {
  19.         print_colored( id, "!y[!gZPerfectList!y] !tHumans only can use !tZE !tshop!y." );
  20.         return(PLUGIN_HANDLED);
  21.     }
  22.     new menu = menu_create( "\rPerfectList: \wShop Menu", "MenuHandler" );
  23.     menu_additem( menu, "Forst Nade        \r 1500$" );
  24.     menu_display( id, menu );
  25.     return(PLUGIN_HANDLED);
  26. }
  27. public MenuHandler( id, menu, item )
  28. {
  29.     if ( item == MENU_EXIT )
  30.     {
  31.         menu_destroy( menu );
  32.         return(PLUGIN_HANDLED);
  33.     }
  34.     if ( cs_get_user_money( id ) < 800 )
  35.     {
  36.         print_colored( id, "!tYou don't have enough money !y(!g1500 $!y)" );
  37.         return(PLUGIN_HANDLED);
  38.     }
  39.     switch ( item )
  40.     {
  41.     case 0: {
  42.         if ( cs_get_user_bpammo( id, CSW_HEGRENADE ) >= 1 )
  43.         {
  44.             print_colored( id, "!tYou can't carry more than !g1 !tForst Nade!y." );
  45.             return(PLUGIN_HANDLED);
  46.         }
  47.         give_item( id, "weapon_hegrenade" );
  48.         cs_set_user_money( id, cs_get_user_money( id ) - 1500 );
  49.     }
  50.     }
  51.     menu_destroy( menu );
  52.     return(PLUGIN_HANDLED);
  53. }
  54. /* Color Stocks */
  55. stock print_colored( const id, const input[], any: ... )
  56. {
  57.     new count = 1, players[32], i, player;
  58.     static msg[191];
  59.     if ( numargs() == 2 )
  60.         copy( msg, 190, input );
  61.     else
  62.         vformat( msg, 190, input, 3 );
  63.     replace_all( msg, 190, "!g", "^4" );
  64.     replace_all( msg, 190, "!y", "^1" );
  65.     replace_all( msg, 190, "!t", "^3" );
  66.     if ( id )
  67.     {
  68.         if ( !is_user_connected( id ) ) return;
  69.         players[0] = id;
  70.     } else get_players( players, count, "ch" );
  71.     for ( i = 0; i < count; i++ )
  72.     {
  73.         player = players[i];
  74.         message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, player );
  75.         write_byte( player );
  76.         write_string( msg );
  77.         message_end();
  78.     }
  79. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top