new Random[][] = [help = rep+]
#1

Код:
new RandomElectro128[][] =
{
	{"http://*******/1uQ2Zb", "song's name"}
}

PlayAudioStreamForPlayer(playerid, RandomElectro128[rand][0]);
SendClientMessage(playerid, -1, "You are listening to %s", RandomElectro128[rand][1]);
how do i do this? rep+ for help
Reply
#2

Here you go :P

pawn Код:
#include <a_samp>

new RandomElectro[][] =
{
    { "http://*******/1uQ2Zb", "song's name" }
};

public OnPlayerConnect(playerid)
{
    new rand = random( sizeof( RandomElectro ) ), string[ 128 ];

    PlayAudioStreamForPlayer(playerid, RandomElectro[ rand ][ 0 ]);

    format(string, sizeof( string ), "You are listening to %s", RandomElectro[ rand ][ 1 ]);
    SendClientMessage( playerid, -1, string );
    return true;
}
NOTE
  • To send a message with a placeholder, you must use the default sa-mp function called format(...);
Reply
#3

It needs to be a 3D array to display the song's name.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)