format [Problem] ( Solved )
the plugin works fine but when you say its dosent change the color!WHY?
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
//#include <vip>
#define PLUGIN "[VIP] Chat Prefix"
#define VERSION "1.0"
#define AUTHOR "Natsheh"
enum
{
Udead = 0,
Ualive
}
new const prefix[] = "[VIP]"
new const stats_prefix[][] = {
"*DEAD*",
"*ALIVE*"
}
new const team_prefix[][] = {
"*Spectator*",
"*Terrorist*",
"*CT*"
}
new msgid_saytext
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
msgid_saytext = get_user_msgid("SayText")
register_message(msgid_saytext, "vip_cmd_saytext")
}
public vip_cmd_saytext(msgid, msgdest, id)
{
if(/*!is_user_vip(id) && */!is_user_connected(id)) return
new sMsg[192], sBuffer[192], szArgs[64], szName[32], szChannel[32]
get_user_name(id, szName, 32-1)
get_msg_arg_string(4, szArgs, 64-1)
get_msg_arg_string(2, szChannel, 32-1)
if(equal(szChannel, "#Cstrike_Chat_All", 16))
{
format(sBuffer, 191, "%s %c%s %c%s: %s", stats_prefix[is_user_alive(id) ? Ualive:Udead],
'^x04', prefix, '^x01', szName, szArgs)
}
else
{
format(sBuffer, 191, "%s %c%s %c%s %c%s: %s", stats_prefix[is_user_alive(id) ? Ualive:Udead],
'^x03', team_prefix[get_user_team(id)], '^x04', prefix, '^x01', szName, szArgs)
}
add(sMsg, 191, sBuffer)
set_msg_arg_string(2, sMsg)
}
|