AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Surf Shop please. (https://forums.alliedmods.net/showthread.php?t=181523)

poliisi299 03-30-2012 08:05

Surf Shop please.
 
Hi all i have surf server and i wan in my surf server shop

shop:

AWP: 5000$
Deagle: 2500
HE Grenade: 1500
Flash: 1000
Smoke: 1000

Please if you know how to make it, make it to me, Thank you

Sory my english

tuty 03-30-2012 08:58

Re: Surf Shop please.
 
Code:
#include < amxmodx > #include < fun > #include < cstrike > #include < hamsandwich > #pragma semicolon 1 #define MAX_PLAYERS  32 + 1 enum _: iShopItems {     ITEM_AWP,     ITEM_DEAGLE,     ITEM_HEGRENADE,     ITEM_FLASH,     ITEM_SMOKE }; new const gShopMenu[ iShopItems ][ ] = {     "Awp",     "Deagle",     "HE Grenade",     "Flash",     "Smoke" }; new const gShopPrices[ iShopItems ] = {     5_000,     2_500,     1_500,     1_000,     1_000 }; new bItemBought[ MAX_PLAYERS ][ iShopItems ]; public plugin_init( ) {     register_plugin( "Surf Shop", "1.0.1", "tuty" );         RegisterHam( Ham_Spawn, "player", "bacon_Spawned", 1 );         register_clcmd( "say /surfshop", "CommandShop" );     register_clcmd( "say_team /surfshop", "CommandShop" ); } public bacon_Spawned( id ) {     if( is_user_alive( id ) )     {         new i;         for( i = 0; i < iShopItems; i++ )         {             bItemBought[ id ][ i ] = 0;         }     } } public CommandShop( id ) {     if( !is_user_alive( id ) )     {         client_print( id, print_chat, "You must be alive to buy items!" );             return PLUGIN_HANDLED;     }         new iMenu = menu_create( "\rChoose Item!", "menu_ShopHandler" );         new szFormatMenu[ 400 ], idString[ 3 ], i;         for( i = 0; i < iShopItems; i++ )     {         formatex( szFormatMenu, charsmax( szFormatMenu ), "\w%s \R\y%d$", gShopMenu[ i ], gShopPrices[ i ] );         num_to_str( i, idString, charsmax( idString ) );                 menu_additem( iMenu, szFormatMenu, idString );     }         menu_display( id, iMenu );     return PLUGIN_CONTINUE; } public menu_ShopHandler( id, menu, item ) {     if( item >= 0 )     {         new access, callback, idString[ 3 ];                menu_item_getinfo( menu, item, access, idString, charsmax( idString ), _, _, callback );                    new iKey = str_to_num( idString );         new iMoney = cs_get_user_money( id );            switch( iKey )         {             case ITEM_AWP:             {                 if( iMoney < gShopPrices[ ITEM_AWP ] )                 {                     client_print( id, print_chat, "You don't have enoug money! You need %d$", gShopPrices[ ITEM_AWP ] );                                         return PLUGIN_HANDLED;                 }                                     if( bItemBought[ id ][ ITEM_AWP ] )                 {                     client_print( id, print_chat, "You already bought this item!" );                                         return PLUGIN_HANDLED;                 }                 give_item( id, "weapon_awp" );                 cs_set_user_bpammo( id, CSW_AWP, 80 );                 client_print( id, print_chat, "You have bought a AWP!" );                 cs_set_user_money( id, iMoney - gShopPrices[ ITEM_AWP ], 1 );                 bItemBought[ id ][ ITEM_AWP ] = 1;             }                         case ITEM_DEAGLE:             {                 if( iMoney < gShopPrices[ ITEM_DEAGLE ] )                 {                     client_print( id, print_chat, "You don't have enoug money! You need %d$", gShopPrices[ ITEM_DEAGLE ] );                                         return PLUGIN_HANDLED;                 }                                     if( bItemBought[ id ][ ITEM_DEAGLE ] )                 {                     client_print( id, print_chat, "You already bought this item!" );                                         return PLUGIN_HANDLED;                 }                 give_item( id, "weapon_deagle" );                 cs_set_user_bpammo( id, CSW_DEAGLE, 60 );                 client_print( id, print_chat, "You have bought a Deagle!" );                 cs_set_user_money( id, iMoney - gShopPrices[ ITEM_DEAGLE ], 1 );                 bItemBought[ id ][ ITEM_DEAGLE ] = 1;             }                         case ITEM_HEGRENADE:             {                 if( iMoney < gShopPrices[ ITEM_HEGRENADE ] )                 {                     client_print( id, print_chat, "You don't have enoug money! You need %d$", gShopPrices[ ITEM_HEGRENADE ] );                                         return PLUGIN_HANDLED;                 }                                     if( bItemBought[ id ][ ITEM_HEGRENADE ] )                 {                     client_print( id, print_chat, "You already bought this item!" );                                         return PLUGIN_HANDLED;                 }                 give_item( id, "weapon_hegrenade" );                 client_print( id, print_chat, "You have bought a HE Grenade!" );                 cs_set_user_money( id, iMoney - gShopPrices[ ITEM_HEGRENADE ], 1 );                 bItemBought[ id ][ ITEM_HEGRENADE ] = 1;             }                         case ITEM_FLASH:             {                 if( iMoney < gShopPrices[ ITEM_FLASH ] )                 {                     client_print( id, print_chat, "You don't have enoug money! You need %d$", gShopPrices[ ITEM_FLASH ] );                                         return PLUGIN_HANDLED;                 }                                     if( bItemBought[ id ][ ITEM_FLASH ] )                 {                     client_print( id, print_chat, "You already bought this item!" );                                         return PLUGIN_HANDLED;                 }                 give_item( id, "weapon_flashbang" );                 client_print( id, print_chat, "You have bought a Flash!" );                 cs_set_user_money( id, iMoney - gShopPrices[ ITEM_FLASH ], 1 );                 bItemBought[ id ][ ITEM_FLASH ] = 1;             }                         case ITEM_SMOKE:             {                 if( iMoney < gShopPrices[ ITEM_SMOKE ] )                 {                     client_print( id, print_chat, "You don't have enoug money! You need %d$", gShopPrices[ ITEM_SMOKE ] );                                         return PLUGIN_HANDLED;                 }                                     if( bItemBought[ id ][ ITEM_SMOKE ] )                 {                     client_print( id, print_chat, "You already bought this item!" );                                         return PLUGIN_HANDLED;                 }                 give_item( id, "weapon_smokegrenade" );                 client_print( id, print_chat, "You have bought a Smoke!" );                 cs_set_user_money( id, iMoney - gShopPrices[ ITEM_SMOKE ], 1 );                 bItemBought[ id ][ ITEM_SMOKE ] = 1;             }         }     }         menu_destroy( menu );         return PLUGIN_HANDLED; }

poliisi299 03-30-2012 14:28

Re: Surf Shop please.
 
Thank you so much i really like you )))))
Next time i send you a message if i need you help thank bro ))))

tuty 03-30-2012 15:39

Re: Surf Shop please.
 
1. edit your damn thread looks like crap
2. dont write with bold tags
3. youre welcome

poliisi299 03-30-2012 17:25

Re: Surf Shop please.
 
Quote:

Originally Posted by tuty (Post 1678824)
1. edit your damn thread looks like crap
2. dont write with bold tags
3. youre welcome

But can you edit it ??

in server i can buy max 1 nade, and when i drop the nade i cant buy other so if you can edit it sry my eng


All times are GMT -4. The time now is 14:24.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.