How to create a command that plays Audio.
#1

Could you give me an example?
PlayAudioStreamForPlayer(playerid,
Reply
#2

https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer
pawn Код:
PlayAudioStreamForPlayer(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
Basically replace the needs inside of it. You can find a url, you can get the players position, ect.
Reply
#3

Код:
CMD:song(playerid, params[])
{
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=237394");
        SendClientMessage(playerid, 0xFFFFFFAA, "Some Message Here.");
        return 1;
}
Reply
#4

I want it to be played for everyone....
Reply
#5

Use a loop then.

Default SA-MP Example:
pawn Код:
CMD:test(playerid, params[]) {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        PlayAudioStreamForPlayer(i, "audiostream");
    }
    return 1;
}
Foreach Example:
pawn Код:
CMD:test(playerid, params[]) {
    foreach(new i: Player) {
        PlayAudioStreamForPlayer(i, "audiostream");
    }
    return 1;
}
Reply
#6

Okay so I want an example.
Command = /play
Range = A bit large
URL = "Example"
Could someone do it for me please?
Reply
#7

Anyone?
Reply
#8

I really need help anyone?
Reply
#9

pawn Код:
CMD:music(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "Syntax: /music [url]");
    {
       PlayAudioStreamForPlayer(playerid, params);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)