Quote:
Originally Posted by UchihaSkills
OP your plugin cant work if you use this code..
|
Really its a mistake, try this.
PHP Code:
#include <amxmodx>
new p_Message;
public plugin_init()
{
register_plugin("Mensagens padroes",AMXX_VERSION_STR,"Giovanni ;)");
register_message(get_user_msgid("TextMsg"),"message_TextMsg");
p_Message = register_cvar("amx_msg_taking_fire","Taking Fire, Save Me Guys!");
}
public message_TextMsg(iMsg,iDest,iEntity)
{
if(get_msg_args() != 5 || get_msg_argtype(3) != ARG_STRING || get_msg_argtype(5) != ARG_STRING) return PLUGIN_CONTINUE;
new szMessage[32];
get_msg_arg_string(5,szMessage,charsmax(szMessage));
if(equali(szMessage,"#Taking_fire"))
{
static szReplaced[128];
get_pcvar_string(p_Message,szReplaced,charsmax(szReplaced));
if(szReplaced[0])
{
message_begin(iDest,iMsg,_,iEntity);
write_byte(print_chat);
write_string(szReplaced);
message_end();
return PLUGIN_HANDLED; // Replace to PLUGIN_CONTINUE to show original chat message.
}
}
return PLUGIN_CONTINUE;
}
__________________