Raised This Month: $ Target: $400
 0% 

Knife Management v3.3 by Jon


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-15-2009 , 09:09   Re: Knife Management v3.0 by Jon
Reply With Quote #4

It seems well coded, though there are some minor things :

- To disable buy and giving weapon, in this case, I would prefer to use keyvalue and letting the engine doing its job without any extra calls each time. And about the buy, I prefer to see the original message saying you can't buy. An example ( it's possible to use Ham_Spawn instead of pnf_keyvalue() :
Code:
    public plugin_precache()     {         new Entity;                 Entity = create_entity( "info_map_parameters" );         DispatchKeyValue( Entity, "buying", "3" );         DispatchSpawn( Entity );                 Entity = create_entity( "player_weaponstrip" );         DispatchKeyValue( Entity, "targetname", "stripper" );         DispatchSpawn( Entity );                 Entity = create_entity( "game_player_equip" );         DispatchKeyValue( Entity, "weapon_knife", "1" );         DispatchKeyValue( Entity, "targetname"  , "equipement" );         DispatchSpawn( Entity );                 Entity = create_entity( "multi_manager" );         DispatchKeyValue( Entity, "equipement", "0.5"   );         DispatchKeyValue( Entity, "stripper"  , "0"     );         DispatchKeyValue( Entity, "targetname", "game_playerspawn" );         DispatchKeyValue( Entity, "spawnflags", "1"     );         DispatchSpawn( Entity );     }         public pfn_keyvalue( Entity )     {         new ClassName[ 20 ];         new KeyName  [ 16 ];         new Value    [ 20 ];                 copy_keyvalue( ClassName, charsmax( ClassName ), KeyName, charsmax( KeyName ), Value, charsmax( Value ) );                 if ( equal( ClassName, "info_map_parameters" ) || equal( ClassName, "player_weaponstrip" ) ||              equal( ClassName, "game_player_equip" )   || equal( ClassName, "func_buyzone" ) )         {             remove_entity( Entity );             return PLUGIN_HANDLED;         }                 return PLUGIN_CONTINUE;     }
- In fwdCmdStart(), you could use directly get_user_weapon() and no need to return FMRES_SUPERCEDE, FMRES_HANDLED is enough. But I would use the weapon's offsets ( m_flNextPrimaryAttack (46) / m_flNextSecondaryAttack (47) ) to block primary/secondary knife attack, it will be more efficient and you would not need to use FM_CmdStart.
- g_iMapType & TYPE_35HP || g_iMapType & TYPE_1HP ) ; you can do g_iMapType & ( TYPE_35HP | TYPE_1HP )
- Adding ML ?
- Never tried yet, but about the respawn stuff, it may interesting to use another condition than game_playerspawn if you use keyvalue, see http://twhl.co.za/wiki.php?id=1082

That's all.
__________________
Arkshine 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 11:01.


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