Vehicle lock/unlock

Vehicle lock/unlock

« posted: May 25, 2015, 08:58 PM »
Evening all,

I have a little dilemma, before we start im new to code with arma 3, i know some. but little,
I've managed to add a few other bits and bobs to my server, (airdrops) etc..

I have the little issue of..
When anybody purchases any type of vehicle from the store, they cannot lock/unlock it..
But when its been through the "change owner" pad on my server (helie pad that will change the owner of that vehicle for a price) this will then allow them to unlock/lock
Airdrop will also allow them to unlock and lock the vehicle they have purchased..


So what im asking is, does anybody know of a fix for this? or something that is going wrong..

I can upload/post whatever is needed please request :)

Thankyou
-Durex

P.s Ik Durex isnt safe please don't state :D lol

Re: Vehicle lock/unlock

« Reply #1 posted: May 26, 2015, 05:18 AM »
After some digging, i have come to some conclusion of that,
after adding and installing: http://forums.a3wasteland.com/index.php?topic=943.0
Fully working and functional i noticed that..
when a user purchases a vehicle from ANY of the vehicle stores, and "infos" on the vehicle it shows "no owner"

I believe the store is just "spawning" the vehicle instead of setting it that it has an owner,
unsure of what is causing this.

any help will be grateful i have exhausted all of my efforts trying to find the cause.

-Durex

Re: Vehicle lock/unlock

« Reply #2 posted: May 26, 2015, 07:03 AM »
Hi,

Had to rewrite this, wrote the previous answer on my phone and saw that it made no sense, even wrote the wrong variable ;).

Micoverys vactions "Info" option looks for that variable "ownerN" if i remember right, ownerN is unfortunately something i came up with back when i didnt dare to use the same variables that A3W vanilla uses(i now use ownerName. You still get a name on owner if the owner of the vehicle is online, as vaction match the UID (i think).

Anyway, player names(owner names) are not set in any form to anything in A3W except the spawnbeacon so you have to set this yourself. You can pull the mission from my server and search for "ownerName" and you should find that i set this in Apocs Airdrop, changeOwner (which is done in the shops thanks to Creampie) and ofc in the spawnStoreObject.sqf. I also set it on stuff i spawn with the base relocker and in the R3F objectLockStateMachine.sqf but some of those is just for convenience when i search the database for suspicious object/players and are to lazy to look up their UIDs ;)

Code: [Select]
_object setVariable ["ownerName", name _player, true]; //Cael817, Add "ownerName" for convenience

Re: Vehicle lock/unlock

« Reply #3 posted: May 26, 2015, 01:46 PM »
Fantastic, will do,
I still seem to have the issue of the vehicles not being able to be locked when  purchased from the store?

seeing if i purchased a blackfoot. i should be able to unlock/lock all i wish as im the owner correct?
but it tells me there is no owner of that vehicle after i have jut purchased it. so therefore it will not allow me to lock/unlock :P

-Durx
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Vehicle lock/unlock

« Reply #4 posted: May 26, 2015, 04:55 PM »
Worked out of the box for me ;) It check on UID. And if the player is ingame it shows the player name. Otherwise it shows Not In Game.

Re: Vehicle lock/unlock

« Reply #5 posted: May 26, 2015, 06:53 PM »
I see some people are not fully understanding what im saying so ill try below,

The install of the extra addon for unlock/lock isnt the problem,
This issue with unlocking/lock brought vehicles was there BEFORE i installed this addon, the addon works perfectly fine with airdrop vehicles or change ownershiped vehicles.

Its when brought from the store..

Re: Vehicle lock/unlock

« Reply #6 posted: May 26, 2015, 08:18 PM »
Strange.....

Try changing your spawnStoreObject.sqf with the attached one

See changes to line 132,133 and 172-182 and also 193-203 if you wanna change anything. It should however work as is with vactions.

Re: Vehicle lock/unlock

« Reply #7 posted: May 26, 2015, 09:21 PM »
Testing this as we speak,
am uploading to the server now and will perform tests and reply back here in 10

Thankyou
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1085
  • ^_^;;

Re: Vehicle lock/unlock

« Reply #8 posted: May 26, 2015, 10:24 PM »
You have to set the object variable - You need to ensure for each bought vehicle this gets set!

Can't remember if it was setupStoreObject or buyVehicle

Code: [Select]
_vehicle setVariable ["ownerN", name player, true];
_vehicle setVariable ["ownerUID", getPlayerUID player, true];
      

- from the grassy knoll -

Re: Vehicle lock/unlock

« Reply #9 posted: May 26, 2015, 10:50 PM »
Strangely enough, im not sure what it was..

Those were both fine cre4mpie, that was the first Go-to,
it was highly strange as the airdrops worked, change owner did,

Effectively airdrop is just purchasing a vehicle from the store and paradroping it over you.. too strange all fixed now :)

Re: Vehicle lock/unlock

« Reply #10 posted: May 26, 2015, 10:51 PM »
ABOVE HAS BEEN SOLVED
THANKYOU TO ALL THOSE INVOLVED THAT ASSISED


THREAD CLOSED: