PHP Code:
new g_saytext
// plugin_init
register_clcmd("say", "handleSay")
g_saytext = get_user_msgid("SayText")
public handleSay(id)
{
if(isVIP(id) )
{
new input[192]; read_args(input, charsmax(input) )
remove_quotes(input)
new output[224], name[32]
formatex(output, charsmax(output), "^x04[VIP] ^x03%s^x01: %s", name, input)
// for loop to go through each player in the server
message_begin(MSG_ONE, g_saytext, {0,0,0}, player)
write_byte(player)
write_string(output)
message_end()
}
return PLUGIN_HANDLED_MAIN
}
That's a bit incomplete, as a few bugs will arise at run time. But its enough to get you started.
NOTE: you'll have to put the message code
message_begin to
message_end within a for loop so you can loop through all the players and print the message to them individually. IMPORTANT! messages CAN NOT be sent server-wide (id 0), or the server will crash.
Sorry for incomplete, but i'm lazy. And it wouldn't be fun if i gave you ALL the answers, would it?
__________________