28.08.2013, 10:17
Hi i need script to open dialog where i choose what song i want to play for all players. Thanks in advance.
CMD:stream(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new url[200];
if(sscanf(params,"s[200]", url)) return SendClientMessage(playerid, 0x9C9C9CAA,"Syntax: /stream [url]");
foreach(Player, i)
{
PlayAudioStreamForPlayer(i, url);
}
}
return 1;
}
what about simple command where you just put link? You will need ZCMD, sscanf and foreach
pawn Код:
|
plugins sscanf
// OR if it's LINUX, ignore the above.
plugins sscanf.so
// At the top
#include <a_samp>
#include <foreach>
#include <sscanf2>
#include <zcmd>
foreach(new i : Player)
#include <a_samp>
#include <foreach>
#include <sscanf2>
#include <zcmd>
main() {}
public OnGameModeInit()
{
return 1;
}
// some other callbacks
CMD:stream(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new url[200];
if(sscanf(params,"s[200]", url)) return SendClientMessage(playerid, 0x9C9C9CAA,"Syntax: /stream [url]");
foreach(new i: Player)
{
PlayAudioStreamForPlayer(i, url);
}
}
return 1;
}
// maybe some functions