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

Music plugin error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
batu07040
Junior Member
Join Date: Dec 2016
Old 07-10-2017 , 19:43   Music plugin error
Reply With Quote #1

PHP Code:


#include <amxmodx>


new yasak[33]

public 
plugin_init() 

    
register_plugin("RoundSound","1.0","PaintLancer")
    
register_event("SendAudio""t_win""a""2&%!MRAD_terwin")
    
register_event("HLTV""elbasi""a""1=0""2=0")
    
register_clcmd("say /ac","ac")
    
register_clcmd("say /kapat","kapat")
    
}

public 
elbasi()
{
    
    
set_task2.0"stopsound" )
    
}

public 
t_win()
{
    
    
set_task(0.1"kontrol")
    
}

public 
ac(id)
{
    
    
yasak[id]    =    0
}

public 
kapat(id)
{
    
    
yasak[id]    =    1
}

public 
kontrol(id)
{
    if(
yasak[id] == 1)
    {
        
client_printc(id"!t[-!g Hasik[TR] !t-] !nEl Sonu Muzigi Acmak Icin Say'dan !t/ac !nYazmalisiniz !")
    }
    else if(
yasak[id] == 0)
    {
        
muzik(id)
        
client_printc(id"!t[-!g Hasik[TR] !t-] !nEl Sonu Muzigi Kapatmak Icin Say'dan !t/kapat !nYazmalisiniz !")
    }
}
public 
muzik(id)
{
    
    
client_cmd(id,"spk misc/118music")
    
    
}


public 
plugin_precache() 
{
    
precache_sound("misc/118music.wav")
    
    return 
PLUGIN_CONTINUE
}

stock client_printc(const id, const input[], any:...) 

    new 
count 1players[32]; 
    static 
msg[191]; 
    
vformat(msg190input3); 
    
    
replace_all(msg190"!n""^x01");
    
replace_all(msg190"!g""^x04");     
    
replace_all(msg190"!t""^x03");
    
    if (
idplayers[0] = id; else get_players(playerscount"ch"); { 
        for (new 
0counti++) 
        { 
            if (
is_user_connected(players[i])) 
            { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 

Hello, friends I have added the code to turn off / off the music to turn off the music, but the music does not turn off when I write / turn off

Last edited by batu07040; 07-10-2017 at 20:12.
batu07040 is offline
sayf118
Member
Join Date: Jul 2017
Old 07-12-2017 , 13:42   Re: Music plugin error
Reply With Quote #2

try this:
Quote:
#include <amxmodx>


new yasak[33]

public plugin_init()
{
register_plugin("RoundSound","1.0","PaintLanc er")
register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
register_event("HLTV", "elbasi", "a", "1=0", "2=0")
register_clcmd("say /ac","ac")
register_clcmd("say /kapat","kapat")
register_clcmd("say /turn off","elbasi")

}

public elbasi()
{

set_task( 2.0, "stopsound" )

}

public t_win()
{

set_task(0.1, "kontrol")

}

public ac(id)
{

yasak[id] = 0
}

public kapat(id)
{

yasak[id] = 1
}

public kontrol(id)
{
if(yasak[id] == 1)
{
client_printc(id, "!t[-!g Hasik[TR] !t-] !nEl Sonu Muzigi Acmak Icin Say'dan !t/ac !nYazmalisiniz !")
}
else if(yasak[id] == 0)
{
muzik(id)
client_printc(id, "!t[-!g Hasik[TR] !t-] !nEl Sonu Muzigi Kapatmak Icin Say'dan !t/kapat !nYazmalisiniz !")
}
}
public muzik(id)
{


client_cmd(id,"spk misc/118music")


}


public plugin_precache()
{
precache_sound("misc/118music.wav")

return PLUGIN_CONTINUE
}

stock client_printc(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);

replace_all(msg, 190, "!n", "^x01");
replace_all(msg, 190, "!g", "^x04");
replace_all(msg, 190, "!t", "^x03");

if (id) players[0] = id; else get_players(players, count, "ch"); {
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
sayf118 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 07:58.


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