Advertisement
Guest User

Skaičiuotuvas by Scmindė

a guest
Jun 26th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.67 KB | None | 0 0
  1. //-----------------------Kaip veikia ką jis daro?----------------------//
  2. //          /skaiciuotuvas - visos jo komandos                         //
  3. //          Šitas Scriptas Sudeda, Atima , Dalina , Daugina            //
  4. //          Šitą scriptą bandysiu atnaujinti kuo dažniau               //
  5. //          Scriptą dariau savo malonumui , o ne 'pasipuikuoti'         //
  6. //          Scriptą kūriau be pagalbos SCmindė (MindCode)               //
  7. //          Scriptas Pradėtas kurti: 2013.06.25                          //
  8. //          Scriptas Baigtas kurti: 2013.06.26                           //
  9. //          O.T Minato Duhas !                                           //
  10. //--------------------THE END GOOD LUCK USING--------------------------//
  11. #include <a_samp>
  12. #include <zcmd>
  13. //pragma
  14. #pragma tabsize 0
  15. //definai
  16. #define PlusPVarInt(%1,%2,%3) SetPVarInt(%1,%2,GetPVarInt(%1,%2)+%3)
  17. #define MinusPVarInt(%1,%2,%3) SetPVarInt(%1,%2,GetPVarInt(%1,%2)-%3)
  18. #define MultiPVarInt(%1,%2,%3) SetPVarInt(%1,%2,GetPVarInt(%1,%2)*%3)
  19. #define DevidPVarInt(%1,%2,%3) SetPVarInt(%1,%2,GetPVarInt(%1,%2)/%3)
  20. #define FILTERSCRIPT
  21. #define COLOR 0xFF8080FF
  22. #if defined FILTERSCRIPT
  23.  
  24. public OnFilterScriptInit()
  25. {
  26.     print("\n--------------------------------------");
  27.     print(" [FS]Skaičiuotuvas By SCmindė V1.");
  28.     print(" UŽKRAUTAS VISKAS LIUX");
  29.     print("--------------------------------------\n");
  30.     return 1;
  31. }
  32.  
  33. public OnFilterScriptExit()
  34. {
  35.     return 1;
  36. }
  37. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  38. {
  39.  if ( dialogid == 1 )
  40. {
  41.    if( !IsNumeric ( inputtext ) ) return SendClientMessage( playerid , COLOR ,"Gi turi vesti skaičius asile") ;
  42.    ShowPlayerDialog ( playerid , 2 , DIALOG_STYLE_INPUT , "Sudėtis" , "Įveskite antrajį skaitmenį" , "Toliau" , "");
  43.    SendClientMessage(playerid,COLOR,"Pirmasis skaičius įvestas");
  44.    SetPVarInt(playerid, "SK" ,strval( inputtext ) );
  45. }
  46. else if ( dialogid == 2 )
  47. {
  48.    new
  49.       msg [ 300 ];
  50.    if( !IsNumeric ( inputtext ) ) return SendClientMessage(playerid, COLOR,"Gi turi skaičiai buti");
  51.    PlusPVarInt ( playerid , "SK" , strval(inputtext) );
  52.    format(msg , sizeof(msg) , "Atsakymas: %d ", GetPVarInt(playerid , "SK" ) );
  53.    SendClientMessage(playerid,COLOR,msg);
  54.    SetPVarInt(playerid, "SK" , 0);
  55. }
  56. else if ( dialogid == 3 )
  57. {
  58.    if ( !IsNumeric ( inputtext ) ) return SendClientMessage ( playerid, COLOR, "Skaičius įvesti turi ");
  59.    ShowPlayerDialog ( playerid , 4 , DIALOG_STYLE_INPUT , "Atimtis" , "Įveskite antrajį skaičiu","Toliau" , "");
  60.    SendClientMessage ( playerid , COLOR , "Pirmajį skaičiu įvedei ");
  61.    SetPVarInt(playerid,"MK",strval ( inputtext ) );
  62. }
  63. else if ( dialogid == 4 )
  64. {
  65.    if ( !IsNumeric ( inputtext ) ) return SendClientMessage(playerid, COLOR , "Kur skaičiai blede?");
  66.    MinusPVarInt ( playerid , "MK" , strval ( inputtext ) );
  67.    new
  68.       zin [ 50 ];
  69.    format ( zin , sizeof(zin), "Atsakymas : %d",GetPVarInt(playerid,"MK" ) );
  70.    SendClientMessage ( playerid , COLOR , zin );
  71.    SetPVarInt ( playerid , "MK" , 0);
  72. }
  73. else if ( dialogid == 5 )
  74. {
  75.    if ( !IsNumeric ( inputtext ) ) return SendClientMessage( playerid , COLOR , " Įvestas atsakymas turi būti skaičiai ");
  76.    ShowPlayerDialog ( playerid , 6 , DIALOG_STYLE_INPUT , "Daugyba","Įveskite antrajį skaitmenį","Toliau","");
  77.    SendClientMessage ( playerid , COLOR , "Pirmasis skaičius įvestas ");
  78.    SetPVarInt(playerid , "DK", strval ( inputtext ) );
  79. }
  80. else if ( dialogid == 6 )
  81. {
  82.    if ( !IsNumeric ( inputtext ) ) return SendClientMessage( playerid , COLOR , " Įvestas atsakymas turi būti skaičiai ");
  83.    MultiPVarInt(playerid , "DK" , strval ( inputtext ) );
  84.    new
  85.       msg [ 50 ];
  86.    format(msg , sizeof(msg) , "Atsakymas: %d",GetPVarInt(playerid, "DK" ) );
  87.    SendClientMessage(playerid, COLOR , msg );
  88.    SetPVarInt ( playerid , "DK" , 0);
  89. }
  90. else if ( dialogid == 7 )
  91. {
  92.    if ( !IsNumeric ( inputtext ) ) return SendClientMessage( playerid , COLOR , " Įvestas atsakymas turi būti skaičiai ");
  93.    ShowPlayerDialog ( playerid, 8 , DIALOG_STYLE_INPUT , "Dalyba" , "Įveskite antrajį skaitmenį " , "Toliau" , "");
  94.    SendClientMessage ( playerid, COLOR , "Pirmasis skaičius įvestas");
  95.    SetPVarInt ( playerid , "DA" , strval ( inputtext ) );
  96. }
  97. else if ( dialogid == 8 )
  98. {
  99.    if ( !IsNumeric (inputtext) ) return SendClientMessage( playerid , COLOR , " Įvestas atsakymas turi būti skaičiai ");
  100.    DevidPVarInt ( playerid , "DA" , strval ( inputtext ) );
  101.    new
  102.       msg [ 50 ];
  103.    format ( msg , sizeof (msg) , "Atsakymas: %i",GetPVarInt ( playerid , "DA" ) );
  104.    SendClientMessage ( playerid , COLOR , msg);
  105.    SetPVarInt ( playerid , "DA" , 0);
  106. }
  107. return 1;
  108. }
  109. CMD:skaiciuotuvas ( playerid )
  110. {
  111.    SendClientMessage(playerid , COLOR , "Skaičiuotuvo komandos: {FFFFFF}/sudet /atimt /dalyba /daugyba");
  112.    return 1;
  113. }
  114. CMD:dalyba ( playerid  )
  115. {
  116.    ShowPlayerDialog ( playerid , 7 , DIALOG_STYLE_INPUT , "Dalyba" , "Įveskite Pirmasis skaitmenį" , "Toliau" , "Išeit ");
  117.    return 1;
  118. }
  119. CMD:daugyba ( playerid  )
  120. {
  121.    ShowPlayerDialog ( playerid , 5 , DIALOG_STYLE_INPUT , "Daugyba" , "Įveskite Pirmajį skaitmetį" , "Toliau " , "Išeit");
  122.    return 1;
  123.  
  124. }
  125. CMD:atimt(playerid)
  126. {
  127.    ShowPlayerDialog ( playerid , 3 , DIALOG_STYLE_INPUT , "Atimtis","Įveskite pirmą skaitmęnį","Toliau","Išeit");
  128.    return 1;
  129. }
  130. CMD:sudet(playerid)
  131. {
  132. ShowPlayerDialog(playerid, 1 , DIALOG_STYLE_INPUT , "Sudėtis" , "Įveskite pirmą skaitmenį" ,"Toliau" , "Išeit");
  133. return 1;
  134. }
  135. stock IsNumeric(const string[])
  136. {
  137.    for(new i=0,j=strlen(string);i<j;i++)
  138.    {
  139.       if(string[i] > '9' || string[i] < '0') return 0;
  140.    }
  141.    return 1;
  142. }
  143. #else
  144.  
  145.  
  146. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement