I have a script that allows people going to chop shop, check who the owner of the vehicle is. The vehicle cannot be chopped unless the owner is notified first. Unfortuantly, for some reason it did work, but no longer does. The error I get when i click "Check owner" in the chop shop menu, it has this
This is the only error message I get, when clicking the "Check Owner" button.
The code for the check owner is
I dont see anywhere, where the error could happen from. Just looking for some help
Code:
17:58:08 Error position: <:3789>
17:58:08 Error :: Type Number, expected switch
This is the only error message I get, when clicking the "Check Owner" button.
The code for the check owner is
C++:
#include "..\..\script_macros.hpp"
/*
File: fn_chopCheck.sqf
Author: System32
Description:
Check the owner of a vehicle, if owner is notified of the ransom, allow the player to chop it.
Vehicle cannot be chopped if the owner hasn't been notified.
*/
disableSerialization;
private["_control","_vehicle"];
_control = CONTROL(39400,39402);
_vehicle = _control lbData (lbCurSel _control);
_vehicle = call compile format["%1", _vehicle];
_nearVehicles = nearestObjects [getMarkerPos (_this select 3),["Car","Truck","Air"],25];
_vehicle = _nearVehicles select _vehicle;
_vehicleData = _vehicle getVariable ["vehicle_info_owners",[]];
if ((count _vehicleData) isEqualTo 0) exitWith {deleteVehicle _vehicle};
private _owner = ((_vehicleData select 0) select 1);
if(isNull _vehicle) exitWith {};
private _stats = _vehicle getVariable ["dbInfo",[]];
if ((count _stats) isEqualTo 0) exitWith {hint "This vehicle is bugged"}; //not valid vehicle
private _vehicleName = getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName");
{if (getPlayerUID _x isEqualTo (_stats select 0)) exitWith {_owner = _x}} forEach playableUnits;
if (isNull _owner) then
{
hint "The owner is offline currently, chop away!";
};
if !(isNull _owner) then
{
hint format ["The owner of this vehicle is %1 and they are online, please msg them to let them attempt a ransom!",(name _owner)];
[0,"Someone is trying to chop your %1 vehicle!",_vehicleName] remoteExecCall ["life_fnc_broadcast",_owner];
};
_vehicle setVariable["checked",true,true];
I dont see anywhere, where the error could happen from. Just looking for some help