[Tool/Web/Other] Sounds finder command
#1

This is a helpful command which allows you to find the appropriate sound, that you want to add in your scripts.
You start listening to an amount of sounds you define, type just /sounds to stop the looping timer if you found what you were searching for. I made it cause I needed myself to find some sounds and thought of sharing it to help others like me.
pawn Код:
new soundstimer, start, end;
new bool: started;
CMD:sounds(playerid, params[])
{
    if (!sscanf(params, "dd", start, end))
    {
        if (start>end)
        {
            SendClientMessage(playerid, 0xFF0000AA, "Must be: start number < end number.");
        }
        else if (started==false)
        {
            soundstimer=SetTimerEx("slist", 1200, 1, "d", playerid);
            started=true;
        }
        else  SendClientMessage(playerid, 0xFF0000AA, "Some sounds already playing! Use /sounds to stop them.");

    }
    else if (sscanf(params, "dd", start, end) && started==false)
    {
        SendClientMessage(playerid, 0xFF0000AA, "Insert start and end ID number of sounds to play: /sounds [start] [end]");
    }
    else
    {
        KillTimer(soundstimer);
        SendClientMessage(playerid, 0xFF0000AA, "Sounds stopped.");
        started=false;
    }
    return 1;
}
forward slist(playerid);
public slist(playerid)
{
    new str[64];
    format(str, sizeof(str), "Sound Number playing: %d", start);
    SendClientMessage(playerid, 0x00FF00AA, str);
    PlayerPlaySound(playerid, start, 0.0, 0.0, 0.0);

    if (start==end)
    {
        SendClientMessage(playerid, 0xFF0000AA, "Sounds ended!");
        KillTimer(soundstimer);
        started=false;
    }
    start=start+1;
    return 1;
}
Reply
#2

Wrong section though. It's not a tool or script, so it's just an usefull function. You'd better post it here
Reply
#3

I wasn't even aware of the existance of this section man... Anyway, i do consider this as a useful function/tool.
Reply
#4

Handy! Thanks for sharing this with us!
Reply
#5

Could be useful in many circuimstances
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)