Raised This Month: $ Target: $400
 0% 

Blocking input while dead


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-27-2007 , 20:24   Re: Blocking input while dead
Reply With Quote #3

you mean?

PHP Code:
#include <amxmodx>
#include <engine>

public plugin_init() {
    
register_plugin("LOL","ROFL","PWN");
    
    
register_cvar("mp_deathblock","0");
    
    
register_message(get_user_msgid("DeathMsg"),"message");
    
    new 
mod[32];
    
get_modname(mod,31);
    
    if(
equal(mod,"ts")) {
        
register_message(get_user_msgid("TSMessage"),"message");
        
register_cvar("mp_tsmessageblock","0");
    }
}

public 
message(msg_id,msg_dest,msg_entity) {
    new 
mod[32];
    
get_modname(mod,31);
    if(
msg_id == get_user_msgid("DeathMsg")) {
        if(
get_cvar_num("mp_deathblock") >= 1) {
            return 
PLUGIN_HANDLED;
        }
    }
    if(
equal(mod,"ts")) {
        if(
msg_id == get_user_msgid("TSMessage")) {
            if(
get_cvar_num("mp_tsmessageblock") >= 1) {
                new 
msg[92];
                
get_msg_arg_string(6,msg,91);
                if(!
is_integer(msg) && !equal(msg,"Press Fire To Play!")) {
                    return 
PLUGIN_HANDLED;
                }
            }
        }
    }
    return 
PLUGIN_CONTINUE;
}

stock bool:is_integer(str[]) {
    new 
istr str_to_num(str);
    new 
restr[32];
    
num_to_str(istr,restr,31);
    if(
equal(str,restr)) {
        return 
true;
    }
    return 
false;

X-Script 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 16:10.


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