Raised This Month: $114 Target: $400
 28% 

Chat Rooms 1.0


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose        Approver:   Hawk552 (427)
shine771
Senior Member
Join Date: Jun 2007
Location: Latvia
Old 12-02-2008 , 15:01   Chat Rooms 1.0
Reply With Quote #1

Chat Rooms
1.0

Description: I really don't know if this has been made before. I searched, but i didn't find anything... Anyway.With this plugin, you can create chat rooms, where you and your friends can chat using '!' or whatever the character you've defined(default is '!'). You can lock and open rooms with voting. When a room is closed, no one can enter it.

Cvars:
amx_chatrooms
<1/0> <On/Off> <default:1>
amx_cr_deadchat <1/0> <1 - if you're dead and others in your chat room are alive, they wont be able to see what you're writing. Default cs chat system. 0 - Everyone in your group will be able to see what you're writing without checking if you're dead or alive.> <default:1>
amx_cr_min_open <number> <Min players to open a room that's locked. If there are more less players than this cvar, the room will open when everyone has voted.> <default:2>
amx_cr_greentext <1/0> <On/Off, chat room chat's text will be displayed in a green color, so you can easily notice it.> <default:1>

Client Commands:
/makeroom
<name> - create a new chat room.
/joinroom <name> - join a specific chat room.
/leaveroom - leave your current room.
/members - displays a list of members currently in chat room.
/room - displays your current room.
/openroom - vote for room opening.
/closeroom - vote for room closing.

When you've joined a chat room, you'll still be able to chat with everyone. You've to write '!' before your text, if you want only the chat room members to see it. Example:
Quote:
!Hi Joe
Output:
(Chatrooms_name)*Status*Nick : Hi Joe

Let's say our chat room's name is: "family", and you're dead. Nick - Joke:

(family)*DEAD*Joke : Hi Joe

If i would be alive:

(family)Joke : Hi joe
If everyone leaves a room > It's automaticly deleted. You can create it again. The good thing about this plugin is, that you don't have to create or join a chat room every time you connect. You just have to set your default chat room, and 5 seconds after you've connected it'll automaticly add you to the chat room you've specified. If the chat room doesn't exist, it'll create it. You can set your default chatroom by setting info in your console:
Quote:
setinfo my_room your_chatroom
For example - i want to join a chat room called: "chickens", after i connect:
Quote:
setinfo my_room chickens
There can be max 6 players in a room, but you can change that number in the source(.sma) file. You can change the chat room chat prefix there too. There is no need to change the max chat rooms number, because there can't be more than 32 players online, and everyone of them can only create 1 room.
Just change these lines:
Quote:
#define CHAT_PREFIX '!' - To change the prefix for chat room chat.
#define MAX_CHATTERS 6 - Max players in one room.
The room will close only when every member has voted to close it. I've changed and added client commands and cvars.

This isn't a 100% tested version. I tested it alone, so i can't be sure if every command works properly!

Changelog:
0.7
*Initial Release
0.8
*Changed cvars and client commands(/openroom to /makeroom - amx_chatroom_deadchat to amx_cr_deadchat)
*Added a room closing/opening system. You can vote to close a room by typing /closeroom and vote to open it again with /openroom.
*Added 2 new cvars: amx_cr_min_open - min players to open a room, amx_cr_greentext - chatrooms text appiers green.
*Added a new client command: /room - displays your current room.
*Seriously optimized the code. Made few stocks, and did a little recoding.
*Added support for *SPEC* flag if you're chatting from spectator.
*Fixed some little bugs. Can't exactly remember..
0.9
*Cleaned code.
1.0
*Optimization.. thanks to hawk.
Attached Files
File Type: sma Get Plugin or Get Source (chatrooms.sma - 1558 views - 11.1 KB)
__________________

Last edited by shine771; 02-06-2009 at 12:44.
shine771 is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 12-02-2008 , 15:34   Re: Chat Rooms 0.7
Reply With Quote #2

Interesants plagins.

Eng :

Interesting...
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 12-02-2008 , 15:39   Re: Chat Rooms 0.7
Reply With Quote #3

Suggestion:

A command such as "close_chat" so people can have their own rooms
__________________

Home of the AMX SUPER
Discord
DruGzOG is offline
Send a message via AIM to DruGzOG
shine771
Senior Member
Join Date: Jun 2007
Location: Latvia
Old 12-02-2008 , 16:18   Re: Chat Rooms 0.7
Reply With Quote #4

DruGzOG, didn't really catch your idea... They already have their own rooms. Only those who know the exact name of the room can enter. You mean completely block the chat? Only allow show the chat room chat? Or what?
__________________
shine771 is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 12-02-2008 , 16:28   Re: Chat Rooms 0.7
Reply With Quote #5

I meant as in they can lockdown their chat room so no one else can enter it
__________________

Home of the AMX SUPER
Discord
DruGzOG is offline
Send a message via AIM to DruGzOG
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 12-03-2008 , 04:49   Re: Chat Rooms 0.7
Reply With Quote #6

Sounds nice. Still I would add the define "MAX_CHATTERS" to a cvar. Also a nice thing to see in next version, would be some kind of color system. So, all chat messages would be red or something else.

Last edited by SnoW; 12-03-2008 at 12:40. Reason: typo
SnoW is offline
Send a message via MSN to SnoW
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-03-2008 , 12:38   Re: Chat Rooms 0.7
Reply With Quote #7

Quote:
Originally Posted by SnoW View Post
Sounds nice. Still I would add add the define "MAX_CHATTERS" to a cvar. Also a nice thing to see in next version, would be some kind of color system. So, all chat messages would be red or something else.
Not possible, MAX_CHATTERS is used to determine array sizes at compile time, so it must be known to the compiler (a cvar obviously is not). He would have to change the plugin to use CellArrays to accomplish unlimited/custom limit chat rooms/chatters.
__________________

Community / No support through PM
danielkza is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 12-03-2008 , 12:41   Re: Chat Rooms 0.7
Reply With Quote #8

Ah ye, my bad. Didn't even read the code. :I
SnoW is offline
Send a message via MSN to SnoW
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 12-03-2008 , 14:34   Re: Chat Rooms 0.7
Reply With Quote #9

Quote:
Originally Posted by danielkza View Post
Not possible, MAX_CHATTERS is used to determine array sizes at compile time, so it must be known to the compiler (a cvar obviously is not). He would have to change the plugin to use CellArrays to accomplish unlimited/custom limit chat rooms/chatters.
is it possible to use a .inc file tho? that would help more than having to recompile it.
__________________

Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
shine771
Senior Member
Join Date: Jun 2007
Location: Latvia
Old 12-03-2008 , 16:20   Re: Chat Rooms 0.7
Reply With Quote #10

No. You would still have to recompile it. Updated. Reread the first post. Take a look at changed too.
__________________
shine771 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:14.


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