AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   asking player on connect (https://forums.alliedmods.net/showthread.php?t=347428)

Nutu_ 04-24-2024 12:00

asking player on connect
 
hi there, could someone please do a plugin for me fast?
when the player entered the server he would get a question like

"Do you want to change your mp3 volume?"

with answers:

"1. Yes"
"2. No"

If 1, cliend cmd would change his MP3Volume to 0.02
If no, nothing happens.

I know its not that hard to make, i could make it myself but im really busy these days i have to research first.

thanks indeed!

Tote 04-24-2024 12:18

Re: asking player on connect
 
you cant change client side volume, considered slow hacking read rules.

Tote 04-24-2024 12:19

Re: asking player on connect
 
and there is no better way i think

tedaimlocks 04-24-2024 12:54

Re: asking player on connect
 
HTML Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Ask on connect"
#define VERSION "1.0"
#define AUTHOR "tedaimlocks"

public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
}

public Menu(id) {
        new menu = menu_create("Do you want to change your MP3 volume?", "MenuHandler")
        menu_additem(menu, "Yes", "1")
        menu_additem(menu, "No", "2")
        menu_display(id, menu)
}

public MenuHandler(id, menu, item) {
        switch(item) {
                case 0: {
                        client_cmd(id, "MP3Volume 0.02");
                }
                case 1: {
                        return PLUGIN_HANDLED;
                }
        }
        return PLUGIN_HANDLED;
}

public client_putinserver(id) {
    set_task(5.0, "Menu", id);
}

Quote:

Originally Posted by Tote (Post 2821546)
you cant change client side volume, considered slow hacking read rules.

Its not really a slowhack when the user agrees to it

Nutu_ 04-24-2024 13:19

Re: asking player on connect
 
@tedaimlocks thank you very much, it works

@tote thats why i wanted to ask player first, because i know what slowhacking is

Tote 04-24-2024 13:57

Re: asking player on connect
 
Quote:

Originally Posted by tedaimlocks (Post 2821554)
HTML Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Ask on connect"
#define VERSION "1.0"
#define AUTHOR "tedaimlocks"

public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
}

public Menu(id) {
        new menu = menu_create("Do you want to change your MP3 volume?", "MenuHandler")
        menu_additem(menu, "Yes", "1")
        menu_additem(menu, "No", "2")
        menu_display(id, menu)
}

public MenuHandler(id, menu, item) {
        switch(item) {
                case 0: {
                        client_cmd(id, "MP3Volume 0.02");
                }
                case 1: {
                        return PLUGIN_HANDLED;
                }
        }
        return PLUGIN_HANDLED;
}

public client_putinserver(id) {
    set_task(5.0, "Menu", id);
}


Its not really a slowhack when the user agrees to it

it's still bad way to do it

fysiks 04-24-2024 21:55

Re: asking player on connect
 
Just leave people's settings alone. If they want to change their volume, they can do it in the options.

Nutu_ 04-25-2024 15:04

Re: asking player on connect
 
Quote:

Originally Posted by fysiks (Post 2821581)
Just leave people's settings alone. If they want to change their volume, they can do it in the options.

well not everyone knows every command, thats why i ask them first

fysiks 04-25-2024 23:51

Re: asking player on connect
 
No commands are necessary, it's part of the GUI. Also, there are multiple volume settings (4 of them) and new players should learn about them anyways. If you need to provide guidance, then just do that: Press <ESC>, to to Options, Select "Audio".


All times are GMT -4. The time now is 20:53.

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