Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Kūrėjas: Gh0sT_
- Versija: V1
- Skype: grander18
- Nors ir pakeisi kreditus, skripto autoriumi netapsi.
- */
- #include <a_samp> // Kreditai ----> SA-MP komanda
- #include <foreach> // Kreditai ----> Y_Less
- #include <zcmd> // Kreditai ----> ZeeX
- #define Gyvybes 750 // Nuo kiek gyvybių mašinos variklis užges?
- #define Kaina 1000 // Kiek kainuos sutaisymas, ir kiek pinigų mechanikas gaus?
- #define Tekstas 1 // Ar žaidėjui bus prilipdytas tekstas, kai jo mašinos variklis bus užgesęs? 1 - Taip, 0 - Ne.
- #define BALTA 0xFFFFFFFF // Balta spalva.
- new
- Text3D:UzgesusioTekstas[MAX_PLAYERS]
- ;
- main(){}
- public OnFilterScriptInit( ) // Kreditai ---> SA-MP komanda
- {
- print("\n\n\n\n\n\n\n\n\n\n\n\n");
- print("Greičio matuokliai - kūrta Gh0sT_");
- SetTimer("VariklioTikrinimas", 1000, true );
- return 1;
- }
- public OnFilterScriptExit( ) // Kreditai ---> SA-MP komanda
- {
- print("\n\n\n\n\n\n\n\n\n\n\n\n");
- print("Greičio matuokliai - kūrta Gh0sT_");
- return 1;
- }
- public OnPlayerDisconnect( playerid, reason )
- {
- Delete3DTextLabel(UzgesusioTekstas[playerid]);
- return 1;
- }
- COMMAND:taisyti(playerid, params[]) // Kreditai ---> Gh0sT_
- {
- new MasinosID = GetPlayerVehicleID( playerid );
- new Vairuotojas = GetDriver( MasinosID );
- new Float: MasinosGyvybes;
- GetVehicleHealth( MasinosID , MasinosGyvybes );
- if(MasinosGyvybes > 999) return SendClientMessage( playerid, BALTA, "Mašina nėra sudaužyta.");
- if(GetPVarInt( playerid, "Darbas") != 1 ) return SendClientMessage( playerid, BALTA, "Jūs neesate Mechanikas.");
- if(GetPlayerMoney( Vairuotojas ) < Kaina) return SendClientMessage( playerid, BALTA,"Šis žaidėjas neturi 1000$.");
- if(!IsPlayerInAnyVehicle( playerid ) && GetPlayerState( playerid ) != PLAYER_STATE_DRIVER) return SendClientMessage( playerid, BALTA,"Jūs neesate mašinoje.");
- if(Vairuotojas != INVALID_PLAYER_ID)
- {
- new
- Stringas[61]
- ;
- format(Stringas,sizeof(Stringas),"Mechanikas %s Jums siųlo mašinos sutaisymą už 1000$.", GautiZaidejoVarda(playerid));
- ShowPlayerDialog( Vairuotojas , 0 ,DIALOG_STYLE_MSGBOX,"Mechanikai" , Stringas , "Sutaisyti" , "Uždaryti");
- SetPVarInt( playerid , "ZaidejoID", Vairuotojas);
- SetPVarInt( playerid , "MasinosID", MasinosID);
- }
- else SendClientMessage( playerid, BALTA,"Mašinoje nėra jos savininko.");
- return 1;
- }
- forward VariklioTikrinimas( ); // Kreditai ---> Gh0sT_
- public VariklioTikrinimas( ) // Kreditai ---> Gh0sT_
- {
- foreach(Player, ID)
- {
- 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.
- {
- TogglePlayerControllable(ID, false);
- }
- if(GetPlayerState(ID) == PLAYER_STATE_DRIVER)
- {
- new
- #pragma tabsize 1
- Float:MasinosGyvybes;
- new MasinosID = GetPlayerVehicleID(ID);
- GetVehicleHealth(MasinosID, MasinosGyvybes);
- #pragma tabsize 0
- if(MasinosGyvybes < Gyvybes)
- {
- if(GetPVarInt(ID, "Uzgeses") == 0)
- {
- TogglePlayerControllable(ID, false);
- SendClientMessage(ID, BALTA,"Jūsų mašinos variklis užgeso. Kreipkities pas Mechanikus.");
- SetPVarInt(ID, "Uzgeses", 1);
- #if Tekstas 1
- new
- Float:ZaidejoX,
- Float:ZaidejoY,
- Float:ZaidejoZ
- ;
- UzgesusioTekstas[ ID ] = Create3DTextLabel("Šio žaidėjo mašinos variklis yra užgesęs!", BALTA, ZaidejoX, ZaidejoY, ZaidejoZ+2.0, 20.0 ,1);
- Attach3DTextLabelToPlayer(UzgesusioTekstas[ ID ], ID, 0, 0, 2.0);
- SetPVarInt(ID, "TekstasSukurtas", 1);
- #endif
- }
- }
- }
- }
- return 1;
- }
- stock GautiZaidejoVarda(playerid) // Kreditai ---> ?
- {
- new Vardas[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Vardas, sizeof(Vardas));
- return Vardas;
- }
- stock GetDriver(vehicleid) // Kreditai ---> ?
- {
- foreach(Player, playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if(IsPlayerInVehicle(playerid,vehicleid)) return playerid;
- }
- }
- }
- return INVALID_PLAYER_ID;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) // Kreditai ---> SA-MP komanda
- {
- if(dialogid == 0)
- {
- if(!response)
- {
- SendClientMessage(playerid, BALTA,"Jūs paspaudėte 'Uždaryti");
- }
- if(response)
- {
- new Vairuotojas = GetPVarInt(playerid,"ZaidejoID");
- new AutomobilioID = GetPVarInt(playerid,"MasinosID");
- GivePlayerMoney(playerid, Kaina);
- GivePlayerMoney(Vairuotojas, -Kaina);
- RepairVehicle(AutomobilioID);
- SetPVarInt(Vairuotojas, "Uzgeses", 0);
- TogglePlayerControllable(Vairuotojas, true);
- if(GetPVarInt(Vairuotojas, "TekstasSukurtas") == 1) return Delete3DTextLabel(UzgesusioTekstas[playerid]), SetPVarInt(Vairuotojas, "TekstasSukurtas", 0);
- }
- }
- return 0;
- }
- /*
- Kūrėjas: Gh0sT_
- Versija: V1
- Skype: grander18
- Nors ir pakeisi kreditus, skripto autoriumi netapsi.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement