Quote:
Originally Posted by Konstantinos
pawn Код:
enum e_InventoryItems { II_Song[53], II_URL[110] };
new InventoryItems[][e_InventoryItems] = { {"Sidney Samson and Martin Garrix - Torrent", "http://k007.kiwi6.com/hotlink/s65e1e3suc/Sidney_Samson_and_Martin_Garrix_-_Torrent_mp3cut.net_.mp3"}, {"Avicii - Wake Me Up", "http://k007.kiwi6.com/hotlink/nudyhhx2fv/Avicii_-_Avicii_-_Wake_Me_Up_mp3cut.net_.mp3"}, {"Die Antwoord - Rich Bitch", "http://k007.kiwi6.com/hotlink/rzw3kc240h/Die_Antwoord_-_Rich_Bitch_mp3cut.net_.mp3"}, {"Calvin Harris feat. Alesso and Hurts - Under Control", "http://k007.kiwi6.com/hotlink/6zctrsw8uf/Calvin_Harris_and_Alesso_-_Under_Control_ft._Hurts_mp3cut.net_1_.mp3"}, {"Martin Garrix - Animals", "http://k007.kiwi6.com/hotlink/hoz1u3oca1/Martin_Garrix_-_Animals_Official_Video_mp3cut.net_1_.mp3"}, {"Hollywood Undead - Undead", "http://k007.kiwi6.com/hotlink/aj6ybbw6d1/Hollywood_Undead_-_Undead_mp3cut.net_.mp3"} };
Check the "slot" parameter from the command if it's valid and use it as index:
pawn Код:
if (0 <= slot < sizeof (InventoryItems)) { PlayAudioStreamForPlayer(playerid, InventoryItems[slot][II_URL]); }
|
pawn Код:
if (0 <= slot < sizeof (InventoryItems))
I don`t understand this line. What you want to say if slot is in minus then what?