AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Chat Rooms 1.0 (https://forums.alliedmods.net/showthread.php?t=81321)

shine771 12-02-2008 14:01

Chat Rooms 1.0
 
1 Attachment(s)
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.

Fry! 12-02-2008 14:34

Re: Chat Rooms 0.7
 
Interesants plagins. :)

Eng :

Interesting...

DruGzOG 12-02-2008 14:39

Re: Chat Rooms 0.7
 
Suggestion:

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

shine771 12-02-2008 15:18

Re: Chat Rooms 0.7
 
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?

DruGzOG 12-02-2008 15:28

Re: Chat Rooms 0.7
 
I meant as in they can lockdown their chat room so no one else can enter it

SnoW 12-03-2008 03:49

Re: Chat Rooms 0.7
 
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.

danielkza 12-03-2008 11:38

Re: Chat Rooms 0.7
 
Quote:

Originally Posted by SnoW (Post 722028)
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.

SnoW 12-03-2008 11:41

Re: Chat Rooms 0.7
 
Ah ye, my bad. Didn't even read the code. :I

Reaper2331 12-03-2008 13:34

Re: Chat Rooms 0.7
 
Quote:

Originally Posted by danielkza (Post 722136)
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.

shine771 12-03-2008 15:20

Re: Chat Rooms 0.7
 
No. You would still have to recompile it. Updated. Reread the first post. Take a look at changed too.


All times are GMT -4. The time now is 09:05.

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