Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-----------------------Kaip veikia ką jis daro?----------------------//
- // /skaiciuotuvas - visos jo komandos //
- // Šitas Scriptas Sudeda, Atima , Dalina , Daugina //
- // Šitą scriptą bandysiu atnaujinti kuo dažniau //
- // Scriptą dariau savo malonumui , o ne 'pasipuikuoti' //
- // Scriptą kūriau be pagalbos SCmindė (MindCode) //
- // Scriptas Pradėtas kurti: 2013.06.25 //
- // Scriptas Baigtas kurti: 2013.06.26 //
- // O.T Minato Duhas ! //
- //--------------------THE END GOOD LUCK USING--------------------------//
- #include <a_samp>
- #include <zcmd>
- //pragma
- #pragma tabsize 0
- //definai
- #define PlusPVarInt(%1,%2,%3) SetPVarInt(%1,%2,GetPVarInt(%1,%2)+%3)
- #define MinusPVarInt(%1,%2,%3) SetPVarInt(%1,%2,GetPVarInt(%1,%2)-%3)
- #define MultiPVarInt(%1,%2,%3) SetPVarInt(%1,%2,GetPVarInt(%1,%2)*%3)
- #define DevidPVarInt(%1,%2,%3) SetPVarInt(%1,%2,GetPVarInt(%1,%2)/%3)
- #define FILTERSCRIPT
- #define COLOR 0xFF8080FF
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" [FS]Skaičiuotuvas By SCmindė V1.");
- print(" UŽKRAUTAS VISKAS LIUX");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if ( dialogid == 1 )
- {
- if( !IsNumeric ( inputtext ) ) return SendClientMessage( playerid , COLOR ,"Gi turi vesti skaičius asile") ;
- ShowPlayerDialog ( playerid , 2 , DIALOG_STYLE_INPUT , "Sudėtis" , "Įveskite antrajį skaitmenį" , "Toliau" , "");
- SendClientMessage(playerid,COLOR,"Pirmasis skaičius įvestas");
- SetPVarInt(playerid, "SK" ,strval( inputtext ) );
- }
- else if ( dialogid == 2 )
- {
- new
- msg [ 300 ];
- if( !IsNumeric ( inputtext ) ) return SendClientMessage(playerid, COLOR,"Gi turi skaičiai buti");
- PlusPVarInt ( playerid , "SK" , strval(inputtext) );
- format(msg , sizeof(msg) , "Atsakymas: %d ", GetPVarInt(playerid , "SK" ) );
- SendClientMessage(playerid,COLOR,msg);
- SetPVarInt(playerid, "SK" , 0);
- }
- else if ( dialogid == 3 )
- {
- if ( !IsNumeric ( inputtext ) ) return SendClientMessage ( playerid, COLOR, "Skaičius įvesti turi ");
- ShowPlayerDialog ( playerid , 4 , DIALOG_STYLE_INPUT , "Atimtis" , "Įveskite antrajį skaičiu","Toliau" , "");
- SendClientMessage ( playerid , COLOR , "Pirmajį skaičiu įvedei ");
- SetPVarInt(playerid,"MK",strval ( inputtext ) );
- }
- else if ( dialogid == 4 )
- {
- if ( !IsNumeric ( inputtext ) ) return SendClientMessage(playerid, COLOR , "Kur skaičiai blede?");
- MinusPVarInt ( playerid , "MK" , strval ( inputtext ) );
- new
- zin [ 50 ];
- format ( zin , sizeof(zin), "Atsakymas : %d",GetPVarInt(playerid,"MK" ) );
- SendClientMessage ( playerid , COLOR , zin );
- SetPVarInt ( playerid , "MK" , 0);
- }
- else if ( dialogid == 5 )
- {
- if ( !IsNumeric ( inputtext ) ) return SendClientMessage( playerid , COLOR , " Įvestas atsakymas turi būti skaičiai ");
- ShowPlayerDialog ( playerid , 6 , DIALOG_STYLE_INPUT , "Daugyba","Įveskite antrajį skaitmenį","Toliau","");
- SendClientMessage ( playerid , COLOR , "Pirmasis skaičius įvestas ");
- SetPVarInt(playerid , "DK", strval ( inputtext ) );
- }
- else if ( dialogid == 6 )
- {
- if ( !IsNumeric ( inputtext ) ) return SendClientMessage( playerid , COLOR , " Įvestas atsakymas turi būti skaičiai ");
- MultiPVarInt(playerid , "DK" , strval ( inputtext ) );
- new
- msg [ 50 ];
- format(msg , sizeof(msg) , "Atsakymas: %d",GetPVarInt(playerid, "DK" ) );
- SendClientMessage(playerid, COLOR , msg );
- SetPVarInt ( playerid , "DK" , 0);
- }
- else if ( dialogid == 7 )
- {
- if ( !IsNumeric ( inputtext ) ) return SendClientMessage( playerid , COLOR , " Įvestas atsakymas turi būti skaičiai ");
- ShowPlayerDialog ( playerid, 8 , DIALOG_STYLE_INPUT , "Dalyba" , "Įveskite antrajį skaitmenį " , "Toliau" , "");
- SendClientMessage ( playerid, COLOR , "Pirmasis skaičius įvestas");
- SetPVarInt ( playerid , "DA" , strval ( inputtext ) );
- }
- else if ( dialogid == 8 )
- {
- if ( !IsNumeric (inputtext) ) return SendClientMessage( playerid , COLOR , " Įvestas atsakymas turi būti skaičiai ");
- DevidPVarInt ( playerid , "DA" , strval ( inputtext ) );
- new
- msg [ 50 ];
- format ( msg , sizeof (msg) , "Atsakymas: %i",GetPVarInt ( playerid , "DA" ) );
- SendClientMessage ( playerid , COLOR , msg);
- SetPVarInt ( playerid , "DA" , 0);
- }
- return 1;
- }
- CMD:skaiciuotuvas ( playerid )
- {
- SendClientMessage(playerid , COLOR , "Skaičiuotuvo komandos: {FFFFFF}/sudet /atimt /dalyba /daugyba");
- return 1;
- }
- CMD:dalyba ( playerid )
- {
- ShowPlayerDialog ( playerid , 7 , DIALOG_STYLE_INPUT , "Dalyba" , "Įveskite Pirmasis skaitmenį" , "Toliau" , "Išeit ");
- return 1;
- }
- CMD:daugyba ( playerid )
- {
- ShowPlayerDialog ( playerid , 5 , DIALOG_STYLE_INPUT , "Daugyba" , "Įveskite Pirmajį skaitmetį" , "Toliau " , "Išeit");
- return 1;
- }
- CMD:atimt(playerid)
- {
- ShowPlayerDialog ( playerid , 3 , DIALOG_STYLE_INPUT , "Atimtis","Įveskite pirmą skaitmęnį","Toliau","Išeit");
- return 1;
- }
- CMD:sudet(playerid)
- {
- ShowPlayerDialog(playerid, 1 , DIALOG_STYLE_INPUT , "Sudėtis" , "Įveskite pirmą skaitmenį" ,"Toliau" , "Išeit");
- return 1;
- }
- stock IsNumeric(const string[])
- {
- for(new i=0,j=strlen(string);i<j;i++)
- {
- if(string[i] > '9' || string[i] < '0') return 0;
- }
- return 1;
- }
- #else
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement