Thread: Emergency Ammo
View Single Post
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-29-2007 , 19:53   Re: Emergency Ammo
Reply With Quote #10

there's a ton of redundant code, just do something like this:

Code:
enum WEAPONS {    MULTIPLIER = 0,    NAME[33] } #define MAX_WEAPONS 2 new g_Weapons[MAX_WEAPONS][WEAPONS] = {    {50,"name"},    {32,"spam"}, }

Then:

Code:
if ( money < ( multi * g_Weapons[Selection][MULTIPLIER] ) )             {                 client_print ( id , print_chat , "[AmxX] You do not have enough money." )             }             else             {                 give_item ( id , g_Weapons[Selection][NAME] )                 cs_set_user_money ( id , money - ( multi * g_Weapons[Selection][MULTIPLIER] ) )             }

Also, please don't use "AmxX" in the print. I mean I'm not going to hold it back for that but it looks pretty retarded.

I'm going to approve it for now but please do as I said.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552