local bmse = createObject(980, 1773.8, -1113.8, 21.6, 0, 0, 270)exports.pool:allocateElement(bmse)local bmsk = createObject(980, 1773.69995, -1130.19995,18.6, 0, 0, 270)exports.pool:allocateElement(bmsk)local open = falselocal which = 0-- Gate codefunction bms(thePlayer)local x, y, z = getElementPosition(thePlayer)local distance1 = getDistanceBetweenPoints3D(1773.8,-1113.8, 21.6)local distance2 = getDistanceBetweenPoints3D(1773.69995, -1130.19995,18.6)if (distance1<=10) and (open==false) thenif (exports.global:hasItem(thePlayer, 145) or exports.global:hasItem(thePlayer, 82)) then open = true which = 1 outputChatBox(\"LSPD sorompó nyitva!\", thePlayer, 0, 255, 0) moveObject(bmse, 1000,1773.8,-1113.8, 20.2, 0, 0, 270) setTimer(bmsc, 5000, 1, thePlayer)endelseif (distance2<=10) and (open==false) thenif (exports.global:hasItem(thePlayer, 145)) then open = true which = 2 outputChatBox(\"LSPD Barrier is now Open!\", thePlayer, 0, 255, 0) moveObject(bmsk, 1000, 1773.69995, -1130.19995, 17.3, 0, 0, 270) setTimer(bmsc, 5000, 1, thePlayer)endendendaddCommandHandler(\"gate\", bms)function bmsc(thePlayer)setTimer(resetState7, 1000, 1)if (which==1) thenwhich = 0moveObject(bmse, 1000, 1773.8, -1113.8, 21.6, 0, 0, 270)elseif (which==2) thenwhich = 0moveObject(bmsk, 1000, 1773.69995, -1130.19995,18.6, 0, 0, 270)endendfunction resetState7()open = falseend
if (distance1<=10) and (open==false) then
kapuelott = createColSphere ( float fX, float fY, float fZ, float fRadius )
if (isElementWithinColShape(player, kapuelott)) then
Hát én colShape-el oldanám meg, véleményem szerint sokkal egyszerűbb.Létrehozás: kapuelott = createColSphere ( float fX, float fY, float fZ, float fRadius ) Lekérdezés: if (isElementWithinColShape(player, kapuelott)) then
Hát én colShape-el oldanám meg, véleményem szerint sokkal egyszerűbb.Létrehozás: kapuelott = createColSphere ( float fX, float fY, float fZ, float fRadius ) Lekérdezés: if (isElementWithinColShape(player, kapuelott)) then colsphape-el is kell megoldani, hiszen a getDistanceBetweenPoints3D-el oldalról is kitudja nyitni pl, és ha túl nagy a távolság, akkor egymásba is buggolnak a kapuk. [/quote]Oh, köszönöm, ezt nem is tudtam:D Igaz mindig colShapet használtam, de legalább ezt is megtanultam:D
local distance1 = getDistanceBetweenPoints3D(1773.8,-1113.8, 21.6)local distance2 = getDistanceBetweenPoints3D(1773.69995, -1130.19995,18.6)
local distance1 = getDistanceBetweenPoints3D(1773.8,-1113.8, 21.6, x, y, z)local distance2 = getDistanceBetweenPoints3D(1773.69995, -1130.19995,18.6, x, y, z)