Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Global Variables:
- JDEV_rentTruck = false;
- //Script on NPC:
- this addaction["Rent a truck",JDEV_fnc_rentTruck];
- // File: fn_rentTruck.sqf
- // Author: Jester
- // Description: Rents a truck for you to use
- JDEV_rentTruck = true;
- if (JDEV_rentTruck isEqualTo true) then {
- titleText ["You rented a truck for the next 3 minutes!", "PLAIN"];
- _truckRental = "C_Van_01_box_white_F" createVehicle getMarkerPos "marker_8";
- player moveInAny _truckRental;
- };
- JDEV_rentTime = 180; //seconds of rental
- while {(JDEV_rentTruck isEqualTo true) and (JDEV_rentTime > -1)} do {
- sleep 1;
- JDEV_rentTime = JDEV_rentTime - 1;
- if (JDEV_rentTime == 60) then { //1 minute warning
- hint "1 minute left on rental!";
- };
- if (JDEV_rentTime == 30) then { //30 sec warning
- hint "30 seconds left on rental!";
- };
- if ((JDEV_rentTime < 11) and (JDEV_rentTime > 0)) then { //Will countdown once it gets to 10 seconds
- hintSilent format ["Seconds until rental is over: %1", JDEV_rentTime];
- };
- if (JDEV_rentTime == 0) then { //When timer is done
- _truck = ((getPos player) nearestObject "C_Van_01_box_white_F");
- deleteVehicle _truck;
- hint "Rental Time is over! Go back to the rental NPC to rent it again.";
- JDEV_rentTruck = false;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement