Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /****************************************************************** pBeatbox ***
- *
- * Scriptname:
- * -» pBeatBox
- *
- * Author:
- * -» Pablo_Borsellino
- *
- * Release Date:
- * -» 6th October 2011
- *
- * Version:
- * -» 1.0
- *
- * Need to use:
- * -» Sa:Mp 0.3c or higher
- *
- * Language:
- * -» English
- *
- * Description:
- * -» With this script you can beat boxing in Sa:Mp. You can hear the beatbox, if
- * -» your GTA San Andreas Audio Options are on and your headphones/speaker are
- * -» on. You have a choice of nine beats and a pause.
- *
- * Functions:
- * -» n/a
- *
- * Public's:
- * -» n/a
- *
- * Credit's:
- * -» Michael_Tempenny for help with the SCM Definition in ICQ!
- *
- * Copyright © 2011 by Pablo_Borsellino
- *******************************************************************************/
- //_____________________________________________________________________Include's
- #include <a_samp>
- //_____________________________________________________________________Setting's
- #define pBEAT_BOX_MLEN 400 //Max. lenght for the Beat's
- #define pBEAT_BOX_TEXT "BEATBOX:" //Text, to write in Chat for Beatbox
- #define pBEAT_BOX_CASE false //Ignore Case for pBEAT_BOX_TEXT in Chat
- //__________________________________________________________________Definition's
- #define SCM(%1) SendClientMessage(playerid,-1,%1)
- //______________________________________________________________________Public's
- public OnPlayerText(playerid,text[])
- {
- if(!strfind(text,pBEAT_BOX_TEXT,pBEAT_BOX_CASE,0))
- {
- new pBeatBox_Text[pBEAT_BOX_MLEN],pBeatBox_Beat[pBEAT_BOX_MLEN],pBeatBox_Lenght;
- format(pBeatBox_Text,sizeof pBeatBox_Text,"%s",text);
- strdel(pBeatBox_Text,0,strlen(pBEAT_BOX_TEXT));
- pBeatBox_Lenght=strlen(pBeatBox_Text);
- for(new i=0;i<pBeatBox_Lenght;i++)
- {
- if(pBeatBox_Lenght==0||(pBeatBox_Text[i]<'0'||pBeatBox_Text[i]>'9')&&pBeatBox_Text[i]!='.'&&pBeatBox_Text[i]!=' ')return ShowValidBeats(playerid);
- if(pBeatBox_Text[i]=='0')strins(pBeatBox_Beat,"zk%20",strlen(pBeatBox_Beat),6);
- else if(pBeatBox_Text[i]=='1')strins(pBeatBox_Beat,"bschk%20",strlen(pBeatBox_Beat),9);
- else if(pBeatBox_Text[i]=='2')strins(pBeatBox_Beat,"pv%20",strlen(pBeatBox_Beat),6);
- else if(pBeatBox_Text[i]=='3')strins(pBeatBox_Beat,"bk%20",strlen(pBeatBox_Beat),6);
- else if(pBeatBox_Text[i]=='4')strins(pBeatBox_Beat,"tk%20",strlen(pBeatBox_Beat),6);
- else if(pBeatBox_Text[i]=='5')strins(pBeatBox_Beat,"vk%20",strlen(pBeatBox_Beat),6);
- else if(pBeatBox_Text[i]=='6')strins(pBeatBox_Beat,"kt%20",strlen(pBeatBox_Beat),6);
- else if(pBeatBox_Text[i]=='7')strins(pBeatBox_Beat,"kttp%20",strlen(pBeatBox_Beat),8);
- else if(pBeatBox_Text[i]=='8')strins(pBeatBox_Beat,"krp%20",strlen(pBeatBox_Beat),7);
- else if(pBeatBox_Text[i]=='9')strins(pBeatBox_Beat,"pv%20",strlen(pBeatBox_Beat),6);
- format(pBeatBox_Beat,sizeof pBeatBox_Beat,"%s",pBeatBox_Beat);
- }
- BeatBox(playerid,pBeatBox_Beat);
- return false;
- }
- return true;
- }
- //____________________________________________________________________Function's
- BeatBox(playerid,BeatBox_Beat[])
- {
- new pBeatBox_Lenght=strlen(BeatBox_Beat),pBeatBox_Text[pBEAT_BOX_MLEN+70];
- for(new i=0;i<pBeatBox_Lenght;i++)
- if(BeatBox_Beat[i]==' ')strdel(BeatBox_Beat,i,i+1);
- format(pBeatBox_Text,sizeof pBeatBox_Text,"http://translate.google.com/translate_tts?ie=UTF-8&q=%s&tl=de&format=bb",BeatBox_Beat);
- PlayAudioStreamForPlayer(playerid,pBeatBox_Text,0,0,0,0,0);
- return 1;
- }
- ShowValidBeats(playerid)
- {
- SCM(#"{"#FFFF00"}""[Beat 0] "#"{"#FF9933"}""\"0\" "#"{"#33AA33"}""»»» for »»» "#"{"#FF9933"}""\"Suspended Cymbal\"");
- SCM(#"{"#FFFF00"}""[Beat 1] "#"{"#FF9933"}""\"1\" "#"{"#33AA33"}""»»» for »»» "#"{"#FF9933"}""\"Snare\"");
- SCM(#"{"#FFFF00"}""[Beat 2] "#"{"#FF9933"}""\"2\" "#"{"#33AA33"}""»»» for »»» "#"{"#FF9933"}""\"Brush\"");
- SCM(#"{"#FFFF00"}""[Beat 3] "#"{"#FF9933"}""\"3\" "#"{"#33AA33"}""»»» for »»» "#"{"#FF9933"}""\"Bass\"");
- SCM(#"{"#FFFF00"}""[Beat 4] "#"{"#FF9933"}""\"4\" "#"{"#33AA33"}""»»» for »»» "#"{"#FF9933"}""\"Flam\"");
- SCM(#"{"#FFFF00"}""[Beat 5] "#"{"#FF9933"}""\"5\" "#"{"#33AA33"}""»»» for »»» "#"{"#FF9933"}""\"Roll Tap\"");
- SCM(#"{"#FFFF00"}""[Beat 6] "#"{"#FF9933"}""\"6\" "#"{"#33AA33"}""»»» for »»» "#"{"#FF9933"}""\"Flam\"");
- SCM(#"{"#FFFF00"}""[Beat 7] "#"{"#FF9933"}""\"7\" "#"{"#33AA33"}""»»» for »»» "#"{"#FF9933"}""\"Hi Hat Tap\"");
- SCM(#"{"#FFFF00"}""[Beat 8] "#"{"#FF9933"}""\"8\" "#"{"#33AA33"}""»»» for »»» "#"{"#FF9933"}""\"Short Roll\"");
- SCM(#"{"#FFFF00"}""[Beat 9] "#"{"#FF9933"}""\"9\" "#"{"#33AA33"}""»»» for »»» "#"{"#FF9933"}""\"Hi Hat\"");
- SCM(#"{"#FFFF00"}""[Beat 10] "#"{"#FF9933"}""\".\" "#"{"#33AA33"}""»»» for »»» "#"{"#FF9933"}""\"Short Break\"");
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement