// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#include <a_samp>
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" MP3 Player By [BR]Yahya");
print("--------------------------------------\n");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mp3", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "MP3", "nRevenge - A Minecraft Parody of Usher's DJ got us fallin' love\nOppa Gangnam Style - PSY\nMine - Minecraft Parody of Fly (Nicki Minaj)\nWelcome to the jungle - GunN'Roses\nDiamond - Rihanna\nET - Katy Perry\nLeave out all the rest - Linkin Park\nIn The End - Linkin Park\nTNT - A Minecraft Parody of Cruz's Dynamite ", "Play", "Cancel");
return 1;
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1 && response == 1)
{
if(response)
{
if(listitem == 0)
{
PlayAudioStreamForPlayer(playerid,"http://k007.kiwi6.com/hotlink/7w7a3fidp9/index_php_mp3_Revenge_A_Minecraft_Parody_of_Usher39s_DJ_Got_Us_Fallin39_in_Love_Crafted_Using_Noteblocks_uuid_5134801c706f0.mp3");
}
if(listitem == 1)
{
PlayAudioStreamForPlayer(playerid,"http://k007.kiwi6.com/hotlink/773tu1e8l0/index_php_mp3_PSY_GANGNAM_STYLE_MV_uuid_51348296226c0.mp3");
}
if(listitem == 2)
{
PlayAudioStreamForPlayer(playerid,"http://k007.kiwi6.com/hotlink/x3r01d6p8c/index_php_mp3_Mine_A_Minecraft_Parody_of_Nicki_Minaj_ft_Rihanna_Fly_uuid_513484d6adef9.mp3");
}
if(listitem == 3)
{
PlayAudioStreamForPlayer(playerid,"http://k007.kiwi6.com/hotlink/q8094d58co/index_php_mp3_Guns_N39_Roses_Welcome_To_The_Jungle_uuid_5134871586759.mp3");
}
if(listitem == 4)
{
PlayAudioStreamForPlayer(playerid,"http://k007.kiwi6.com/hotlink/voumwb62zr/index_php_mp3_Rihanna_Diamonds_uuid_5134879e6cc20.mp3");
}
if(listitem == 5)
{
PlayAudioStreamForPlayer(playerid,"http://k007.kiwi6.com/hotlink/zdlzk0i0j1/index_php_mp3_Katy_Perry_ET_ft_Kanye_West_uuid_51348850c3c94.mp3");
}
if(listitem == 6)
{
PlayAudioStreamForPlayer(playerid,"http://k007.kiwi6.com/hotlink/0sjb0e69m9/index_php_mp3_Linkin_Park_Leave_Out_All_The_Rest_HQ_uuid_51348a2ca3392.mp3");
}
if(listitem == 7)
{
PlayAudioStreamForPlayer(playerid,"http://k007.kiwi6.com/hotlink/17fal7h7lv/index_php_mp3_Linkin_Park_In_The_End_uuid_51348b31072da.mp3");
}
if(listitem == 8)
{
PlayAudioStreamForPlayer(playerid,"http://k007.kiwi6.com/hotlink/18efm789q0/tnt_-_a_minecraft_parody_of_taio_cruz_s_dynamite_-_crafted_using_note_blocks_-_*******_1.mp3");
}
}
return 1;
}
return 0;
}
Use "y_commands" for commands (or one of several other command processors), not "strcmp".
|
D:\Bart\Samp Server\filterscripts\MP3.pwn(18) : error 017: undefined symbol "y_commands" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mp3", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "MP3", "nRevenge - A Minecraft Parody of Usher's DJ got us fallin' love\nOppa Gangnam Style - PSY\nMine - Minecraft Parody of Fly (Nicki Minaj)\nWelcome to the jungle - GunN'Roses\nDiamond - Rihanna\nET - Katy Perry\nLeave out all the rest - Linkin Park\nIn The End - Linkin Park\nTNT - A Minecraft Parody of Cruz's Dynamite ", "Play", "Cancel");
return 1;
}
return 1;
}
if(strcmp(cmdtext, "/mp3", true) == 0)
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mp3", cmdtext, true) == 0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "MP3", "nRevenge - A Minecraft Parody of Usher's DJ got us fallin' love\nOppa Gangnam Style - PSY\nMine - Minecraft Parody of Fly (Nicki Minaj)\nWelcome to the jungle - GunN'Roses\nDiamond - Rihanna\nET - Katy Perry\nLeave out all the rest - Linkin Park\nIn The End - Linkin Park\nTNT - A Minecraft Parody of Cruz's Dynamite ", "Play", "Cancel");
return 1;
}
return 0;
}
First of all...
pawn Код:
pawn Код:
So your finished code will be: pawn Код:
|
LENGTH OF THE STRING |
/mp3 is not 10 cells long, it's 4 |
This is pretty much exactly why I told you to use a different command processor - so you don't need to worry about string lengths etc.
|