AlliedModders

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

Blue Snake. 09-28-2011 09:22

Block Grenade throw
 
How can I block Grenade throw? No matter if smk, flash or he...

jimaway 09-28-2011 09:26

Re: Block Grenade throw
 
not sure if this works, but you could try:
PHP Code:

#include <csx>
public  grenade_throw indexgreindexwId ) {
return 
PLUGIN_HANDLED



Bugsy 09-28-2011 09:31

Re: Block Grenade throw
 
http://forums.alliedmods.net/showthread.php?t=116327

Blue Snake. 09-28-2011 10:02

Re: Block Grenade throw
 
jimaway, it doesn't work.

Thanks, Bugsy. Worked with supercede.

Blue Snake. 09-30-2011 12:44

Re: Block Grenade throw
 
PHP Code:

#include <amxmodx>
#include <colorchat>
#include <fun>
#include <hamsandwich>

#define PLUGIN    "Give Smoke"
#define AUTHOR    "Blue Snake."
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /smk","cmdSmk")
    
RegisterHam(Ham_Weapon_PrimaryAttack,"weapon_smokegrenade","smkThrow")
}


public 
cmdSmk(id)
{
    if(!
is_user_alive(id))
        
ColorChat(idBLUE,"^x04[Smk]^x01 You must be alive.")
    else
        
give_item(id"weapon_smokegrenade")
    return 
PLUGIN_HANDLED
}


public 
smkThrow(id)
    return 
HAM_SUPERCEDE 


Yes, it works. I can't throw nade. But if I hold mouse1 when I die, the smoke blow up. Any idea? Or any idea to remove the gas?

Evaldas.Grigas 09-30-2011 13:11

Re: Block Grenade throw
 
Maybe make plugin that if player has grenade then he drop it? Then will be no problems.
Why you need code that gives grenade if you don't want it to be used?

Blue Snake. 09-30-2011 13:26

Re: Block Grenade throw
 
Because hide'n'seek players usually like to jump with nades, and I need it on a train server. And nade's smoke = low fps.

And the plugin you're talkin about will remove the nade's blow?

You are talking about this? I go test and edit this post in 5-10 min.
http://forums.alliedmods.net/showthread.php?p=200531

Edit: It doesn't work. If I die w/o click, the nade will be dropped, but if I hold click, the nade will blow up after drop.

Blue Snake. 09-30-2011 16:33

Re: Block Grenade throw
 
Problem sloved.
PHP Code:

public event_death()
    
engclient_cmd(read_data(2),"weapon_knife"



All times are GMT -4. The time now is 19:36.

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