Raised This Month: $ Target: $400
 0% 

MP3 play console command


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

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 #2

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 #3

Quote:
Originally Posted by D4rkSiD3Rs View Post
You've tested it?
Yes I did.
blAck. is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 08-10-2018 , 17:26   Re: MP3 play console command
Reply With Quote #4

Try it with set_task 0.5

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)) 
        { 
            
set_task(0.5"stopmp3"id);
        } 
    } 
}  

public 
stopmp3(id)
{
    
client_cmd(id"mp3 stop"); 


Last edited by D4rkSiD3Rs; 08-10-2018 at 17:30.
D4rkSiD3Rs is offline
blAck.
Member
Join Date: Jun 2018
Old 08-10-2018 , 17:47   Re: MP3 play console command
Reply With Quote #5

Quote:
Originally Posted by D4rkSiD3Rs View Post
Try it with set_task 0.5

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)) 
        { 
            
set_task(0.5"stopmp3"id);
        } 
    } 
}  

public 
stopmp3(id)
{
    
client_cmd(id"mp3 stop"); 

Still not working...
blAck. is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 08-10-2018 , 18:51   Re: MP3 play console command
Reply With Quote #6

Quote:
Originally Posted by blAck. View Post
Still not working...
Maybe because you are testing with ADMIN_BAN flag access?
D4rkSiD3Rs is offline
blAck.
Member
Join Date: Jun 2018
Old 08-10-2018 , 18:52   Re: MP3 play console command
Reply With Quote #7

Quote:
Originally Posted by D4rkSiD3Rs View Post
Maybe because you are testing with ADMIN_BAN flag access?
I'm not... I checked that 1st
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 12:41.


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