Advertisement
FoxHound

InGame Sound Player

Mar 7th, 2011
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.64 KB | None | 0 0
  1.                      /**//**//**//**//**//**//**//**//**/
  2.                     /*+--------------------------------+*/
  3.                     /*|                                |*/
  4.                     /*|          SOUND PLAYER          |*/
  5.                     /*|          FILTERSCRIPT          |*/
  6.                     /*|      bY PSPgamer/FoxHound      |*/
  7.                     /*|            2 0 0 9             |*/
  8.                     /*|                                |*/
  9.                     /*+--------------------------------+*/
  10.                     /*|        27 November 2009        |*/
  11.                     /*+--------------------------------+*/
  12.                      /**//**//**//**//**//**//**//**//**/
  13.  
  14. //------< INCLUDEs >------//
  15.     #include <a_samp>
  16. //------------------------//
  17.  
  18. //------< DEFINEs >------//
  19.     #define SoundInputSP 74
  20.     #define SoundsSP 75
  21.     #define SoundsTwoSP 76
  22. //-----------------------//
  23.  
  24. //-----------------------------< OnFilterScriptInit/-Exit >-----------------------------//
  25.     public OnFilterScriptInit()
  26.     {
  27.         print("+--------------------------------+");
  28.         print("|          SOUND PLAYER          |");
  29.         print("|          FILTERSCRIPT          |");
  30.         print("|      bY PSPgamer/FoxHound      |");
  31.         print("|             LOADED             |");
  32.         print("+--------------------------------+");
  33.         return 1;
  34.     }
  35.  
  36.     public OnFilterScriptExit()
  37.     {
  38.         print("+--------------------------------+");
  39.         print("|          SOUND PLAYER          |");
  40.         print("|            UNLOADED            |");
  41.         print("+--------------------------------+");
  42.         return 1;
  43.     }
  44. //--------------------------------------------------------------------------------------//
  45.  
  46. //-----------------------------< OnPlayerCommandText >-----------------------------//
  47.     public OnPlayerCommandText(playerid, cmdtext[])
  48.     {
  49.         new cmd[256];
  50.         new idx;
  51.         cmd = strtok(cmdtext, idx);
  52.         if(strcmp(cmd, "/playsound", true) == 0)
  53.         {
  54.             if(IsPlayerConnected(playerid))
  55.             {
  56.                 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");
  57.                 return 1;
  58.             }
  59.         }
  60.         if(strcmp(cmd, "/soundids", true) == 0)
  61.         {
  62.             if(IsPlayerConnected(playerid))
  63.             {
  64.                 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",">>>");
  65.                 return 1;
  66.             }
  67.         }
  68.         return 0;
  69.     }
  70. //---------------------------------------------------------------------------------//
  71.  
  72. //---------------------------------< OnDialogResponse >---------------------------------//
  73.     public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  74.     {
  75.         if(dialogid == SoundInputSP)
  76.         {
  77.             if(response == 0)
  78.             {
  79.                 return 1;
  80.             }
  81.             if(response == 1)
  82.             {
  83.                 new Float:sPosX,Float:sPosY,Float:sPosZ;
  84.                 PlayerPlaySound(playerid,strval(inputtext),sPosY,sPosX,sPosZ);
  85.             }
  86.         }
  87.         if(dialogid == SoundsSP)
  88.         {
  89.             if(response == 0)
  90.             {
  91.                 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");
  92.             }
  93.             if(response == 1)
  94.             {
  95.                 return 1;
  96.             }
  97.         }
  98.         if(dialogid == SoundsTwoSP)
  99.         {
  100.             if(response == 0)
  101.             {
  102.                 return 1;
  103.             }
  104.             if(response == 1)
  105.             {
  106.                 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",">>>");
  107.                 return 1;
  108.             }
  109.         }
  110.         return 1;
  111.     }
  112. //--------------------------------------------------------------------------------------//
  113.  
  114. //----------------------------------------------< strtok definiton >--------------------------------------------//
  115.     stock strtok(const string[], &index,seperator=' ')
  116.     {
  117.         new length = strlen(string);
  118.         new offset = index;
  119.         new result[256];
  120.         while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
  121.         {
  122.             result[index - offset] = string[index];
  123.             index++;
  124.         }
  125.  
  126.         result[index - offset] = EOS;
  127.         if ((index < length) && (string[index] == seperator))
  128.         {
  129.             index++;
  130.         }
  131.         return result;
  132.     }
  133. //---------------------------------------------------------------------------------------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement