new InventoryItems[MAX_ITEMS][] = {
{0, "Sidney Samson and Martin Garrix - Torrent", "http://k007.kiwi6.com/hotlink/s65e1e3suc/Sidney_Samson_and_Martin_Garrix_-_Torrent_mp3cut.net_.mp3"},
{1, "Avicii - Wake Me Up", "http://k007.kiwi6.com/hotlink/nudyhhx2fv/Avicii_-_Avicii_-_Wake_Me_Up_mp3cut.net_.mp3"},
{2, "Die Antwoord - Rich Bitch", "http://k007.kiwi6.com/hotlink/rzw3kc240h/Die_Antwoord_-_Rich_Bitch_mp3cut.net_.mp3"},
{3, "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"},
{4, "Martin Garrix - Animals", "http://k007.kiwi6.com/hotlink/hoz1u3oca1/Martin_Garrix_-_Animals_Official_Video_mp3cut.net_1_.mp3"},
{5, "Hollywood Undead - Undead", "http://k007.kiwi6.com/hotlink/aj6ybbw6d1/Hollywood_Undead_-_Undead_mp3cut.net_.mp3"}
};
stock OnPlayerUseItem(playerid,slot)
{
new songstr[200];
switch(InventoryItems[iItem[playerid][slot]][0])
{
case 0:
{
format(songstr,sizeof(songstr),"%s",InventoryItems[0][0]);
PlayAudioStreamForPlayer(playerid, songstr);
}
case 1:
{
}
case 2:
{
}
case 3:
{
}
case 4:
{
}
case 5:
{
format(songstr,sizeof(songstr),"%s",InventoryItems[5][2]);
PlayAudioStreamForPlayer(playerid, songstr);
}
}
return 1;
}
format(songstr,sizeof(songstr),"%s",InventoryItems[5][2]);
format(songstr,sizeof(songstr),"%s",InventoryItems[0][1]);
new InventoryItems[MAX_ITEMS][] = {
{0, "Sidney Samson and Martin Garrix - Torrent", "http://k007.kiwi6.com/hotlink/s65e1e3suc/Sidney_Samson_and_Martin_Garrix_-_Torrent_mp3cut.net_.mp3"},
{1, "Avicii - Wake Me Up", "http://k007.kiwi6.com/hotlink/nudyhhx2fv/Avicii_-_Avicii_-_Wake_Me_Up_mp3cut.net_.mp3"},
{2, "Die Antwoord - Rich Bitch", "http://k007.kiwi6.com/hotlink/rzw3kc240h/Die_Antwoord_-_Rich_Bitch_mp3cut.net_.mp3"},
{3, "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"},
{4, "Martin Garrix - Animals", "http://k007.kiwi6.com/hotlink/hoz1u3oca1/Martin_Garrix_-_Animals_Official_Video_mp3cut.net_1_.mp3"},
{5, "Hollywood Undead - Undead", "http://k007.kiwi6.com/hotlink/aj6ybbw6d1/Hollywood_Undead_-_Undead_mp3cut.net_.mp3"}
};
stock OnPlayerUseItem(playerid,slot)
{
new songstr[200];
switch(InventoryItems[iItem[playerid][slot]][0])
{
case 0:
{
format(songstr,sizeof(songstr),"%s",InventoryItems[0][0]);
PlayAudioStreamForPlayer(playerid, songstr);
}
case 1:
{
}
case 2:
{
}
case 3:
{
}
case 4:
{
}
case 5:
{
format(songstr,sizeof(songstr),"%s",InventoryItems[0][1]);
PlayAudioStreamForPlayer(playerid, songstr);
}
}
return 1;
}
PHP код:
|
switch(InventoryItems[iItem[playerid][slot]][0])
{
case 0:
{
format(songstr,sizeof(songstr),"%s",InventoryItems[0][0]);
PlayAudioStreamForPlayer(playerid, songstr);
}
i think it should be format(songstr,sizeof(songstr),"%s",InventoryItems[0][3]);
because link is in the 3rd parameter in the array |
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"}
};
if (0 <= slot < sizeof (InventoryItems))
{
PlayAudioStreamForPlayer(playerid, InventoryItems[slot][II_URL]);
}
pawn Код:
pawn Код:
|
if (0 <= slot < sizeof (InventoryItems))