Raised This Month: $12 Target: $400
 3% 

Help with adminchat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rivotril
Senior Member
Join Date: Feb 2014
Location: Argentina
Old 08-14-2018 , 22:40   Help with adminchat
Reply With Quote #1

Hello, i need to remove some symbols from the admin chat (say_team @) of the amx but i don't know how to do that, i need to detect symbols like # and % if the client said that just replace it with nothing, thanks!

Code:
public cmdSayAdmin(id)
{
	new said[2]
	read_argv(1, said, 1)
	
	if (said[0] != '@')
		return PLUGIN_CONTINUE
	
	new message[192], name[32], authid[32], userid
	new players[32], inum
	
	read_args(message, 191)
	remove_quotes(message)
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	
	log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message[1])
	log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message[1])
	
	if (is_user_admin(id))
		format(message, 191, "(%L) %s :  %s", id, "ADMIN", name, message[1])
	else
		format(message, 191, "(%L) %s :  %s", id, "PLAYER", name, message[1])

	get_players(players, inum)
	
	for (new i = 0; i < inum; ++i)
	{
		// dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing
		if (players[i] != id && get_user_flags(players[i]) & g_AdminChatFlag)
			client_print(players[i], print_chat, "%s", message)
	}
	
	client_print(id, print_chat, "%s", message)
	
	return PLUGIN_HANDLED
}
Rivotril is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-14-2018 , 23:49   Re: Help with adminchat
Reply With Quote #2

Use replace_all() to replace characters that you want replaced.
__________________
fysiks is offline
Rivotril
Senior Member
Join Date: Feb 2014
Location: Argentina
Old 08-15-2018 , 00:58   Re: Help with adminchat
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
Use replace_all() to replace characters that you want replaced.
Thanks!
Rivotril is offline
Reply


Thread Tools
Display Modes

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 04:14.


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