hlmod.hu
https://hlmod.hu/

Mp3 play
https://hlmod.hu/viewtopic.php?f=9&t=3579
Oldal: 1 / 2

Szerző:  fuck604 [2012.02.29. 19:52 ]
Hozzászólás témája:  Mp3 play

Melyik a helyes?
ez:
Kód:
client_cmd(id, "mp3 ^"%s^"", soundlist[i])

vagy
Kód:
client_cmd(id, "mp3 play ^"%s^"", soundlist[i])

Szerző:  kiki [2012.02.29. 19:54 ]
Hozzászólás témája:  Re: Mp3 play

Második

Szerző:  fuck604 [2012.02.29. 20:05 ]
Hozzászólás témája:  Re: Mp3 play

Kösz!

De Itt akkor most mi a rossz?

Letölti a zenét de nem játssza le mikor belépek.
Kód:
#include <amxmodx>
#define Maxsounds 1
new soundlist[Maxsounds][] = {"misc/kapcsolodas"//zene neve és helye

new plugin_author[] = "White Panther"   // készitő
new plugin_version[] = "1.2.3"          // verzió

public plugin_init( )
{
    
register_plugin("Connect Sound"plugin_versionplugin_author)
    
register_cvar("connectsound_version"plugin_versionFCVAR_SERVER)
}

public 
plugin_precache( )
{
    new 
temp[128], soundfile[128]
    for ( new 
0Maxsoundsa++ )
    {
        
format(temp127"sound/%s.mp3"soundlist[a])
        if ( 
file_exists(temp) )
        {
            
format(soundfile127"%s.mp3"soundlist[a])
            
precache_sound(soundfile)
        }
    }
}

public 
client_putinserverid )
{
    
set_task(1.0"consound"100 id)
}

public 
consoundtimerid_id )
{
    new 
id timerid_id 100
    
new Usertime
    Usertime 
get_user_time(id0)
    if ( 
Usertime <= )
    {
        
set_task(1.0"consound"timerid_id)
    }else
    {
        new 
random(Maxsounds)
        
client_cmd(id"mp3 play ^"%s^""soundlist[i])
    }
    
    return 
PLUGIN_CONTINUE

Szerző:  kiki [2012.02.29. 20:14 ]
Hozzászólás témája:  Re: Mp3 play

new soundlist[Maxsounds][] = {"misc/kapcsolodas"}

-->

new soundlist[Maxsounds][] = {"misc/kapcsolodas.mp3"}

precachenél meg szedd le a végéről az mp3at

Szerző:  fuck604 [2012.02.29. 20:25 ]
Hozzászólás témája:  Re: Mp3 play

Vagyis így?

Kód:
public plugin_precache( )
{
    new temp[128], soundfile[128]
    for ( new a = 0; a < Maxsounds; a++ )
    {
        format(temp, 127, "sound/%s", soundlist[a])
        if ( file_exists(temp) )
        {
            format(soundfile, 127, "%s", soundlist[a])
            precache_sound(soundfile)
        }
    }


És akkor az egész!?:
Kód:
#include <amxmodx>
#define Maxsounds 1
new soundlist[Maxsounds][] = {"misc/kapcsolodas.mp3"} //zene neve és helye

new plugin_author[] = "White Panther"   // készitő
new plugin_version[] = "1.2.3"          // verzió

public plugin_init( )
{
    register_plugin("Connect Sound", plugin_version, plugin_author)
    register_cvar("connectsound_version", plugin_version, FCVAR_SERVER)
}

public plugin_precache( )
{
    new temp[128], soundfile[128]
    for ( new a = 0; a < Maxsounds; a++ )
    {
        format(temp, 127, "sound/%s", soundlist[a])
        if ( file_exists(temp) )
        {
            format(soundfile, 127, "%s", soundlist[a])
            precache_sound(soundfile)
        }
    }
}

public client_putinserver( id )
{
    set_task(1.0, "consound", 100 + id)
}

public consound( timerid_id )
{
    new id = timerid_id - 100
    new Usertime
    Usertime 
= get_user_time(id, 0)
    if ( Usertime <= 0 )
    {
        set_task(1.0, "consound", timerid_id)
    }else
    {
        new i = random(Maxsounds)
        client_cmd(id, "mp3 play ^"%s^"", soundlist[i])
    }
    
    return PLUGIN_CONTINUE



Vagy ez helyett:
Kód:
format(temp, 127, "sound/%s", soundlist[a]) 

Nem ez kell?:
Kód:
format(temp, 127, "sound/misc/%s", soundlist[a])

Szerző:  fear_ezmegmi [2012.02.29. 20:48 ]
Hozzászólás témája:  Re: Mp3 play

Kód:
#include <amxmodx>
#define Maxsounds 1
new soundlist[Maxsounds][] = {"misc/kapcsolodas.mp3"} //zene neve és helye

new plugin_author[] = "White Panther"   // készitő
new plugin_version[] = "1.2.3"          // verzió

public plugin_init( )
{
    register_plugin("Connect Sound", plugin_version, plugin_author)
    register_cvar("connectsound_version", plugin_version, FCVAR_SERVER)
}

public plugin_precache( )
{
    new temp[128], soundfile[128]
    for ( new a = 0; a < Maxsounds; a++ )
    {
        format(temp, 127, "sound/misc/%s", soundlist[a])
        if ( file_exists(temp) )
        {
            format(soundfile, 127, "%s", soundlist[a])
            precache_sound(soundfile)
        }
    }
}

public client_putinserver( id )
{
    set_task(1.0, "consound", 100 + id)
}

public consound( timerid_id )
{
    new id = timerid_id - 100
    new Usertime
    Usertime 
= get_user_time(id, 0)
    if ( Usertime <= 0 )
    {
        set_task(1.0, "consound", timerid_id)
    }else
    {
        new i = random(Maxsounds)
        client_cmd(id, "mp3 play ^"%s^"", soundlist[i])
    }
    
    return PLUGIN_CONTINUE
}

Igy a jó ( elvileg)
ui: kiki mindjárt mondja: WRONG! xd

Szerző:  kiki [2012.02.29. 20:50 ]
Hozzászólás témája:  Re: Mp3 play

Fear ez igy nez ki most: sound/misc/misc/kapcsolodas-mp3

Szerző:  fear_ezmegmi [2012.02.29. 20:51 ]
Hozzászólás témája:  Re: Mp3 play

jaj tényleg xd mondtam ,hogy csak elvileg jó.
akkor az jó amit írtál.

Szerző:  fuck604 [2012.02.29. 21:08 ]
Hozzászólás témája:  Re: Mp3 play

Akkor most ennek jónak kéne lennie:

Kód:
#include <amxmodx>
#define Maxsounds 1
new soundlist[Maxsounds][] = {"misc/kapcsolodas.mp3"} //zene neve és helye

new plugin_author[] = "White Panther"   // készitő
new plugin_version[] = "1.2.3"          // verzió

public plugin_init( )
{
    register_plugin("Connect Sound", plugin_version, plugin_author)
    register_cvar("connectsound_version", plugin_version, FCVAR_SERVER)
}

public plugin_precache( )
{
    new temp[128], soundfile[128]
    for ( new a = 0; a < Maxsounds; a++ )
    {
        format(temp, 127, "sound/%s", soundlist[a])
        if ( file_exists(temp) )
        {
            format(soundfile, 127, "%s", soundlist[a])
            precache_sound(soundfile)
        }
    }
}

public client_putinserver( id )
{
    set_task(1.0, "consound", 100 + id)
}

public consound( timerid_id )
{
    new id = timerid_id - 100
    new Usertime
    Usertime 
= get_user_time(id, 0)
    if ( Usertime <= 0 )
    {
        set_task(1.0, "consound", timerid_id)
    }else
    {
        new i = random(Maxsounds)
        client_cmd(id, "mp3 play ^"%s^"", soundlist[i])
    }
    
    return PLUGIN_CONTINUE
}



Mert nem jó :lol:

Szerző:  kiki [2012.02.29. 21:25 ]
Hozzászólás témája:  Re: Mp3 play

Nem , nézd meg a for ciklus feltételeit és gondolkozz el rajta:)

Oldal: 1 / 2 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/