AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block throw weapon (https://forums.alliedmods.net/showthread.php?t=187517)

Diegorkable 06-14-2012 09:43

Block throw weapon
 
How can I use FM_SetModel forward to check if player threw an M4 and block it? (Keep the M4 in his hand)?

Exolent[jNr] 06-14-2012 09:46

Re: Block throw weapon
 
Hook "drop" command and block it if player is holding M4.
Also, hook client buy and block it if player has an M4 and is buying a primary weapon.

Backstabnoob 06-14-2012 13:20

Re: Block throw weapon
 
You should also block "drop weapon_m4a1"

Diegorkable 06-14-2012 13:32

Thank you.

By the way, if I want to log everything that player types in console, weither its in chat or in console.
Will register_clcmd("", "logAll") cover it up? Or is there any other special way?

Backstabnoob 06-14-2012 13:46

Re: Block throw weapon
 
You cannot do that.

Exolent[jNr] 06-14-2012 13:58

Re: Block throw weapon
 
You can use client_command() forward for most commands, but you can't just get anything the player types.

ConnorMcLeod 06-14-2012 15:47

Re: Block throw weapon
 
PHP Code:

    RegisterHam(Ham_CS_Item_CanDrop"weapon_m4a1""CM4A1_CanDrop")
}

public 
CM4A1_CanDrop/* iM4a1 */ )
{
    
SetHamReturnIntegerfalse )
    return 
HAM_SUPERCEDE



Exolent[jNr] 06-14-2012 15:49

Re: Block throw weapon
 
Quote:

Originally Posted by ConnorMcLeod (Post 1728814)
PHP Code:

    RegisterHam(Ham_CS_Item_CanDrop"weapon_m4a1""CM4A1_CanDrop")
}

public 
CM4A1_CanDrop/* iM4a1 */ )
{
    
SetHamReturnIntegerfalse )
    return 
HAM_SUPERCEDE



That work for buying a new primary which would force the m4a1 to drop?

ConnorMcLeod 06-14-2012 16:36

Re: Block throw weapon
 
I don't think so because when you enable nades drop with this way you can still buy different nades types, but not sure at all, the easier is to test.

fysiks 06-14-2012 22:47

Re: Block throw weapon
 
Quote:

Originally Posted by Diegorkable (Post 1728715)
By the way, if I want to log everything that player types in console, weither its in chat or in console.
Will register_clcmd("", "logAll") cover it up? Or is there any other special way?

Are you missing the edit button? Maybe we need to get that fixed for you . . .


All times are GMT -4. The time now is 06:09.

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