SA-MP Forums Archive
[Tool/Web/Other] Sounds finder command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [Tool/Web/Other] Sounds finder command (/showthread.php?tid=428766)



Sounds finder command - HurtLocker - 06.04.2013

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;
}



Re: Sounds finder command - Private200 - 07.04.2013

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


Re: Sounds finder command - HurtLocker - 07.04.2013

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


Re: Sounds finder command - Sithis - 17.04.2013

Handy! Thanks for sharing this with us!


Re: Sounds finder command - NicholasA - 17.04.2013

Could be useful in many circuimstances