why this is giving error?
#1

hey guys,

i want to make random songs for a player when it enters a vehicle and well i have made this:

pawn Code:
new RandomSongs[][] =
{
    {"http://205.196.123.170/3d2pdu41f20g/ek3bk9f6kjgv4gd/Taio+Cruz+Feat.+Flo+Rida+-+Hangover+OFFICIAL+Lyrics.mp3"},
    {"http://205.196.121.51/b2zw0h9e49xg/k3r8hr52zlh685p/Wiz+Khalifa+%26+Snoop+Dogg+-+Young%2C+Wild+%26+Free+Ft.+Bruno+Mars+%28Beyond+the+Video%29.mp3"},
    {"http://205.196.123.34/e9p671v7dm8g/o1vhayconf16141/Avicii+-+Levels.mp3"}
};
and this:
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    PlayAudioStreamForPlayer(playerid, RandomSongs);
    return 1;
}
but it is giving this error...:

Code:
D:\Program Files\Torreto Racing\gamemodes\TorettoRacing.pwn(7912) : error 048: array dimensions do not match
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
why it is giving this error? and how to fix it?

greets niels
Reply
#2

its a array so you have to declare its index
Code:
PlayAudioStreamForPlayer(playerid, RandomSongs[random(sizeof(RandomSongs))]);
will do the job
Reply
#3

ah okay... well eehm i dont understand wut it does else but thnx.. and could you explain?
and yeah it works XD so thnx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)