Raised This Month: $ Target: $400
 0% 

[REQ]Deathrun Shop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
rubee
Senior Member
Join Date: Oct 2009
Location: party rocking
Old 12-15-2011 , 15:48   Re: [REQ]Deathrun Shop
Reply With Quote #8

try this

Code:
#include < amxmodx > #include < hamsandwich > #include < cstrike > #include < fun > enum _:OptionsData {     INFO[ 20 ],     COST } new const g_Options[ ][ OptionsData ] = {     { "Deagle", 10000 },     { "Low Gravity", 9000 },     { "Hight Speed", 9000 },     { "Grenades Pack", 12000 },     { "HP & Vest + Helm", 10000 } } new g_MenuID new g_HasSpeed[ 33 ] new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame public plugin_init( ) {     register_plugin( "Deathrun Shop", "1.0", "rube" )         RegisterHam( Ham_Spawn, "player", "HamPlayerSpawnPost", 1 )     // joaquimandrade set speed method     RegisterHam( Ham_Player_ResetMaxSpeed, "player", "HamPlayerResetMaxSpeedPost", 1 )         register_clcmd( "say /shop", "ClcmdShop" )         g_MenuID = menu_create( "Deathrun Shop", "ShopHandler" )         new Data[ 64 ]         for ( new i; i < sizeof g_Options; i++ )     {         formatex( Data, charsmax( Data ), "%s %d$", g_Options[ i ][ INFO ], g_Options[ i ][ COST ])         menu_additem( g_MenuID, Data, _, _, menu_makecallback( "CheckMoney" ) )     } } public ClcmdShop( id ) {     if ( is_user_alive( id ) )         menu_display( id, g_MenuID ) } public CheckMoney( id, menu, item ) return cs_get_user_money( id ) >= g_Options[ item ][ COST ] ? ITEM_ENABLED : ITEM_DISABLED public ShopHandler( id, menu, item ) {     if ( item == MENU_EXIT || !is_user_alive( id ) )         return PLUGIN_HANDLED             switch( item )     {         case 0: cs_set_weapon_ammo( give_item( id, "weapon_deagle" ), 2 )         case 1: set_user_gravity( id, 0.4 )         case 2:         {             g_HasSpeed[ id ] = 1             ExecuteHamB( Ham_Player_ResetMaxSpeed, id )         }         case 3:         {             give_item( id, "weapon_hegrenade")             give_item( id, "weapon_smokegrenade")         }         case 4:         {             set_user_health( id, 300 )             cs_set_user_armor( id, 200, CS_ARMOR_VESTHELM )         }     }         client_print( id, print_chat,"You have bought: %s", g_Options[ item ][ INFO ] )     cs_set_user_money( id, cs_get_user_money( id ) - g_Options[ item ][ COST ] )         return PLUGIN_HANDLED } public HamPlayerSpawnPost(id) g_HasSpeed[ id ] = 0 public HamPlayerResetMaxSpeedPost( id ) {     if ( is_user_alive( id ) && g_HasSpeed[ id ] )         set_user_maxspeed( id, 380.0 ) }
__________________



Last edited by rubee; 12-15-2011 at 15:55.
rubee is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:49.


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