Jump to content

Shadow Hawk

Member
  • Posts

    5
  • Joined

  • Last visited

Posts posted by Shadow Hawk

  1.  

    Sound which is in my case "lock" has to be defined in description.ext under class CfgSounds. You can set audible range in CfgSounds and after that range sound starts fading, the farther you go from the vehicle. Here is how I do it in local_lockUnlock.sqf. This way you don't need to be the "owner" of the car to play that sound, like it's in OP and doesn't play the sound before you get on driver seat once.

    private ["_vehicle","_status","_sounddist"];
    _vehicle = _this select 0;
    _status = _this select 1;
    
    if (local _vehicle) then {
    	if(_status) then {
    		_vehicle setVehicleLock "LOCKED";
    		_vehicle setVariable ["R3F_LOG_disabled",true,true];
    		player action ["lightOn", _vehicle];
    		_nul = [objNull, _vehicle, rSAY, "lock", 50] call RE;
    		sleep 0.5;
    		player action ["lightOff", _vehicle];
    		titleText ["LOCKED = Can not be lifted or towed","PLAIN DOWN"]; titleFadeOut 4;
    	} else {
    		_vehicle setVehicleLock "UNLOCKED";
    		_vehicle setVariable ["R3F_LOG_disabled",false,true];
    		player action ["lightOn", _vehicle];
    		_nul = [objNull, _vehicle, rSAY, "lock", 50] call RE;
    		sleep 0.5;
    		player action ["lightOff", _vehicle];
    		titleText ["UNLOCKED = Can be lifted or towed","PLAIN DOWN"]; titleFadeOut 4;
    	};
    };
    

    I used this script and now players cannot unlock cars they buy when they have the keys,only admin lock/unlock works. Any ideas?

×
×
  • Create New...