/* AMXMOD script. 
* 
* (c) Copyright 2000-2002, RAV 
* This file is provided as is (no warranties). 
* 
* Changelog 
* 
* Version 1.1 - Initial Build 
* Version 1.2 - Case sensitivity ignored
* Version 1.3 - Block dead talking to living
* 
* Command ptalk < part of nick > < message >
*/ 

#include <amxmod> 

public p_talk(id)  
{  
	if (read_argc() < 3) {  
		client_print(id,print_console,"[AMX] Usage: ptalk < part of nick > < message >")  
		return PLUGIN_HANDLED  
	}  
	new text[32],name[32]  
	read_args(text,32)  
	parse(text,name,32)  
	new priv = find_player("bl",name)  
	if (priv == 0){  
		client_print(id,print_console,"[AMX] Client with that part of nick not found")  
		return PLUGIN_HANDLED 
	}	
	if (is_user_alive(priv)==1)    { 
		client_print(id,print_console,"[AMX] %s is alive, you cannot talk to him!",priv) 
		return PLUGIN_HANDLED 
        }
	new length = strlen(name)  
	get_user_name(priv,name,32)  
	new message[192]  
	read_args(message,192)  
	new name2[32]  
	get_user_name(id,name2,32)  
	client_print(id,print_chat,"(%s) %s :   %s",name,name2,message[length])  
	client_print(priv,print_chat,"(%s):   %s",name2,message[length])  
	return PLUGIN_HANDLED  
	}  

public client_connect(id){ 
	set_user_flags(id,(1<<25),0)
	return PLUGIN_CONTINUE 
} 

public plugin_init() 
{ 
	register_plugin("Private Talk","1.3","Rav") 
	register_clcmd("ptalk","p_talk",ADMIN_USER,"ptalk < part of nick > < message >") 
	register_cvar(".RVS_PTalk", "1.3",FCVAR_SERVER) 
	return PLUGIN_CONTINUE 
     
} 

