[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 Code:
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;
}
EDIT: fixed some logic mistakes
Reply
#2

good, but you can put it to FILTERSCRIPT.
Reply
#3

Going to cause a lot of crashes using this, well pretty much and sound finding will it would be better to use hotkeys in autohotkey for this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)