Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.74 KB | None | 0 0
  1. /*
  2. Kūrėjas: Gh0sT_
  3. Versija: V1
  4. Skype: grander18
  5. Nors ir pakeisi kreditus, skripto autoriumi netapsi.
  6. */
  7. #include <a_samp> // Kreditai ----> SA-MP komanda
  8. #include <foreach> // Kreditai ----> Y_Less
  9. #include <zcmd> // Kreditai ----> ZeeX
  10. #define Gyvybes 750 // Nuo kiek gyvybių mašinos variklis užges?
  11. #define Kaina 1000 // Kiek kainuos sutaisymas, ir kiek pinigų mechanikas gaus?
  12. #define Tekstas 1 // Ar žaidėjui bus prilipdytas tekstas, kai jo mašinos variklis bus užgesęs? 1 - Taip, 0 - Ne.
  13. #define BALTA 0xFFFFFFFF // Balta spalva.
  14. new
  15. Text3D:UzgesusioTekstas[MAX_PLAYERS]
  16. ;
  17. main(){}
  18. public OnFilterScriptInit( ) // Kreditai ---> SA-MP komanda
  19. {
  20. print("\n\n\n\n\n\n\n\n\n\n\n\n");
  21. print("Greičio matuokliai - kūrta Gh0sT_");
  22. SetTimer("VariklioTikrinimas", 1000, true );
  23. return 1;
  24. }
  25.  
  26. public OnFilterScriptExit( ) // Kreditai ---> SA-MP komanda
  27. {
  28. print("\n\n\n\n\n\n\n\n\n\n\n\n");
  29. print("Greičio matuokliai - kūrta Gh0sT_");
  30. return 1;
  31. }
  32. public OnPlayerDisconnect( playerid, reason )
  33. {
  34. Delete3DTextLabel(UzgesusioTekstas[playerid]);
  35. return 1;
  36. }
  37.  
  38. COMMAND:taisyti(playerid, params[]) // Kreditai ---> Gh0sT_
  39. {
  40. new MasinosID = GetPlayerVehicleID( playerid );
  41. new Vairuotojas = GetDriver( MasinosID );
  42. new Float: MasinosGyvybes;
  43. GetVehicleHealth( MasinosID , MasinosGyvybes );
  44. if(MasinosGyvybes > 999) return SendClientMessage( playerid, BALTA, "Mašina nėra sudaužyta.");
  45. if(GetPVarInt( playerid, "Darbas") != 1 ) return SendClientMessage( playerid, BALTA, "Jūs neesate Mechanikas.");
  46. if(GetPlayerMoney( Vairuotojas ) < Kaina) return SendClientMessage( playerid, BALTA,"Šis žaidėjas neturi 1000$.");
  47. if(!IsPlayerInAnyVehicle( playerid ) && GetPlayerState( playerid ) != PLAYER_STATE_DRIVER) return SendClientMessage( playerid, BALTA,"Jūs neesate mašinoje.");
  48. if(Vairuotojas != INVALID_PLAYER_ID)
  49. {
  50. new
  51. Stringas[61]
  52. ;
  53. format(Stringas,sizeof(Stringas),"Mechanikas %s Jums siųlo mašinos sutaisymą už 1000$.", GautiZaidejoVarda(playerid));
  54. ShowPlayerDialog( Vairuotojas , 0 ,DIALOG_STYLE_MSGBOX,"Mechanikai" , Stringas , "Sutaisyti" , "Uždaryti");
  55. SetPVarInt( playerid , "ZaidejoID", Vairuotojas);
  56. SetPVarInt( playerid , "MasinosID", MasinosID);
  57. }
  58. else SendClientMessage( playerid, BALTA,"Mašinoje nėra jos savininko.");
  59. return 1;
  60. }
  61. forward VariklioTikrinimas( ); // Kreditai ---> Gh0sT_
  62. public VariklioTikrinimas( ) // Kreditai ---> Gh0sT_
  63. {
  64. foreach(Player, ID)
  65. {
  66. if(GetPVarInt(ID, "Uzgeses") == 1) // Sukūrta tam, kad kai žaidėjui užgęsta mašinos variklis, jis negalėtų atsišaldyti su s0beitu.
  67. {
  68. TogglePlayerControllable(ID, false);
  69. }
  70. if(GetPlayerState(ID) == PLAYER_STATE_DRIVER)
  71. {
  72. new
  73. #pragma tabsize 1
  74. Float:MasinosGyvybes;
  75. new MasinosID = GetPlayerVehicleID(ID);
  76. GetVehicleHealth(MasinosID, MasinosGyvybes);
  77. #pragma tabsize 0
  78. if(MasinosGyvybes < Gyvybes)
  79. {
  80. if(GetPVarInt(ID, "Uzgeses") == 0)
  81. {
  82. TogglePlayerControllable(ID, false);
  83. SendClientMessage(ID, BALTA,"Jūsų mašinos variklis užgeso. Kreipkities pas Mechanikus.");
  84. SetPVarInt(ID, "Uzgeses", 1);
  85. #if Tekstas 1
  86. new
  87. Float:ZaidejoX,
  88. Float:ZaidejoY,
  89. Float:ZaidejoZ
  90. ;
  91. UzgesusioTekstas[ ID ] = Create3DTextLabel("Šio žaidėjo mašinos variklis yra užgesęs!", BALTA, ZaidejoX, ZaidejoY, ZaidejoZ+2.0, 20.0 ,1);
  92. Attach3DTextLabelToPlayer(UzgesusioTekstas[ ID ], ID, 0, 0, 2.0);
  93. SetPVarInt(ID, "TekstasSukurtas", 1);
  94. #endif
  95. }
  96. }
  97. }
  98. }
  99. return 1;
  100. }
  101. stock GautiZaidejoVarda(playerid) // Kreditai ---> ?
  102. {
  103. new Vardas[MAX_PLAYER_NAME];
  104. GetPlayerName(playerid, Vardas, sizeof(Vardas));
  105. return Vardas;
  106. }
  107. stock GetDriver(vehicleid) // Kreditai ---> ?
  108. {
  109. foreach(Player, playerid)
  110. {
  111. if(IsPlayerConnected(playerid))
  112. {
  113. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  114. {
  115. if(IsPlayerInVehicle(playerid,vehicleid)) return playerid;
  116. }
  117. }
  118. }
  119. return INVALID_PLAYER_ID;
  120. }
  121. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) // Kreditai ---> SA-MP komanda
  122. {
  123. if(dialogid == 0)
  124. {
  125. if(!response)
  126. {
  127. SendClientMessage(playerid, BALTA,"Jūs paspaudėte 'Uždaryti");
  128. }
  129. if(response)
  130. {
  131. new Vairuotojas = GetPVarInt(playerid,"ZaidejoID");
  132. new AutomobilioID = GetPVarInt(playerid,"MasinosID");
  133. GivePlayerMoney(playerid, Kaina);
  134. GivePlayerMoney(Vairuotojas, -Kaina);
  135. RepairVehicle(AutomobilioID);
  136. SetPVarInt(Vairuotojas, "Uzgeses", 0);
  137. TogglePlayerControllable(Vairuotojas, true);
  138. if(GetPVarInt(Vairuotojas, "TekstasSukurtas") == 1) return Delete3DTextLabel(UzgesusioTekstas[playerid]), SetPVarInt(Vairuotojas, "TekstasSukurtas", 0);
  139. }
  140. }
  141. return 0;
  142. }
  143. /*
  144. Kūrėjas: Gh0sT_
  145. Versija: V1
  146. Skype: grander18
  147. Nors ir pakeisi kreditus, skripto autoriumi netapsi.
  148. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement