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

[NEED HELP] I Want To Do Zombie Plague MP3 Support RoundSound.But One Line Are Wrong!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 02-10-2011 , 06:02   [NEED HELP] I Want To Do Zombie Plague MP3 Support RoundSound.But One Line Are Wrong!
Reply With Quote #1

PHP Code:
 for (0ArraySize(sound_win_zombies); i++)
 {
   
ArrayGetString(sound_win_zombiesibuffercharsmax(buffer))
   
   if (
ArrayGetCell(sound_win_zombies_ismp3i))
   {
    
format(buffercharsmax(buffer), "sound/%s"buffer)
    
engfunc(EngFunc_PrecacheGenericbuffer)
   }
   else
   {
    
engfunc(EngFunc_PrecacheSoundbuffer)
   }
  }
 } 
human_win_ismp3 and no one is same.

I guess if I want to do so then this is the wrong line

for (i = 0; i < ArraySize(sound_win_zombies); i++)

Thanks!
.Dare Devil. is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 02-10-2011 , 07:00   Re: [NEED HELP] I Want To Do Zombie Plague MP3 Support RoundSound.But One Line Are Wr
Reply With Quote #2

u know about *_ismp3 ?
u must scripting this like Ambience Sounds (support mp3)

plugin_precache()
PHP Code:
// Ambience Sounds
if (g_ambience_sounds[AMBIENCE_SOUNDS_INFECTION])
{
    for (
0ArraySize(sound_ambience1); i++)
    {
        
ArrayGetString(sound_ambience1ibuffercharsmax(buffer))
        
        if (
ArrayGetCell(sound_ambience1_ismp3i))
        {
            
format(buffercharsmax(buffer), "sound/%s"buffer)
            
engfunc(EngFunc_PrecacheGenericbuffer)
        }
        else
        {
            
engfunc(EngFunc_PrecacheSoundbuffer)
        }
    }

load_customization_from_files()
PHP Code:
if (equal(key"INFECTION ENABLE"))
    
g_ambience_sounds[AMBIENCE_SOUNDS_INFECTION] = str_to_num(value)
else if (
g_ambience_sounds[AMBIENCE_SOUNDS_INFECTION] && equal(key"INFECTION SOUNDS"))
{
    
// Parse sounds
    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
    {
        
// Trim spaces
        
trim(key)
        
trim(value)
        
        
// Add to sounds array
        
ArrayPushString(sound_ambience1key)
        
ArrayPushCell(sound_ambience1_ismp3equal(key[strlen(key)-4], ".mp3") ? 0)
    }

__________________

Working on:
nothing
schmurgel1983 is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 02-10-2011 , 07:59   Re: [NEED HELP] I Want To Do Zombie Plague MP3 Support RoundSound.But One Line Are Wr
Reply With Quote #3

Quote:
Originally Posted by schmurgel1983 View Post
u know about *_ismp3 ?
u must scripting this like Ambience Sounds (support mp3)

plugin_precache()
PHP Code:
// Ambience Sounds
if (g_ambience_sounds[AMBIENCE_SOUNDS_INFECTION])
{
    for (
0ArraySize(sound_ambience1); i++)
    {
        
ArrayGetString(sound_ambience1ibuffercharsmax(buffer))
 
        if (
ArrayGetCell(sound_ambience1_ismp3i))
        {
            
format(buffercharsmax(buffer), "sound/%s"buffer)
            
engfunc(EngFunc_PrecacheGenericbuffer)
        }
        else
        {
            
engfunc(EngFunc_PrecacheSoundbuffer)
        }
    }

load_customization_from_files()
PHP Code:
if (equal(key"INFECTION ENABLE"))
    
g_ambience_sounds[AMBIENCE_SOUNDS_INFECTION] = str_to_num(value)
else if (
g_ambience_sounds[AMBIENCE_SOUNDS_INFECTION] && equal(key"INFECTION SOUNDS"))
{
    
// Parse sounds
    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
    {
        
// Trim spaces
        
trim(key)
        
trim(value)
 
        
// Add to sounds array
        
ArrayPushString(sound_ambience1key)
        
ArrayPushCell(sound_ambience1_ismp3equal(key[strlen(key)-4], ".mp3") ? 0)
    }

I found better way

PlayMP3Sound(const soundMP3[])
PHP Code:
PlayMP3Sound(const soundMP3[])
{
 
 
client_cmd(0"mp3 play ^"sound/%s^""soundMP3)

and

just playMP3sound(soundMP3)

or this way (Mp3 And wav)

PHP Code:
PlayMP3Sound(const soundMP3[])
{
 
client_cmd(0"mp3 play ^"sound/%s^""soundMP3)
 
client_cmd(0"spk ^"%s^""soundMP3)

.Dare Devil. is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 02-10-2011 , 09:10   Re: [NEED HELP] I Want To Do Zombie Plague MP3 Support RoundSound.But One Line Are Wr
Reply With Quote #4

a better way with errors xD nice one :)
__________________

Working on:
nothing
schmurgel1983 is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 02-10-2011 , 09:34   Re: [NEED HELP] I Want To Do Zombie Plague MP3 Support RoundSound.But One Line Are Wr
Reply With Quote #5

Quote:
Originally Posted by schmurgel1983 View Post
a better way with errors xD nice one
This Way is no errors
PHP Code:
PlayMP3Sound(const soundMP3[])
{
 
client_cmd(0"mp3 play ^"sound/%s^""soundMP3)
 
client_cmd(0"spk ^"%s^""soundMP3)

When is wav mp3 not playng in client side
Only play wav Tested
but thanks for helping .
.Dare Devil. is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 02-10-2011 , 13:24   Re: [NEED HELP] I Want To Do Zombie Plague MP3 Support RoundSound.But One Line Are Wr
Reply With Quote #6

Code:
new Array:sound_win_zombies_ismp3, Array:sound_win_humans_ismp3, Array:sound_win_no_one_ismp3 public plugin_precache() {     sound_win_zombies_ismp3 = ArrayCreate(1, 1)     sound_win_humans_ismp3 = ArrayCreate(1, 1)     sound_win_no_one_ismp3 = ArrayCreate(1, 1)         // Custom sounds     for (i = 0; i < ArraySize(sound_win_zombies); i++)     { //    ArrayGetString(sound_win_zombies, i, buffer, charsmax(buffer)) //    engfunc(EngFunc_PrecacheSound, buffer)                 ArrayGetString(sound_win_zombies, i, buffer, charsmax(buffer))                 if (ArrayGetCell(sound_win_zombies_ismp3, i))         {             format(buffer, charsmax(buffer), "sound/%s", buffer)             engfunc(EngFunc_PrecacheGeneric, buffer)         }         else             engfunc(EngFunc_PrecacheSound, buffer)     }     for (i = 0; i < ArraySize(sound_win_humans); i++)     { //    ArrayGetString(sound_win_humans, i, buffer, charsmax(buffer)) //    engfunc(EngFunc_PrecacheSound, buffer)                 ArrayGetString(sound_win_humans, i, buffer, charsmax(buffer))                 if (ArrayGetCell(sound_win_humans_ismp3, i))         {             format(buffer, charsmax(buffer), "sound/%s", buffer)             engfunc(EngFunc_PrecacheGeneric, buffer)         }         else             engfunc(EngFunc_PrecacheSound, buffer)     }     for (i = 0; i < ArraySize(sound_win_no_one); i++)     { //    ArrayGetString(sound_win_no_one, i, buffer, charsmax(buffer)) //    engfunc(EngFunc_PrecacheSound, buffer)                 ArrayGetString(sound_win_no_one, i, buffer, charsmax(buffer))                 if (ArrayGetCell(sound_win_no_one_ismp3, i))         {             format(buffer, charsmax(buffer), "sound/%s", buffer)             engfunc(EngFunc_PrecacheGeneric, buffer)         }         else             engfunc(EngFunc_PrecacheSound, buffer)     } } // Log Event Round End public logevent_round_end() {     // Show HUD notice, play win sound, update team scores...     static sound[64], iRand, ismp3     if (!fnGetZombies())     {         // Human team wins         set_hudmessage(hred, hgreen, hblue, HUD_EVENT_X, HUD_EVENT_Y, 0, 0.0, 3.0, 2.0, 1.0, -1)         ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "WIN_HUMAN")                 // Play win sound and increase score         ArrayGetString(sound_win_humans, random_num(0, ArraySize(sound_win_humans) - 1), sound, charsmax(sound))         ismp3 = ArrayGetCell(sound_win_humans_ismp3, iRand)                 // Play it on clients         if (ismp3)             client_cmd(0, "mp3 play ^"sound/%s^"", sound)         else             PlaySound(sound)                 g_scorehumans++                 // Round end forward         ExecuteForward(g_fwRoundEnd, g_fwDummyResult, ZP_TEAM_HUMAN);     }     else if (!fnGetHumans())     {         // Zombie team wins         set_hudmessage(nred, zgreen, nblue, HUD_EVENT_X, HUD_EVENT_Y, 0, 0.0, 3.0, 2.0, 1.0, -1)         ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "WIN_ZOMBIE")                 // Play win sound and increase score         ArrayGetString(sound_win_zombies, random_num(0, ArraySize(sound_win_zombies) - 1), sound, charsmax(sound))         ismp3 = ArrayGetCell(sound_win_zombies_ismp3, iRand)                 // Play it on clients         if (ismp3)             client_cmd(0, "mp3 play ^"sound/%s^"", sound)         else             PlaySound(sound)                 g_scorezombies++                 // Round end forward         ExecuteForward(g_fwRoundEnd, g_fwDummyResult, ZP_TEAM_ZOMBIE);     }     else     {         // No one wins         set_hudmessage(nred, zgreen, hblue, HUD_EVENT_X, HUD_EVENT_Y, 0, 0.0, 3.0, 2.0, 1.0, -1)         ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "WIN_NO_ONE")                 // Play win sound         ArrayGetString(sound_win_no_one, random_num(0, ArraySize(sound_win_no_one) - 1), sound, charsmax(sound))         ismp3 = ArrayGetCell(sound_win_no_one_ismp3, iRand)                 // Play it on clients         if (ismp3)             client_cmd(0, "mp3 play ^"sound/%s^"", sound)         else             PlaySound(sound)                 // Round end forward         ExecuteForward(g_fwRoundEnd, g_fwDummyResult, ZP_TEAM_NO_ONE);     } } load_customization_from_files() {     while (file && !feof(file))     {         switch (section)         {             case SECTION_SOUNDS:             {                 if (equal(key, "WIN ZOMBIES"))                 {                     // Parse sounds                     while (value[0] != 0 && strtok(value, key, charsmax(key), value, charsmax(value), ','))                     {                         // Trim spaces                         trim(key)                         trim(value)                                                 // Add to sounds array                         ArrayPushString(sound_win_zombies, key)                         ArrayPushCell(sound_win_zombies_ismp3, equal(key[strlen(key)-4], ".mp3") ? 1 : 0)                     }                 }                 else if (equal(key, "WIN HUMANS"))                 {                     // Parse sounds                     while (value[0] != 0 && strtok(value, key, charsmax(key), value, charsmax(value), ','))                     {                         // Trim spaces                         trim(key)                         trim(value)                                                 // Add to sounds array                         ArrayPushString(sound_win_humans, key)                         ArrayPushCell(sound_win_humans_ismp3, equal(key[strlen(key)-4], ".mp3") ? 1 : 0)                     }                 }                 else if (equal(key, "WIN NO ONE"))                 {                     // Parse sounds                     while (value[0] != 0 && strtok(value, key, charsmax(key), value, charsmax(value), ','))                     {                         // Trim spaces                         trim(key)                         trim(value)                                                 // Add to sounds array                         ArrayPushString(sound_win_no_one, key)                         ArrayPushCell(sound_win_no_one_ismp3, equal(key[strlen(key)-4], ".mp3") ? 1 : 0)                     }                 }             }         }     } }
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 02-10-2011 , 18:34   Re: [NEED HELP] I Want To Do Zombie Plague MP3 Support RoundSound.But One Line Are Wr
Reply With Quote #7

nice georgik57 ^^
i was too lazy.
__________________

Working on:
nothing
schmurgel1983 is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 02-11-2011 , 02:51   Re: [NEED HELP] I Want To Do Zombie Plague MP3 Support RoundSound.But One Line Are Wr
Reply With Quote #8

Wow, That's seem nice one.
Thanks for helping georgik57.
.Dare Devil. is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 02-11-2011 , 10:02   Re: [NEED HELP] I Want To Do Zombie Plague MP3 Support RoundSound.But One Line Are Wr
Reply With Quote #9

i already had it in my zp
so i just had to copy & paste xD
you're welcome xP
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
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 20:02.


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