06.04.2013, 23:15
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.
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;
}