Jump to content
Sign in to follow this  
1para{god-father}

Addaction on Dedi server

Recommended Posts

I have a key pad that I am trying to lock / unlock a vehicle , it all works when i test on a local PC but as soon as I put it on a Dedi server it does not work - well itall works appart from the Lock unlock bit ?

Any idea where I am going wrong, I get no error so I am sure it has something to do with local v server

in the Vehicle INI

war2 lock true;war2 addAction ['Security keypad', 'CodePad.sqf', [['#', 5, 6], {nul=[]execvm 'unlocktank.sqf'; sleep 1; closeDialog 0; hint 'unlocked!'}, {ctrlSetText [999,'Wrong code!']; sleep 1; ctrlSetText [999, ''];nul=[]execvm 'locktank.sqf'}]];

unlocktank.sqf

war2 lock true;

locktank.sqf

war2 lock true;

Share this post


Link to post
Share on other sites

Maybe it is because both your scripts lock the war2??

Otherwise it might be because BIKI says you need to run the command where the vehicle is local. In singleplayer everything is local to you. But on a dedicated, vehicles that are not driven by players or driven by serverside AI are local to the server. Meaning you run the lock/unlock action from a player but you need to run it on the server since that is where war2 is local.

If there is only a single vehicle you need to lock/unlock then a simple way to do this would be to, create a trigger set with REPEATABLE:

Condition: War2IsUnlocked
On Act: war2 lock false;
On Deact: war2 lock true;

Then in your locktank you do:

War2IsUnlocked= false;
publicVariable "War2IsUnlocked";

And in your unlocktank your do:

War2IsUnlocked = true;
publicVariable "War2IsUnlocked"; 

Share this post


Link to post
Share on other sites

Sorry that was a typo the unlock is false :)

This is a MP mission and I have a keypad that I am using to lock and unlcok things with a keypad and password they get during the mission and it unlock a few vehicles etc..

So any way I can do this with an addaction ?

ahh i see what you mean sorry brain failure ill try that now ignore above !!

Edited by psvialli
brain freeze

Share this post


Link to post
Share on other sites
So any way I can do this with an addaction ?

Hmm, though I just did - the locktank and unlock tank code is supposed to be what you have in your locktank.sqf and unlocktank.sqf.

Share this post


Link to post
Share on other sites
Hmm, though I just did - the locktank and unlock tank code is supposed to be what you have in your locktank.sqf and unlocktank.sqf.

All works like a charm You are a Top Man !!!!!

Share this post


Link to post
Share on other sites

Hi!

I am trying to script some passcode locks for DayZ mod. Would you mind sharing your keypad script for the lock/unlock vehicles?:)

Thanks

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×