Raised This Month: $ Target: $400
 0% 

adminchat modification [SOLVED]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ehha
SourceMod Donor
Join Date: Apr 2006
Location: Sibiu
Old 03-18-2009 , 16:28   adminchat modification [SOLVED]
Reply With Quote #1

I wanted to modify admin chat to display a amx_chat message if you type @message in say if you have ADMIN_CHAT flag or just @message in normal say chat if yo don't.

Code:
public plugin_init() {     register_clcmd("say", "chat123", ADMIN_ALL, "@stuff") } public chat123(id, level, cid) {     if(get_user_flags(id) & ADMIN_CHAT)         return PLUGIN_CONTINUE     new said[2]     read_argv(1, said, 1)         if (said[0] != '@')         return PLUGIN_CONTINUE         new message[192], name[32], players[32], inum, authid[32], userid         read_args(message, 191)     remove_quotes(message)     get_user_authid(id, authid, 31)     get_user_name(id, name, 31)     userid = get_user_userid(id)     get_players(players, inum)         log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message)     log_message("^"%s<%d><%s><>^" triggered ^"admin_chat^" (text ^"%s^")", name, userid, authid, message)         format(message, 191, "(Admin Chat) %s :   %s", name, message[1])     console_print(id, "%s", message)         for (new i = 0; i < inum; ++i)     {         if (access(players[i], ADMIN_CHAT))             client_print(players[i], print_chat, "%s", message)     }         return PLUGIN_HANDLED }

It works when i have the chat flag but wen i don't it doesn't display anything and i get this in the server's console:
Code:
L 03/18/2009 - 22:02:39: [adminchat.amxx] Chat: "player<5><STEAM_0:1:8796278><>" chat "@test 123"
L 03/18/2009 - 22:02:39: "player<5><STEAM_0:1:8796278><>" triggered "amx_chat" (text "@test 123")
One more thing, after reading the info from the return constants i still don't know how to use the correctly. Can someone explain and perhaps give me 3 examples for PLUGIN_CONTINUE, PLUGIN_HANDLED, PLUGIN_HANDLED_MAIN?
Thank you.

Last edited by ehha; 04-04-2009 at 08:29.
ehha is offline
 


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 09:00.


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