Raised This Month: $ Target: $400
 0% 

No chat plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dj_freeze
Veteran Member
Join Date: Dec 2009
Location: Looking for you!
Old 12-16-2010 , 13:05   No chat plugin
Reply With Quote #1

Hello AlliedModders!

I need a plugin with next functions:

1. It will turn chat off for everyone on server.
2. Admins with any flag can chat.
3. 2 players from top15 can chat.
4. I can add a player to users.ini with flag "m" so he could chat too.

I need this plugin very much.. Thanks.
dj_freeze is offline
Send a message via Skype™ to dj_freeze
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-16-2010 , 13:59   Re: No chat plugin
Reply With Quote #2

Code:
#include <amxmodx> //#include <amxmisc> #include <csx>   public plugin_init() {         register_clcmd("say", "Say");         register_clcmd("say_team", "Say"); }   public Say(id) {         if (get_user_flags(id)) // is_user_admin(id)                 return PLUGIN_CONTINUE;           new stats[8];           return get_user_stats(id, stats, stats) <= 2 ? PLUGIN_CONTINUE : PLUGIN_HANDLED; }
__________________
hleV is offline
Old 12-16-2010, 14:15
dj_freeze
This message has been deleted by dj_freeze.
dj_freeze
Veteran Member
Join Date: Dec 2009
Location: Looking for you!
Old 12-16-2010 , 14:33   Re: No chat plugin
Reply With Quote #3

Quote:
Originally Posted by hleV View Post
Code:
#include <amxmodx> //#include <amxmisc> #include <csx>   public plugin_init() {         register_clcmd("say", "Say");         register_clcmd("say_team", "Say"); }   public Say(id) {         if (get_user_flags(id)) // is_user_admin(id)                 return PLUGIN_CONTINUE;           new stats[8];           return get_user_stats(id, stats, stats) <= 2 ? PLUGIN_CONTINUE : PLUGIN_HANDLED; }
Sorry man.. Tested on my server but it doesn't work.. Players still can write in chat.
dj_freeze is offline
Send a message via Skype™ to dj_freeze
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-16-2010 , 14:45   Re: No chat plugin
Reply With Quote #4

Quote:
Originally Posted by dj_freeze View Post
Sorry man.. Tested on my server but it doesn't work.. Players still can write in chat.
Make sure you don't have any other chat plugins running.

EDIT:

Checking get_user_flags() doesn't check if player is an admin because non-admins have flags too.

Code:
stock is_user_admin(id) {     return ((get_user_flags(id) & ~ADMIN_USER) > 0); }

So change it to:

Code:
if (get_user_flags(id) & ~ADMIN_USER)
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
dj_freeze
Veteran Member
Join Date: Dec 2009
Location: Looking for you!
Old 12-16-2010 , 14:48   Re: No chat plugin
Reply With Quote #5

I didn't understand what to change :S
Like this?

PHP Code:
#include <amxmodx>
//#include <amxmisc>
#include <csx>
 
public plugin_init()
{
        
register_clcmd("say""Say");
        
register_clcmd("say_team""Say");
}
 
public 
Say(id)
{
        if (
get_user_flags(id) & ~ADMIN_USER)
                return 
PLUGIN_CONTINUE;
 
        new 
stats[8];
 
        return 
get_user_stats(idstatsstats) <= PLUGIN_CONTINUE PLUGIN_HANDLED;


Chat plugins like what?
Only this chat plugins rugging.
adminchat.amxx ; console chat commands
antiflood.amxx ; prevent clients from chat-flooding the server
scrollmsg.amxx ; displays a scrolling message
imessage.amxx ; displays information messages

Last edited by dj_freeze; 12-16-2010 at 14:51.
dj_freeze is offline
Send a message via Skype™ to dj_freeze
visar1
Member
Join Date: Nov 2009
Old 12-16-2010 , 15:14   Re: No chat plugin
Reply With Quote #6

in this
"//#include <amxmisc>"

delete //

;)
visar1 is offline
dj_freeze
Veteran Member
Join Date: Dec 2009
Location: Looking for you!
Old 12-16-2010 , 17:25   Re: No chat plugin
Reply With Quote #7

why?
dj_freeze is offline
Send a message via Skype™ to dj_freeze
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-16-2010 , 17:59   Re: No chat plugin
Reply With Quote #8

Quote:
Originally Posted by dj_freeze View Post
I didn't understand what to change :S
Like this?
Yes, that is all you have to change. You should test before posting.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
dj_freeze
Veteran Member
Join Date: Dec 2009
Location: Looking for you!
Old 12-16-2010 , 18:14   Re: No chat plugin
Reply With Quote #9

Quote:
Originally Posted by Exolent[jNr] View Post
Yes, that is all you have to change. You should test before posting.
Tested. Working. And what is this: //#include <amxmisc> ?
dj_freeze is offline
Send a message via Skype™ to dj_freeze
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-16-2010 , 18:15   Re: No chat plugin
Reply With Quote #10

Quote:
Originally Posted by dj_freeze View Post
Tested. Working. And what is this: //#include <amxmisc> ?
It commented that line from including amxmisc.inc, which has that stock is_user_admin().
hleV decided not to include it, even though it's better to use functions that are already given than reinventing the wheel.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 12:21.


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