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
- new
- Skaic;
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" [FS]Skaičiuotuvas By SCmindė V1.");
- print(" UŽKRAUTAS VISKAS LIUX");
- print("--------------------------------------\n");
- Skaic = CreatePickup(1274,2,1951.4390,1342.6720,15.3746);
- Create3DTextLabel("{FFFFFF}Skaičiuotuvo Pirkimas\n{FF0000}10LT", 0x008080FF,1951.4390,1342.6720,15.3746,40.0,0,0);
- 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") ;
- if( strlen ( inputtext ) == 0 ) return SendClientMessage ( playerid , COLOR , "Įvesk ką nors..") ;
- 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");
- if( strlen ( inputtext ) == 0 ) return SendClientMessage ( playerid , COLOR , "Įvesk ką nors..") ;
- 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 ");
- if( strlen ( inputtext ) == 0 ) return SendClientMessage ( playerid , COLOR , "Įvesk ką nors..") ;
- 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?");
- if( strlen ( inputtext ) == 0 ) return SendClientMessage ( playerid , COLOR , "Įvesk ką nors..") ;
- 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 ");
- if( strlen ( inputtext ) == 0 ) return SendClientMessage ( playerid , COLOR , "Įvesk ką nors..") ;
- 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 ");
- if( strlen ( inputtext ) == 0 ) return SendClientMessage ( playerid , COLOR , "Įvesk ką nors..") ;
- 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 ");
- if( strlen ( inputtext ) == 0 ) return SendClientMessage ( playerid , COLOR , "Įvesk ką nors..") ;
- 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 ");
- if( strlen ( inputtext ) == 0 ) return SendClientMessage ( playerid , COLOR , "Įvesk ką nors..") ;
- 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);
- }
- else if ( dialogid == 9 )
- {
- if(response)
- {
- if ( GetPVarInt(playerid,"Skaic") == 1 ) return SendClientMessage(playerid,COLOR,"Jūs jau turite skaičiuotuvą");
- GivePlayerMoney(playerid,-10);
- SetPVarInt(playerid,"Skaic",1);
- SendClientMessage(playerid, COLOR, "Jūs nusipirkote skaičiuotuvą visos komandos: {FFFFFF}/skaiciuotuvas");
- }
- if(!response)
- {
- SendClientMessage(playerid,COLOR,"Nenusipirkai skaičiuotuvo");
- }
- }
- return 1;
- }
- public OnPlayerPickUpPickup(playerid,pickupid)
- {
- if ( pickupid == Skaic )
- {
- ShowPlayerDialog(playerid,9,DIALOG_STYLE_MSGBOX,"Skaičiuotuvo pirkimas","{FFFFFF}Ar norite pirkti\n\t\t\t{269cb5}»{FFFFFF}Skaičiuotuvą","Taip","Ne");
- }
- return 1;
- }
- stock SkaicPos ( playerid )
- {
- SetPlayerCheckpoint(playerid,1951.4390,1342.6720,15.3746,3);
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- SendClientMessage ( playerid , COLOR , "Sėkmingai atįkai į paskįrta vietą");
- DisablePlayerCheckpoint(playerid);
- }
- CMD:mapskaic ( playerid )
- {
- SkaicPos(playerid);
- return 1;
- }
- CMD:skaiciuotuvas ( playerid )
- {
- if ( GetPVarInt(playerid, "Skaic") != 1 ) return SendClientMessage(playerid,COLOR,"Neturi skaičiuotuvo, rašyk /mapskaic , tada parodyk kur gali nusipirkti");
- SendClientMessage(playerid , COLOR , "Skaičiuotuvo komandos: {FFFFFF}/sudet /atimt /dalyba /daugyba");
- return 1;
- }
- CMD:dalyba ( playerid )
- {
- if ( GetPVarInt(playerid, "Skaic") != 1 ) return SendClientMessage(playerid,COLOR,"Neturi skaičiuotuvo, rašyk /mapskaic , tada parodyk kur gali nusipirkti");
- ShowPlayerDialog ( playerid , 7 , DIALOG_STYLE_INPUT , "Dalyba" , "Įveskite Pirmasis skaitmenį" , "Toliau" , "Išeit ");
- return 1;
- }
- CMD:daugyba ( playerid )
- {
- if ( GetPVarInt(playerid, "Skaic") != 1 ) return SendClientMessage(playerid,COLOR,"Neturi skaičiuotuvo, rašyk /mapskaic , tada parodyk kur gali nusipirkti");
- ShowPlayerDialog ( playerid , 5 , DIALOG_STYLE_INPUT , "Daugyba" , "Įveskite Pirmajį skaitmetį" , "Toliau " , "Išeit");
- return 1;
- }
- CMD:atimt(playerid)
- {
- if ( GetPVarInt(playerid, "Skaic") != 1 ) return SendClientMessage(playerid,COLOR,"Neturi skaičiuotuvo, rašyk /mapskaic , tada parodyk kur gali nusipirkti");
- ShowPlayerDialog ( playerid , 3 , DIALOG_STYLE_INPUT , "Atimtis","Įveskite pirmą skaitmęnį","Toliau","Išeit");
- return 1;
- }
- CMD:sudet(playerid)
- {
- if ( GetPVarInt(playerid, "Skaic") != 1 ) return SendClientMessage(playerid,COLOR,"Neturi skaičiuotuvo, rašyk /mapskaic , tada parodyk kur gali nusipirkti");
- 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