Help me with cmd please - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me with cmd please (
/showthread.php?tid=478259)
Help me with cmd please -
PrinceOfPersia - 28.11.2013
Hello guys
Can any one help me and make for me a cmd
CMD for how to play a music for the all players not just me
Just for admins
I'm using ZCMD
Script is scripted by strcmp
Re: Help me with cmd please -
ikbenremco - 29.11.2013
Usage: /streamtoall link SONGNAME SONGARTIST.
PHP код:
CMD:streamtoall(playerid, params[])
{
new song[128], songname[128], songartist[128];
new string[128];
if(sscanf(params, "sss", song, songname, songartist)) return SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /streamtoall [Web link to an audio file. (mp3skull.com)] [Song Name (Underscore for space)] [Song Artist (Underscore for space)]");
for(new i = 0; i < strlen(songname); i++)
{
if(songname[i] == '_')
{
songname[i] = ' ';
}
}
for(new i = 0; i < strlen(songartist); i++)
{
if(songartist[i] == '_')
{
songartist[i] = ' ';
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
format(string, sizeof(string), "Song playing: %s by %s.", songname, songartist);
SendClientMessage(i, COLOR_ORANGE, string);
PlayAudioStreamForPlayer(i, song);
}
}
return 1;
}
To stop the music:
PHP код:
CMD:stopplay(playerid, params[])
{
StopAudioStreamForPlayer(playerid);
SendClientMessage(playerid, COLOR_ORANGE, "Audio stopped!");
return 1;
}