Raised This Month: $ Target: $400
 0% 

Sounds + Menus


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Werewolf
Senior Member
Join Date: Jan 2006
Location: Sweden
Old 03-27-2006 , 09:35  
Reply With Quote #6

OK. Here is the code you posted:
Code:
public DoShopMenu(id, key) {     new usermoney = cs_get_user_money(id)     new userhealth = get_user_health(id)     switch(key)     {         case 0:         {             if(usermoney < EXTRA_HP_COST)             {                 return PLUGIN_HANDLED             }                           set_user_health(id, userhealth + EXTRA_HP_AMOUNT)             cs_set_user_money(id, usermoney - EXTRA_HP_COST)             return PLUGIN_CONTINUE         }         case 1:         {             if(usermoney < EXTRA_XP_COST)             {                 return PLUGIN_HANDLED             }                           g_PlayerXP[id] += EXTRA_XP_AMOUNT             cs_set_user_money(id, usermoney - EXTRA_XP_COST)             return PLUGIN_CONTINUE         }         case 2:         {             if(usermoney < EXTRA_SPEED_COST)             {                 return PLUGIN_HANDLED             }                           set_user_maxspeed(id, EXTRA_SPEED * 1.0)             client_cmd(id, "cl_forwardspeed %d",EXTRA_SPEED)             client_cmd(id, "cl_backspeed %d",EXTRA_SPEED)             client_cmd(id, "cl_sidespeed %d",EXTRA_SPEED)             cs_set_user_money(id, usermoney - EXTRA_SPEED_COST)             return PLUGIN_CONTINUE         }     }     return PLUGIN_CONTINUE }

Here is my fixed code:
Code:
public DoShopMenu(id, key) {     new usermoney = cs_get_user_money(id)     new userhealth = get_user_health(id)     switch(key)     {         case 0:         {             if(usermoney < EXTRA_HP_COST)             {                 return PLUGIN_HANDLED             }             set_user_health(id, userhealth + EXTRA_HP_AMOUNT)             cs_set_user_money(id, usermoney - EXTRA_HP_COST)             return PLUGIN_CONTINUE         }         case 1:         {             if(usermoney < EXTRA_XP_COST)             {                 return PLUGIN_HANDLED             }             g_PlayerXP[id] += EXTRA_XP_AMOUNT             cs_set_user_money(id, usermoney - EXTRA_XP_COST)             DeathMsg()             return PLUGIN_CONTINUE         }         case 2:         {             if(usermoney < EXTRA_SPEED_COST)             {                 return PLUGIN_HANDLED             }             set_user_maxspeed(id, EXTRA_SPEED * 1.0)             client_cmd(id, "cl_forwardspeed %d", EXTRA_SPEED)             client_cmd(id, "cl_backspeed %d", EXTRA_SPEED)             client_cmd(id, "cl_sidespeed %d", EXTRA_SPEED)             cs_set_user_money(id, usermoney - EXTRA_SPEED_COST)             return PLUGIN_CONTINUE         }     }     return PLUGIN_CONTINUE }
__________________
~~~~~Hawk~~~~~
Werewolf 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 16:39.


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