Need help.
#1

Hello.
I wanted help with a cmd (only for RCON admins):
/musicall [*******-url]

Sorry for asking for this but I've tried to script one but I can't.

Can anyone help me?
Reply
#2

Yes, show us your code and we help you.
Reply
#3

I can't make it that's why I'm asking.
Reply
#4

Try this (not tested):

Код:
CMD:musicall(playerid,params[])
{
    new link[128];
    if(sscanf(params, "s[128]", link)) return SendClientMessage(playerid, -1, "Use: /musicall [Link]");
    for(new i; i < MAX_PLAYERS; i++)
    {
        PlayAudioStreamForPlayer(i, link);
    }
    return 1;
}
Reply
#5

Thanks I'll test it.
Btw is it with ******* or I need to find a site with .mp3 urls?
Reply
#6

Use this for admins only:
Код:
CMD:musicall(playerid,params[])
{
    new link[128];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Only RCON admins can use this command.");
    if(sscanf(params, "s[128]", link)) return SendClientMessage(playerid, -1, "Use: /musicall [Link]");
    for(new i; i < MAX_PLAYERS; i++)
    {
        PlayAudioStreamForPlayer(i, link);
    }
    return 1;
}
Quote:
Originally Posted by DeathFire
Посмотреть сообщение
Thanks I'll test it.
Btw is it with ******* or I need to find a site with .mp3 urls?
You have to use .mp3 urls.
If you want you can use the ******* Streamer by Michael@Belgium.
Reply
#7

Only for ADMINS?

Код:
CMD:musicall(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new link[128];
if(sscanf(params, "s[128]", link)) return SendClientMessage(playerid, -1, "Use: /musicall [Link]");
for(new i; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, link);
}
}
else return 0;
return 1;
}
Reply
#8

Thanks. +REP
Reply
#9

Less code! (usefoul)
Код:
CMD:musicall(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
new link[128];
if(sscanf(params, "s[128]", link)) return SendClientMessage(playerid, -1, "Use: /musicall [Link]");
for(new i; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, link);
}
return 1;
}
Reply
#10

Quote:
Originally Posted by kalanerik99
Посмотреть сообщение
Less code! (usefoul)
Код:
CMD:musicall(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
new link[128];
if(sscanf(params, "s[128]", link)) return SendClientMessage(playerid, -1, "Use: /musicall [Link]");
for(new i; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, link);
}
return 1;
}
What's the difference?
You just have changed this:
Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Only RCON admins can use this command.");
to this:
Код:
if(!IsPlayerAdmin(playerid)) return 0;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)