Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**//**//**//**//**//**//**//**//**/
- /*+--------------------------------+*/
- /*| |*/
- /*| SOUND PLAYER |*/
- /*| FILTERSCRIPT |*/
- /*| bY PSPgamer/FoxHound |*/
- /*| 2 0 0 9 |*/
- /*| |*/
- /*+--------------------------------+*/
- /*| 27 November 2009 |*/
- /*+--------------------------------+*/
- /**//**//**//**//**//**//**//**//**/
- //------< INCLUDEs >------//
- #include <a_samp>
- //------------------------//
- //------< DEFINEs >------//
- #define SoundInputSP 74
- #define SoundsSP 75
- #define SoundsTwoSP 76
- //-----------------------//
- //-----------------------------< OnFilterScriptInit/-Exit >-----------------------------//
- public OnFilterScriptInit()
- {
- print("+--------------------------------+");
- print("| SOUND PLAYER |");
- print("| FILTERSCRIPT |");
- print("| bY PSPgamer/FoxHound |");
- print("| LOADED |");
- print("+--------------------------------+");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("+--------------------------------+");
- print("| SOUND PLAYER |");
- print("| UNLOADED |");
- print("+--------------------------------+");
- return 1;
- }
- //--------------------------------------------------------------------------------------//
- //-----------------------------< OnPlayerCommandText >-----------------------------//
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256];
- new idx;
- cmd = strtok(cmdtext, idx);
- if(strcmp(cmd, "/playsound", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- ShowPlayerDialog(playerid,SoundInputSP,DIALOG_STYLE_INPUT,"INPUT A SOUND ID TO PLAY","Please enter the ID of the Sound,\nthat you want to play.","Enter","Cancel");
- return 1;
- }
- }
- if(strcmp(cmd, "/soundids", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- ShowPlayerDialog(playerid,SoundsSP,DIALOG_STYLE_MSGBOX,"SOUND ID's","1002\n1009\n1027\n1035\n1036\n1039\n1052\n1053\n1054\n1055\n1056\n1057\n1058\n1062(music)\n1063(music)\n1068(music)\n1069(music)\n1076(music)\n1077(music)\n1083\n1084\n1085\n1097(music)\n1098(music)\n1130\n1131\n1132","Close",">>>");
- return 1;
- }
- }
- return 0;
- }
- //---------------------------------------------------------------------------------//
- //---------------------------------< OnDialogResponse >---------------------------------//
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == SoundInputSP)
- {
- if(response == 0)
- {
- return 1;
- }
- if(response == 1)
- {
- new Float:sPosX,Float:sPosY,Float:sPosZ;
- PlayerPlaySound(playerid,strval(inputtext),sPosY,sPosX,sPosZ);
- }
- }
- if(dialogid == SoundsSP)
- {
- if(response == 0)
- {
- ShowPlayerDialog(playerid,SoundsTwoSP,DIALOG_STYLE_MSGBOX,"SOUND ID's","1133\n1134\n1135\n1136\n1137\n1138\n1139\n1140\n1141\n1142\n1143\n1144\n1145\n1147\n1148\n1149\n1150\n1153\n1154\n1163\n1165\n1166\n1169\n1183(music)\n1184\n1185(music)\n1186\n1187(music)\n1188","<<<","Close");
- }
- if(response == 1)
- {
- return 1;
- }
- }
- if(dialogid == SoundsTwoSP)
- {
- if(response == 0)
- {
- return 1;
- }
- if(response == 1)
- {
- ShowPlayerDialog(playerid,SoundsSP,DIALOG_STYLE_MSGBOX,"SOUND ID's","1002\n1009\n1027\n1035\n1036\n1039\n1052\n1053\n1054\n1055\n1056\n1057\n1058\n1062(music)\n1063(music)\n1068(music)\n1069(music)\n1076(music)\n1077(music)\n1083\n1084\n1085\n1097(music)\n1098(music)\n1130\n1131\n1132","Close",">>>");
- return 1;
- }
- }
- return 1;
- }
- //--------------------------------------------------------------------------------------//
- //----------------------------------------------< strtok definiton >--------------------------------------------//
- stock strtok(const string[], &index,seperator=' ')
- {
- new length = strlen(string);
- new offset = index;
- new result[256];
- while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- if ((index < length) && (string[index] == seperator))
- {
- index++;
- }
- return result;
- }
- //---------------------------------------------------------------------------------------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement