Raised This Month: $12 Target: $400
 3% 

Knife Management v3.3 by Jon


Post New Thread Reply   
 
Thread Tools Display Modes
Jon
Veteran Member
Join Date: Dec 2007
Old 08-15-2009 , 09:51   Re: Knife Management v3.0 by Jon
Reply With Quote #11

Quote:
Originally Posted by Arkshine View Post
I think I've misread the code. You want to block the primary attack only. In this case, yes, your way is nice and enough.
Okay. But IF I were to use the offsets to block, would I use Ham_Item_Deploy post and set_pdata_float( iEntity, m_flNextPrimaryAttack ) to 9999.0?

The buying isn't blocked the very first round of a map and I get stripped and given a knife on resethud event.

Last edited by Jon; 08-15-2009 at 10:07.
Jon is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-15-2009 , 10:22   Re: Knife Management v3.0 by Jon
Reply With Quote #12

The buying is effective when you are at least 2, meaning when the game restart. You could add sv_restart 1 in plugin_init(), but since you need at least 2 players to play I think it doesn't matter.

Using the offset, since you want to block only primary, you would need to set in Ham_Item_Deploy and in Ham_Item_SecondaryAttack since both offset are changed there. But your way is more appropriate.
__________________
Arkshine is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 08-15-2009 , 10:37   Re: Knife Management v3.0 by Jon
Reply With Quote #13

Quote:
Originally Posted by Arkshine View Post
The buying is effective when you are at least 2, meaning when the game restart. You could add sv_restart 1 in plugin_init(), but since you need at least 2 players to play I think it doesn't matter.
What about strip and give being called in resethud? (restart, demorecording..)
Jon is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-15-2009 , 11:08   Re: Knife Management v3.0 by Jon
Reply With Quote #14

Ah you right. Never thought to test. It should trigger only when player spawns :-(
__________________
Arkshine is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 08-15-2009 , 11:34   Re: Knife Management v3.0 by Jon
Reply With Quote #15

Quote:
- Never tried yet, but about the respawn stuff, it may interesting to use another condition than game_playerspawn if you use keyvalue
Didn't quite get what you meant with this.
Jon is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-15-2009 , 11:38   Re: Knife Management v3.0 by Jon
Reply With Quote #16

If I have not misread you respawn on death/connect, I was just thinking that you could try to use keyvalue using game_playerdie or game_playerjoin to avoid using forward/natives.
__________________
Arkshine is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 08-15-2009 , 13:58   Re: Knife Management v3.0 by Jon
Reply With Quote #17

I'll look into that later. This is currently my best find of blocking buying and only giving knife, tested on several maps:

PHP Code:
public plugin_precache()
{
    new 
iEntity create_entity"info_map_parameters" );
    
DispatchKeyValueiEntity"buying""3" );
    
DispatchSpawniEntity );
    
    
iEntity create_entity"game_player_equip" );
    
DispatchKeyValueiEntity"weapon_knife""1" );
    
DispatchSpawniEntity );
    
    
RegisterHamHam_Spawn"multi_manager""fwdMultiManagerSpawn" );
}

public 
plugin_init()
{
    
server_cmd"sv_restart 1" );
}

public 
fwdMultiManagerSpawniEntity )
{
    new 
szTargetName33 ];
    
entity_get_stringiEntityEV_SZ_targetnameszTargetName32 );

    if( 
equalszTargetName"game_playerspawn" ) )
    {
        
remove_entityiEntity );
    }

This way I can remove both fun and fakemeta if that means something.

Last edited by Jon; 08-15-2009 at 14:02.
Jon is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-15-2009 , 16:57   Re: Knife Management v3.0 by Jon
Reply With Quote #18

But you strip the weapon when ?
__________________
Arkshine is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 08-15-2009 , 19:44   Re: Knife Management v3.0 by Jon
Reply With Quote #19

Quote:
Originally Posted by Arkshine View Post
But you strip the weapon when ?
Nope, this is the only buyzone blocking and weapon giving related code.
Jon is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-16-2009 , 04:49   Re: Knife Management v3.1 by Jon
Reply With Quote #20

Well for sure, if you can't buy from the start and it's for knife server only, the code is enough. Though you are supposed to remove existent info_map_parameters/game_player_equip if need.
__________________

Last edited by Arkshine; 08-16-2009 at 04:55.
Arkshine is offline
Reply


Thread Tools
Display Modes

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 19:05.


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