View Single Post
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-25-2014 , 07:02   Re: Surf Manager by Dosyk v 1.0 [25/08/2014]
Reply With Quote #6

1. Don't use fm_util.
2. Check if amxx version num is 1.8.3, so you won't get symbol already defined on this version.
Code:
#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame
3. Optional, instead of all bool arrays you can create bitsums.
4. Pause the plugin when you are not running a surf map.
5.
Code:
t_red = 0 t_blue = 0 t_green = 0 t_black = 0 red_score = 0 blue_score = 0 green_score = 0 black_score = 0
For me this seems to be useless, everything is initialized with 0( if another value is not specified ).
6. Dont use FM_Think, it's called too many times, use register_think from engine.
7. ResetHud is a poor way for detecting player spawn, use Ham_Spawn instead.
8. Why you are using CurrentWeapon for setting speed, when you already hooked Ham_ItemPreFrame ?
9. All your plugin messages have to be in english.
10. Indent your code.
11.
Code:
new szText[ 555 char ];     format( szText, charsmax( szText ), "%L", id, "SHOP", score[id] );     new menu = menu_create(szText, "shop_handler")     if(is_user_alive(id) && g_HasJetpack[id] == 0 && score[id]>19){              formatex( szText, charsmax( szText ), "\w%L", id, "MENU_JET", get_pcvar_num(price_jet))             menu_additem( menu, szText, "1", 0 )             }     else{         formatex( szText, charsmax( szText ), "\d%L", id, "MENU_JET", get_pcvar_num(price_jet))             menu_additem( menu, szText, "1", 0 )             }     if(is_user_alive(id) && shop_hp[id] == 0 && score[id]>4){         formatex( szText, charsmax( szText ), "\w%L", id, "MENU_HP", get_pcvar_num(hp_amount), get_pcvar_num(price_hp))             menu_additem( menu, szText, "2", 0 )             }     else{         formatex( szText, charsmax( szText ), "\d%L", id, "MENU_HP", get_pcvar_num(hp_amount), get_pcvar_num(price_hp))             menu_additem( menu, szText, "2", 0 )             }     if(is_user_alive(id) && shop_glock[id]==0 && score[id]>14 && arcade==0){         formatex( szText, charsmax( szText ), "\w%L", id, "MENU_GLOCK", get_pcvar_num(price_glock))             menu_additem( menu, szText, "3", 0 )             }     else{         formatex( szText, charsmax( szText ), "\d%L", id, "MENU_GLOCK", get_pcvar_num(price_glock))             menu_additem( menu, szText, "3", 0 )             }     if(is_user_alive(id) && shop_mgun[id]==0 && score[id]>24 && arcade==0){         formatex( szText, charsmax( szText ), "\w%L", id, "MENU_MINIGUN", get_pcvar_num(price_minigun))             menu_additem( menu, szText, "4", 0 )             }     else{         formatex( szText, charsmax( szText ), "\d%L", id, "MENU_MINIGUN", get_pcvar_num(price_minigun))             menu_additem( menu, szText, "4", 0 )             }     if(is_user_alive(id) && hasFrostNade[id]==0 && score[id]>9 && arcade==0){         formatex( szText, charsmax( szText ), "\w%L", id, "MENU_FROST", get_pcvar_num(price_frost))             menu_additem( menu, szText, "5", 0 )             }     else{         formatex( szText, charsmax( szText ), "\d%L", id, "MENU_FROST", get_pcvar_num(price_frost))             menu_additem( menu, szText, "5", 0 )             }     if(is_user_alive(id) && speed[id]==0 && score[id]>6){         formatex( szText, charsmax( szText ), "\w%L", id, "MENU_SPEED", get_pcvar_num(price_speed))             menu_additem( menu, szText, "6", 0 )             }     else{         formatex( szText, charsmax( szText ), "\d%L", id, "MENU_SPEED", get_pcvar_num(price_speed))             menu_additem( menu, szText, "6", 0 )             }     if(is_user_alive(id) && gravity[id]==0 && score[id]>6){         formatex( szText, charsmax( szText ), "\w%L", id, "MENU_GRAVITY", get_pcvar_num(price_gravity))             menu_additem( menu, szText, "7", 0 )             }     else{         formatex( szText, charsmax( szText ), "\d%L", id, "MENU_GRAVITY", get_pcvar_num(price_gravity))             menu_additem( menu, szText, "7", 0 )             }

I'm sure you can find a better way.

12. Why you use both Ham_Killed an DeatMsg ? If you need to detect headshot in Ham_Killed you would need to hook FM_TraceLine and see what the trace hit.

I will stop here, since I can't read more of your code. It seems that all of this is copy/paste, without even uderstanding what you are doing. I doubt that this will get approver.
__________________
HamletEagle is offline