Raised This Month: $ Target: $400
 0% 

Catch say


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 06-28-2012 , 16:41   Re: Catch say
Reply With Quote #4

here is some code to give you a hand....
Code:
//init
register_clmd("say", "cmdPM")

public cmdPM(id)
{
	if(!get_pcvar_num(toggle_pcvar) )
		return PLUGIN_CONTINUE
		
	new args[200]; read_args(args, charsmax(args) )
	remove_quotes(args)	// take the raw string
	
	if(args[0] == '/')	// make sure it starts with a /
	{
				// This will get the player index from the defined name
		new player = cmd_target(id, args[1], CMDTARGET_NO_BOTS)
		
		(!player) ? client_print(id, print_chat, "%L", id, "INVALID_PLAYER", target[1]) : displayInfo(player, id)
	}

	return PLUGIN_HANDLED_MAIN
}
Quote:
/wow
This will print that it is a command, the user's ID, and the user's name. I'm still working on it....but that's what i have so far. (its going into one of my plugins as well) it should work fine for you.

EDIT: i edited above's code to be better looking, and working for your use. I C/P'd from my code (which includes ML tag- you can remove that) You'll have to define displayInfo(target, id) yourself to include what you want to display to the caller (id) about the person they want to know (target). It works beautifully, i must say.
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 06-30-2012 at 11:12. Reason: Made code more elegant.
Liverwiz 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 06:06.


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