|TSF|FoX Posted March 30, 2016 Posted March 30, 2016 Hi i scripted this gate script, and i dont know how to add this gate open for group in DayZ gamemode and if player is not in clan than in chat you are not in the clan name can somone help me with that.And and other problem is when the gate is lv u can open it in ls how to add distance open?? local gate = createObject ( 8378,1064.3000488281,1771,19.700000762939,0,0,0 ) local state = 0 function move() if state == 0 then moveObject ( gate,4000,1064.3000488281,1771.0999755859,40.099998474121) state = state + 1 elseif state == 1 then moveObject ( gate, 4000,1064.3000488281,1771,19.700000762939) state = state - 1 end end addCommandHandler("gate", move )
knightscript Posted March 30, 2016 Posted March 30, 2016 well you can check the group using getAccountData, for example if your group system records the clan in an accountdata called "dayzclan" you can use: local playerclan = getAccountData(source,"dayzclan") and then compare if the clan is allowed to open the gate: if (playerclan == "exampleclan") then --whatever end For the distance thing, you can use what our friend here suggested, which is getDistanceBetweenPoints3D, an example, without me testing it, would be using the X Y and Z of the gate, and compare it to the players location: local plx,ply,plz = getElementPosition(source) local distance = getDistanceBetweenPoints3D ( 8378,1064.3000488281,1771,19.700000762939, plx,ply,plz ) if (distance < "50") then --rest of the code end
1LoL1 Posted March 30, 2016 Posted March 30, 2016 well you can check the group using getAccountData, for example if your group system records the clan in an accountdata called "dayzclan" you can use: local playerclan = getAccountData(source,"dayzclan") You are wrong here. Try this: local acc = getPlayerAccount(source) local playerclan = getAccountData(acc, "dayzclan")
knightscript Posted March 30, 2016 Posted March 30, 2016 Forgot that getAccountData needs an account, not an element, thank you @1LoL1
|TSF|FoX Posted March 31, 2016 Author Posted March 31, 2016 Thank you guys very much but i im new in scripting and where to add that things?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now