This may sound stupid
#1

It is 1:30 AM and I am drawing a blank, how can i have a strcmp command to have it so when someone logged in to RCON types /playforall [URL] it is like PlayAudioStreamForAll [URL] but doesn't have to be programmed in, just pasted after typing /playforall. Like if you type /playforall http://a.tumblr.com/tumblr_m2lhgaUgsv1qmez87o1.mp3 it will say, "Audio Stream: http://a.tumblr.com/tumblr_m2lhgaUgsv1qmez87o1.mp3" and play that. Any help, it is late so my describing isn't the best, nor is my grammar....
Reply
#2

https://sampwiki.blast.hk/wiki/OnRconCommand
Reply
#3

I desperately hope you don't expect rep for that... Do you? Clearly you didn't read what I was asking, I need it so someone can make an input of a URL and that URL plays for everyone.
Reply
#4

Anyone? I really need this...
Reply
#5

Tested & working,
nice song by the way
pawn Код:
if(!strcmp(cmdtext, "/playall", true, 8)) //for samps sake why strcmp, use a command processor better :D
    {
    new url[128];//depending on how long the url size you think will be
    format(url, sizeof(url), "%s",cmdtext[9]);
    if(!IsPlayerAdmin(playerid)) return 0;
    for(new i = 0; i < MAX_PLAYERS; i++) //foreach would be way better
    {
    PlayAudioStreamForPlayer(i,url);
    }
    return 1;
    }
Reply
#6

More info about using Strcmp for commands with and without Strtok can be found here.
Reply
#7

Stop scaming ur post and go sleep
Reply
#8

Quote:
Originally Posted by HellSphinX
Посмотреть сообщение
More info about using Strcmp for commands with and without Strtok can be found here.
Thank you for this sir, I'm not used to script with strcmp commands xD

BTW I edited my first post, tested and working
Reply
#9

Tested, it won't play anything, it has || . Before anything, like "/playall http://mp3.wapos.ru/base/5/b/5/4036/wapos114026.mp3" won't play the song "Whistle" but it will say "Audio Stream: || http://mp3.wapos.ru/base/5/b/5/4036/wapos114026.mp3" and play nothing...
Also if I am logged in to RCON any command I type says "Audio Stream: "
Reply
#10

Quote:
Originally Posted by [MM]18240[FMB]
Посмотреть сообщение
Tested, it won't play anything, it has || . Before anything, like "/playall http://mp3.wapos.ru/base/5/b/5/4036/wapos114026.mp3" won't play the song "Whistle" but it will say "Audio Stream: || http://mp3.wapos.ru/base/5/b/5/4036/wapos114026.mp3" and play nothing...
Also if I am logged in to RCON any command I type says "Audio Stream: "
Weird how i tested it and worked..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)