[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


Messages In This Thread
Sounds finder command - by HurtLocker - 06.04.2013, 23:15
Re: Sounds finder command - by Private200 - 07.04.2013, 06:59
Re: Sounds finder command - by HurtLocker - 07.04.2013, 11:11
Re: Sounds finder command - by Sithis - 17.04.2013, 09:40
Re: Sounds finder command - by NicholasA - 17.04.2013, 14:35

Forum Jump:


Users browsing this thread: 1 Guest(s)