Raised This Month: $32 Target: $400
 8% 

Voice Rooms


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-24-2016 , 12:22   Voice Rooms
Reply With Quote #1

Voice Rooms (a.k.a TeamSpeak)

You can create or join voicerooms to play with your friends. This means that you will hear and you will be heard only by the members of the room you are joined in. You must write /vr or /voiceroom in chat and a cool menu appears with a lot of convenient options.

Defines:
PHP Code:
#define ADMIN_ACCESS ADMIN_RESERVATION //You can change acces used to create menu when cvar vr_create_admin_only is set to 1 
PHP Code:
#define DICTIONARY_FILE_NAME "voice_rooms.txt" //Dictionary file name which is located in amxmodx/data/lang folder. I don't really recommend to change it since the plugin is public. 
Commands:
say /vr , say /voiceroom - opens voiceroom menu.


Plugin Overview:

  • 1. First option in menu is Create/Clear room. After you create a room then option becomes red and it will be used only to clear the room. When i say clear i mean - kick all players from the room.

    [NOTE]: If you are already in a room and you will select "Create Room" then you will recieve a confirmation submenu which will warn you that you will leave current room if you create new one.


  • 2.. Second option is Joining a room. In this menu rooms are displayed by owner's name.
    You can join only rooms which are not locked and where you are not banned from.
    After you selected a room, you will have to wait answer (Accept or Deny) from owner and you will recieve a message in chat. If owner didn't answer then you will recieve different message.

    [NOTE]: You can't send another request to join other room until you recieve an answer from previous one.


  • 3. Third option displays Members List , you can acces it only if room have at least 1 member (except owner). If you select a player and you are not room's owner then it will just update the list but if you are owner of the room then you will be shown a submenu to choose an action: Kick or Ban player.

    [NOTE]: These are not amx_ban and amx_kick commands, they only kick or ban players from room , not from server. So you can let players with no acces to create rooms if they want.


  • 4. If you are room owner then you can lock and unlock the room with this option.
    While your room is locked , players can't send you request to join.
    I made this feature because some players can spam by sending continuous requests.
    It's very efective after you accepted needed players and now you lock the room so that nobody will disturb you.

    [NOTE]: When you leave a room or disconnect then your room status will be set back to "Unlocked".


  • 5. This option is used to leave a room. I don't think there are needed more explanations.


  • 6. The last one is Speaker mode. When it's private then you will hear only your room's members but if you set it to global then you will hear also players which aren't in any room (only you will hear them , they won't hear you).

    [NOTE]: This option can be disabled by changing cvar "vr_use_speaker_global" to "1" (It won't appear in menu.)


GENERAL NOTE: In some cases menu's options have different colours , for example "Create" and "Clear" Room are white and red. If you want to change them, then you shall go to voice_room.txt lang file and replace colours, which are :

\r - red, \w - white, \y - yellow



Cvars:

vr_enabled "1" - enables/disables plugin.
vr_use_speaker_global "1" - Adds/removes option to activate global speaker (When you are in a room but you can hear players which aren't in any room)
vr_use_sound "0" - If set to 1 then when player joins/leaves a room, specific sounds will be played to members.
vr_silent_chat "0" - If you don't like to see in chat message when player types /vr or /voiceroom then set it to 1.
vr_create_admin_only "0" - If set to 1 then allows only admins to create rooms.
vr_req_autorefuse "9" - Time in seconds in which room owner has to accept or deny a player's request to join the room. Otherwise player will receive a "timeout" message.
vr_talk_rooms_only "0" - If it's enabled ( set to 1) then players with no room won't be able to speak with each other. Basically it disables default room. You will be able to speak and be heard only if you join a room.




Image:



Languages:


Change Log:
  • 1.0 - Initial Release
  • 1.1 - Added g_MaxPlayers in Loops to avoid pointless operations (increase efficiency)
  • 1.2 - Plugin Optimization and Error Fixes. Added new cvar : vr_talk_rooms_only (see it's feature in cvar section above)
Attached Files
File Type: sma Get Plugin or Get Source (voice_rooms.sma - 982 views - 14.8 KB)
File Type: txt voice_rooms.txt (16.5 KB, 201 views)
File Type: zip voice_rooms.zip (19.7 KB, 181 views)

Last edited by siriusmd99; 08-19-2016 at 08:26.
siriusmd99 is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-24-2016 , 12:29   Re: Voice Rooms
Reply With Quote #2

My compiled plugin has 8 kb , when i click get plugin it has 19... Is that 1.8.3 ?
I made this plugin basing myself on 1.8.2 ...
siriusmd99 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 05-24-2016 , 17:25   Re: Voice Rooms
Reply With Quote #3

Great idea
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 05-25-2016 , 08:43   Re: Voice Rooms
Reply With Quote #4

This is awesome! gj
Syturi0 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-25-2016 , 09:08   Re: Voice Rooms
Reply With Quote #5

The way you use braces is inconsistent and you have some indentation issues. These make it a little harder to read your code.

Quote:
Originally Posted by siriusmd99 View Post
My compiled plugin has 8 kb , when i click get plugin it has 19... Is that 1.8.3 ?
I made this plugin basing myself on 1.8.2 ...
That is normal. Newer compilers don't include the 64-bit version of the binary in the .amxx file, IIRC.
__________________
fysiks is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-25-2016 , 10:32   Re: Voice Rooms
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
The way you use braces is inconsistent and you have some indentation issues. These make it a little harder to read your code.



That is normal. Newer compilers don't include the 64-bit version of the binary in the .amxx file, IIRC.
Don't or do?
Because bigger size has file compiled by "get plugin" button, but when I compiled on 1.8.2 it had smaller one.

About braces: I don't use them if there is only 1 instruction after "if". I used amxx studio indenter and it didn't throw any indentation warnings after compiling.

Last edited by siriusmd99; 05-25-2016 at 10:37.
siriusmd99 is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 05-25-2016 , 13:46   Re: Voice Rooms
Reply With Quote #7

Quote:
Originally Posted by siriusmd99 View Post
Don't or do?
Because bigger size has file compiled by "get plugin" button, but when I compiled on 1.8.2 it had smaller one.

About braces: I don't use them if there is only 1 instruction after "if". I used amxx studio indenter and it didn't throw any indentation warnings after compiling.
I think he meant this:
Sometimes you do
PHP Code:
if...{
...

outher times you do
PHP Code:
if...
{
...

Example:
PHP Code:
if(ownid){
    
formatex(szMsg127"%L",LANG_SERVER"MSG_NEW_OWNER"Name)
    for ( 
1<= 32i++ )
    {
        if(
g_room[i] == id){
            
g_room[i] = ownid;
            
client_print(iprint_chatszMsg)
        }             
    }    

Syturi0 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 05-25-2016 , 16:05   Re: Voice Rooms
Reply With Quote #8

I hate when i found this format:

PHP Code:
if... {

I hate it :@
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-25-2016 , 16:44   Re: Voice Rooms
Reply With Quote #9

a.. OK, I will change . I think this is something from indenter or from myself.I don't like too that format because it's hard to trace brackets vector and see beggining and end.

Last edited by siriusmd99; 05-25-2016 at 16:45.
siriusmd99 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-25-2016 , 17:42   Re: Voice Rooms
Reply With Quote #10

Quote:
Originally Posted by EFFx View Post
I hate when i found this format:

PHP Code:
if... {

I hate it :@
There's no right way to write brackets, and there have been countless number of discussions about it, and it's never going to end.
There are also languages in which you just want to use that bracket style, like JavaScript.

Quote:
Originally Posted by siriusmd99 View Post
a.. OK, I will change . I think this is something from indenter or from myself.I don't like too that format because it's hard to trace brackets vector and see beggining and end.
Don't use auto-indenters, just indent the code by yourself. Is that difficult? Most code editors even indent as you write.

Last edited by klippy; 05-25-2016 at 17:44.
klippy 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 17:49.


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