Jump to content

[Release] Vehicle locator and key identifier


Logi

Recommended Posts

Nice script.

 

On the other hand: a wet dream for the PvPlers that have stolen/looted other people's keys and now want to find the vehicles....

I agree that owners need to think the politics through on this one a bit as it's really game changing..... :)

 

On the flip side to your point above ekroemer, maybe a wet dream too for the player that got PvP'd as they can then stakeout their own car for a spot of revenge.....he/she'll most likely get the key back as otherwise how would the PvPer be able to collect unless he rocked up with the key...

 

Maybe this fills the gap in gameplay created by us owner/admins all having to have indestructible bases to keep/grow server population.

 

Nice bit of work Logi, am still making my mind up though... :)

Link to comment
Share on other sites

 

You could probably just create an admin list and then check if the user is an admin. eg:

AdminList = [
"00000000000000000", // Admin 1 ID here
"00000000000000000"  // Admin 2 ID here
];
 
if((getPlayerUID player) in AdminList then {
player removeAction s_player_servermenu;s_player_servermenu1 = player addAction [("<t color=""#FFFFFF"">" + ("- Server Rules") +"</t>"),"custom\servermenu\spawn_rules.sqf","",-1,false,false,"", ""];
s_player_servermenu2 = player addAction [("<t color=""#FFFFFF"">" + ("- Server Info") +"</t>"),"custom\servermenu\spawn_info.sqf","",-1,false,false,"", ""];
s_player_servermenu3 = player addAction [("<t color=""#FFFFFF"">" + ("- Player Tips") +"</t>"),"custom\servermenu\spawn_tips.sqf","",-1,false,false,"", ""];
s_player_servermenu4 = player addAction [("<t color=""#FFFFFF"">" + ("- Locate Vehicle") +"</t>"),"custom\servermenu\locate_vehicle.sqf","",-1,false,false,"", ""];
s_player_servermenuCancel = player addAction ["close","custom\servermenu\server_menuClose.sqf","",-1,false,false,"", ""];
} else {
player removeAction s_player_servermenu;s_player_servermenu1 = player addAction [("<t color=""#FFFFFF"">" + ("- Server Rules") +"</t>"),"custom\servermenu\spawn_rules.sqf","",-1,false,false,"", ""];
s_player_servermenu2 = player addAction [("<t color=""#FFFFFF"">" + ("- Server Info") +"</t>"),"custom\servermenu\spawn_info.sqf","",-1,false,false,"", ""];
s_player_servermenu3 = player addAction [("<t color=""#FFFFFF"">" + ("- Player Tips") +"</t>"),"custom\servermenu\spawn_tips.sqf","",-1,false,false,"", ""];
s_player_servermenuCancel = player addAction ["close","custom\servermenu\server_menuClose.sqf","",-1,false,false,"", ""];
};

 

Can anyone confirm the admins IDs work?

Link to comment
Share on other sites

Well I do not know exactly what server menu you are using, but it works for the server menu that I am using and its basically the same code that is used for the Epoch Admin Tool.

This is what my server menu looks like if I reserve the locate vehicle script for admin and moderator use only.

 

Obviously replace the zero's with your admin and moderator ID's.

 
AdminList = [
"000000000000000000", // Admin 1
"000000000000000000"  // Admin 2
];
 
ModList = [
"000000000000000000",  // Moderator 1
"000000000000000000"   // Moderator 2
]; 
 
if((getPlayerUID player) in AdminList ||(getPlayerUID player) in ModList) then {
// Admin and moderator action menu
ActionsMenu =
[
["",true],
["Locate Vehicles", [], "", -5, [["expression", format[_EXECscript6,"locate_vehicle.sqf"]]], "1", "1"],
["Self Bloodbag", [], "", -5, [["expression", format[_EXECscript3,"player_selfbloodbag.sqf"]]], "1", "1"],
["Suicide", [], "", -5, [["expression", format[_EXECscript4,"suicide.sqf"]]], "1", "1"],
["", [], "", -5, [["expression", ""]], "1", "0"],
["Exit", [20], "", -5, [["expression", ""]], "1", "1"] 
];
} else {
// Normal player action menu
ActionsMenu =
[
["",true],
["Self Bloodbag", [], "", -5, [["expression", format[_EXECscript3,"player_selfbloodbag.sqf"]]], "1", "1"],
["Suicide", [], "", -5, [["expression", format[_EXECscript4,"suicide.sqf"]]], "1", "1"],
["", [], "", -5, [["expression", ""]], "1", "0"],
["Exit", [20], "", -5, [["expression", ""]], "1", "1"] 
];
 
};
Link to comment
Share on other sites

I will be glad to try and help the Infistar users, but I don't know what his code actually does, I have never seen it.

From what you guys are saying, It seems to me like it prevents non admin from retrieving data from the vehicles.

In which case, you could not retrieve the co-ordinates of a vehicle whether map markers are used or not.

 

I am sure it must be possible to make exceptions for certain things. 

Link to comment
Share on other sites

Could use puplicvariable eventhandler and run this server side? Maybe not the ideal way but should work.

 

That may work for the people using Infistar, but there must be a more practical way to get around this.

I hate Infistar and I have never even used it.

 

Hello there,

 

How can I delete the marker's vehicle ?

 

Do you mean that you want to delete the vehicle marker from the map?

Then please refer to the Edit section in the original post for further details:

 

In order to remove the map markers, place the key/keys in your bag and run the script again.

Link to comment
Share on other sites

Also, I found a way to make it works with Infistar.

 

You have to find these lines bloc in your AH.sqf :

 

} forEach ['lbsetpicture','createDiaryRecord','createTask','createSimpleTask',
'buttonSetAction','processDiaryLink','createDiaryLink','lbSetData','createTeam','profileNamespace',
'exec','addGroupIcon','setGroupIconParams','markerText','setMarkerAlpha','setMarkerBrush','setMarkerColor',
'setMarkerDir','setMarkerPos','setMarkerShape','setMarkerSize','setMarkerText','setMarkerType','addWeaponCargo',
'addMagazineCargo','setVehicleAmmo','setVehicleAmmoDef','setWeaponReloadingTime','setVehicleInit','processInitCommands',
'addMPEventHandler','createVehicleLocal','setWaypointStatements','addWaypoint','toLower','toUpper','loadFile','rcallVarcode',
'saveStatus','loadStatus','saveVar','drawIcon','setMarkerDirLocal','setMarkerAlphaLocal','setMarkerPosLocal','setMarkerTextLocal','setMarkerTypeLocal',
'setMarkerColorLocal','setMarkerBrushLocal','setMarkerSizeLocal','setMarkerShapeLocal','createMarkerLocal'];
 

Then delete these lines :

 

'createMarkerLocal'

'setMarkerShapeLocal'
'setMarkerTypeLocal'
'setMarkerColorLocal'
'setMarkerSizeLocal'
'setMarkerTextLocal'
Link to comment
Share on other sites

 

Also, I found a way to make it works with Infistar.

 

You have to find these lines bloc in your AH.sqf :

 

} forEach ['lbsetpicture','createDiaryRecord','createTask','createSimpleTask',
'buttonSetAction','processDiaryLink','createDiaryLink','lbSetData','createTeam','profileNamespace',
'exec','addGroupIcon','setGroupIconParams','markerText','setMarkerAlpha','setMarkerBrush','setMarkerColor',
'setMarkerDir','setMarkerPos','setMarkerShape','setMarkerSize','setMarkerText','setMarkerType','addWeaponCargo',
'addMagazineCargo','setVehicleAmmo','setVehicleAmmoDef','setWeaponReloadingTime','setVehicleInit','processInitCommands',
'addMPEventHandler','createVehicleLocal','setWaypointStatements','addWaypoint','toLower','toUpper','loadFile','rcallVarcode',
'saveStatus','loadStatus','saveVar','drawIcon','setMarkerDirLocal','setMarkerAlphaLocal','setMarkerPosLocal','setMarkerTextLocal','setMarkerTypeLocal',
'setMarkerColorLocal','setMarkerBrushLocal','setMarkerSizeLocal','setMarkerShapeLocal','createMarkerLocal'];
 

Then delete these lines :

 

'createMarkerLocal'

'setMarkerShapeLocal'
'setMarkerTypeLocal'
'setMarkerColorLocal'
'setMarkerSizeLocal'
'setMarkerTextLocal'

 

 

Have you tested this for no admin users?

 

So Infistar does prevent local map markers from being created. What about retrieving the vehicles co-ordinates?

It will be great if you can sort this for the Infistar users, because without knowing what his code does, I cannot really help with the issue.

Link to comment
Share on other sites

 

Also, I found a way to make it works with Infistar.

 

You have to find these lines bloc in your AH.sqf :

 

I'm using the latest Infistar, which was released 6 September and the code is a little different. It looks like this:

if ("+str _BHF+") then {
_time = 0;while {1 == 1} do {_time = _time + 1;if (_time >= 20) exitWith {};if ((!isNil 'dayz_animalCheck') || (!isNil 'dayz_medicalH') || (!isNil 'dayz_slowCheck') || (!isNil 'dayz_gui')) exitWith {};uiSleep 1;};
lbsetpicture='no';createDiaryRecord='no';createTask='no';
createSimpleTask='no';buttonSetAction='no';processDiaryLink='no';createDiaryLink='no';
lbSetData='no';createTeam='no';exec='no';addGroupIcon='no';
setGroupIconParams='no';addWeaponCargo='no';addMagazineCargo='no';setVehicleAmmoDef='no';
setWeaponReloadingTime='no';addMPEventHandler='no';createVehicleLocal='no';inputAction='no';
setWaypointStatements='no';addWaypoint='no';
loadFile='no';rcallVarcode='no';saveStatus='no';loadStatus='no';
saveVar='no';drawIcon='no';setMarkerText='no';setMarkerType='no';
markerText='no';setMarkerAlpha='no';setMarkerBrush='no';setMarkerColor='no';
setMarkerDir='no';setMarkerPos='no';setMarkerShape='no';setMarkerSize='no';
createMarker='no';setMarkerDirLocal='no';setMarkerAlphaLocal='no';setMarkerPosLocal='no';
setMarkerTextLocal='yes';setMarkerTypeLocal='yes';setMarkerColorLocal='yes';setMarkerBrushLocal='no';
setMarkerSizeLocal='yes';setMarkerShapeLocal='no';createMarkerLocal='yes';
};

I changed the "setMarker" values you mentioned to "yes". They had been set to "no" so instead of just deleting those values, they are changed. I am calling the script with my server menu on the scroll wheel. In my test, as an admin it worked fine. As a player, it got further than before and it did search for the vehicle, but it said the vehicle no longer was on the server. I was standing there looking at it. I confirmed the CharacterID of the vehicle in the database and it matched up with the character ID displayed by this script, but it says the vehicle isn't there.

Link to comment
Share on other sites

Was just wonderring - I want to try this out, but is says in the read me ...

 

 

 

The best method to install the script is to use Maca's Right Click System and add a right click option to the map item. If you have Maca's Right Click System installed, just add the following code to the extra_rc.hpp file:

 

What is Maca's Right Click system ? Where do I get it ? and can I install it with out that ?

 

Thanks in advance.  :)

Link to comment
Share on other sites

Was just wonderring - I want to try this out, but is says in the read me ...

 

 

What is Maca's Right Click system ? Where do I get it ? and can I install it with out that ?

 

Thanks in advance.  :)

 

Do you have a server menu? You could add it to that, or just add it to fn_selfActions as a scroll menu option. If you want to use maca's right click system, just google it. I don't use it myself but I know a lot of admins like to use it.

Link to comment
Share on other sites

It seems like you guys are close to sorting this issue.

my code is:

_vehicleMarker = createMarkerLocal [_Marker,[(_targetPosition select 0),(_targetPosition select 1)]];
_vehicleMarker setMarkerShapeLocal "ICON";
_vehicleMarker setMarkerTypeLocal "DOT";
_vehicleMarker setMarkerColorLocal "ColorOrange";
_vehicleMarker setMarkerSizeLocal [1.0, 1.0];
_vehicleMarker setMarkerTextLocal format ["Here is your: %1",_vehicleName];

So Better dead, you would need: setMarkerShapeLocal='yes'

But that would not solve the database issue.

 

It looks like Infistar is preventing it from finding the vehicle CharacterID for some reason, even though the script is identifying the correct CharacterID.

 

Link to comment
Share on other sites

Would an Infistar user mind testing the following code for me?

private ["_vehicle","_vehicleID"];
_vehicle = cursorTarget;
_vehicleID = parseNumber(cursorTarget getVariable ['CharacterID', '0']);
systemChat format ["Vehicle CharacterID: %1",_vehicleID];

Get a vehicle that has a key and is definitely in the database. Then look at it and run the above script.

Please test it as both an admin and a non admin and then post the results.

 

It should just display: "Vehicle CharacterID: 0000"  (where 0000 is the actual vehicle characterID)

 

Link to comment
Share on other sites

Great script good job,

Would it be possible to count the cars on the one i have and are dedicated to that key this because i use the script.

When i use it the original first key from that vehicle shows up on the map and the others tied to the key dont show up in the list and map.

 

Thanks again! 

Link to comment
Share on other sites

Great script good job,

Would it be possible to count the cars on the one i have and are dedicated to that key this because i use the script.

When i use it the original first key from that vehicle shows up on the map and the others tied to the key dont show up in the list and map.

 

Thanks again! 

I will install the masterkey script on my test server and give it a go, I have just been trying to sort the Infistar issue first.

 

I was able to get a little look at the infistar script and I think that there should be a very simple solution to get this working with Infistar for non-admin.

I must warn you that this may make your server more vulnerable to exploits or hackers that may use the local map marker or vehicles commands.

Information on the vehicles command can be found here: https://community.bistudio.com/wiki/vehicles

Basically you do what Coco-Nuts suggested and find this bit of code in your AH.sqf file.

} forEach ['lbsetpicture','createDiaryRecord','createTask','createSimpleTask',
'buttonSetAction','processDiaryLink','createDiaryLink','lbSetData','createTeam','profileNamespace',
'exec','addGroupIcon','setGroupIconParams','markerText','setMarkerAlpha','setMarkerBrush','setMarkerColor',
'setMarkerDir','setMarkerPos','setMarkerShape','setMarkerSize','setMarkerText','setMarkerType','addWeaponCargo',
'addMagazineCargo','setVehicleAmmo','setVehicleAmmoDef','setWeaponReloadingTime','setVehicleInit','processInitCommands',
'addMPEventHandler','createVehicleLocal','setWaypointStatements','addWaypoint','toLower','toUpper','loadFile','rcallVarcode',
'saveStatus','loadStatus','saveVar','drawIcon','setMarkerDirLocal','setMarkerAlphaLocal','setMarkerPosLocal','setMarkerTextLocal','setMarkerTypeLocal',
'setMarkerColorLocal','setMarkerBrushLocal','setMarkerSizeLocal','setMarkerShapeLocal','createMarkerLocal'];

Then remove these from the list, or set them to false if yours looks like Better Dead Than Zed's:

'createMarkerLocal'

'setMarkerShapeLocal'
'setMarkerTypeLocal'
'setMarkerColorLocal'
'setMarkerSizeLocal'
'setMarkerTextLocal'

 

Then a couple of lines below that, you should see:

} forEach ['allUnits','entities','allMissionObjects','vehicles','playableUnits'];

Just remove 'vehicles' and the script should work for non-admin.

This is because my script uses a foreach loop on the array of vehicles to check if any of the CharacterID's match the key.

I will see if I can find a better solution to this when I have a chance.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×
×
  • Create New...