Raised This Month: $51 Target: $400
 12% 

MP3 play console command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blAck.
Member
Join Date: Jun 2018
Old 08-10-2018 , 14:47   MP3 play console command
Reply With Quote #1

I know it's client-side command but I'll still ask.
Can I somehow set a flag for console command "mp3 play ..."?
blAck. is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-10-2018 , 14:52   Re: MP3 play console command
Reply With Quote #2

Code:
client_cmd(PlayerID, "mp3 play *");
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
blAck.
Member
Join Date: Jun 2018
Old 08-10-2018 , 14:58   Re: MP3 play console command
Reply With Quote #3

Quote:
Originally Posted by Ghosted View Post
Code:
client_cmd(PlayerID, "mp3 play *");
yes but how do I check if what player type in the console contains "mp3 play"?
blAck. is offline
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 08-10-2018 , 15:00   Re: MP3 play console command
Reply With Quote #4

What are you trying to do?
Post the code.
__________________
CrAzY MaN is offline
blAck.
Member
Join Date: Jun 2018
Old 08-10-2018 , 15:03   Re: MP3 play console command
Reply With Quote #5

Quote:
Originally Posted by CrAzY MaN View Post
What are you trying to do?
Post the code.
I'm trying to prevent a player from playing a mp3 file with "mp3 play" console command.
I would like to set a flag for that command if it's possible. :-)

Last edited by blAck.; 08-10-2018 at 15:03.
blAck. is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-10-2018 , 15:27   Re: MP3 play console command
Reply With Quote #6

Quote:
Originally Posted by blAck. View Post
I'm trying to prevent a player from playing a mp3 file with "mp3 play" console command.
I would like to set a flag for that command if it's possible. :-)
I think its impossible. But mp3 is only called when client launchs game, not in-game.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 08-10-2018 at 15:28.
Ghosted is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 08-10-2018 , 16:04   Re: MP3 play console command
Reply With Quote #7

PHP Code:
#include <amxmodx>

#define PLUGIN    "MP3 PLAY"
#define VERSION    "1.0"
#define AUTHOR    "~D4rkSiD3Rs~"

#define MP3_ACCESS ADMIN_BAN    // change the access here

new g_cmdLine1[512], g_cmdLine2[512]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_command(id)
{
    
read_argv(0g_cmdLine1511)
    
read_argv(1g_cmdLine2511)

    if(
equali(g_cmdLine1"mp3") && equali(g_cmdLine2"play"))
    {
        if(!(
get_user_flags(id) & MP3_ACCESS))
        {
            
client_cmd(id"mp3 stop");
        }
    }

D4rkSiD3Rs is offline
blAck.
Member
Join Date: Jun 2018
Old 08-10-2018 , 16:50   Re: MP3 play console command
Reply With Quote #8

Quote:
Originally Posted by D4rkSiD3Rs View Post
PHP Code:
#include <amxmodx>

#define PLUGIN    "MP3 PLAY"
#define VERSION    "1.0"
#define AUTHOR    "~D4rkSiD3Rs~"

#define MP3_ACCESS ADMIN_BAN    // change the access here

new g_cmdLine1[512], g_cmdLine2[512]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_command(id)
{
    
read_argv(0g_cmdLine1511)
    
read_argv(1g_cmdLine2511)

    if(
equali(g_cmdLine1"mp3") && equali(g_cmdLine2"play"))
    {
        if(!(
get_user_flags(id) & MP3_ACCESS))
        {
            
client_cmd(id"mp3 stop");
        }
    }

It only stops the song when I type "mp3 play". But when I type "mp3 play sound/radio/..." it still plays the song... :/
blAck. is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 08-10-2018 , 17:19   Re: MP3 play console command
Reply With Quote #9

Quote:
Originally Posted by blAck. View Post
It only stops the song when I type "mp3 play". But when I type "mp3 play sound/radio/..." it still plays the song... :/
You've tested it?
D4rkSiD3Rs is offline
blAck.
Member
Join Date: Jun 2018
Old 08-10-2018 , 17:20   Re: MP3 play console command
Reply With Quote #10

Quote:
Originally Posted by D4rkSiD3Rs View Post
You've tested it?
Yes I did.
blAck. is offline
Reply



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 03:55.


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