Audio Plugin
#1

pawn Код:
#include <a_samp>
#include <audio>
#include <zcmd>
#include <sscanf2>

#define COLOR_RED 0xFF0000FF
#define COLOR_YELLOW 0xFFFF00FF

public OnFilterScriptInit()
{
    Audio_SetPack("default_pack", true);
    return 1;
}

COMMAND:play(playerid, params[])
{
    new audioid;
    if(sscanf(params, "d", audioid)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /play (audioid)");
    {
        Audio_Play(playerid, audioid, false, false, false);
        return 1;
    }
}

COMMAND:stop(playerid, params[])
{
    new handleid;
    if(sscanf(params, "d", handleid)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /stop (handleid)");
    {
        Audio_Stop(playerid, handleid);
        return 1;
    }
}
audio.ini
Код:
[default_pack]
1 = test.wav
2 = test2.wav
3 = test3.wav
archive = CR
archive = SCRIPT
Folder! audiopacks/default_pack:
Код:
test.wav
test2.wav
test3.wav
And yeas, the plugin get loaded (but no sound ingame)
Reply
#2

more info ? whats not working ?
Reply
#3

do you have 1 = test.wav
2 = test2.wav
3 = test3.wav in the default pack folder?
Reply
#4

Quote:
Originally Posted by Donya
Посмотреть сообщение
do you have 1 = test.wav
2 = test2.wav
3 = test3.wav in the default pack folder?
Yes i have the

test.wav
test1.wav
test2.wav
in my default pack folder..

i also have

1 = test.wav
2 = test2.wav
3 = test3.wav

in the audio.ini file


¤oops for got to add info: My problem is that i dont hear any sdond ingame¤
Reply
#5

Is the audio pack transferring to you? Did you read this part of the tutorial?

Quote:
Originally Posted by Incognito
Посмотреть сообщение
In your gamemode, make sure that these things are present:

pawn Код:
public OnGameModeInit()
{
    // Set the audio pack when the gamemode loads
    Audio_SetPack("default_pack", true);
}

public Audio_OnClientConnect(playerid)
{
    // Transfer the audio pack when the player connects
    Audio_TransferPack(playerid);
}

public Audio_OnSetPack(audiopack[])
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        // Transfer the audio pack to all players when it is set
        Audio_TransferPack(i);
    }
}
That will ensure that audio packs are set and transferred correctly (more information is available in the example filterscript).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)