Raised This Month: $ Target: $400
 0% 

Block Kill


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-05-2010 , 16:40   Block Kill
Reply With Quote #1

I used the same method to block kill as I did with blocking drop:

PHP Code:
register_clcmd"drop""cmdDrop" )
register_clcmd"kill""cmdKill" 
PHP Code:
public cmdDrop(id)
{
    if( !
is_user_alive(id) )
    {
        return 
PLUGIN_CONTINUE;
    }
    
    if( 
gLastRequest == true && gToss == false  )
    {
        
client_print_coloridBlue"^4[Jailbreak] ^1You can't drop your weapon during a last request^4!" )
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;

PHP Code:
public cmdKill(id)
{
    if( !
is_user_alive(id) )
    {
        return 
PLUGIN_CONTINUE;
    }
    
    if( 
gInLR[id] == true  )
    {
        
client_print_coloridBlue"^4[Jailbreak] ^1You can't kill yourself during a last request^4!" )
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;

But for some reason it wont work ..
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-05-2010 , 16:43   Re: Block Kill
Reply With Quote #2

Use search button.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-05-2010 , 16:44   Re: Block Kill
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
Use search button.
What I'm trying to ask, is why wont it work the same way as my drop command hook?
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 08-05-2010 , 16:52   Re: Block Kill
Reply With Quote #4

It's not a hookable command.

Search for FM_ClientKill.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-05-2010 , 16:56   Re: Block Kill
Reply With Quote #5

PHP Code:
register_forward(FM_ClientKill"cmdKill"
PHP Code:
public cmdKill(id)
{
    if( 
gInLR[id] == true  )
    {
        
client_print_coloridBlue"^4[Jailbreak] ^1You can't kill yourself during a last request^4!" )
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;

__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 08-05-2010 , 17:03   Re: Block Kill
Reply With Quote #6

PLUGIN_HANDLED -> FMRES_SUPERCEDE
PLUGIN_CONTINUE -> FMRES_IGNORED
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-05-2010 , 17:39   Re: Block Kill
Reply With Quote #7

Code:
#define FMRES_IGNORED	1	// Calls target function, returns normal value
#define FMRES_HANDLED	2	// Tells metamod you did something, still calls target function and returns normal value
#define FMRES_OVERRIDE	3	// Supposed to still call the target function but return your value instead
							// however this does not work properly with metamod; use supercede instead.
#define FMRES_SUPERCEDE	4	// Block the target call, and use your return value (if applicable)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 08-05-2010 , 22:09   Re: Block Kill
Reply With Quote #8

PHP Code:
if (gInLR[id] == true  )
->
if (gInLR[id]) 
Raddish is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 08-06-2010 , 01:02   Re: Block Kill
Reply With Quote #9

PHP Code:
if( gLastRequest && gToss
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
Reply



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 00:17.


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