Narutimmy Posted August 14, 2013 Share Posted August 14, 2013 Hola bueno ise este script... pero no me crea la puerta... me ayudan?? ----------- Puerta 1------------ objeto1 = createObject ( 13028, -2563.19995, 580.40002, 15.3, 0, 0, 0 ) setObjectScale ( objeto1, 5) Estado = true function Funcion1 (source) if ( getElementData ( source, "gang" ) == "XANA" ) and (Estado == true) then moveObject ( objeto1, 2000, -2563.19995, 580.40002, 5, 0, 0, 0 ) outputChatBox ( "Bienvenido", source, 0, 255, 0, true ) Estado = false elseif ( getElementData ( source, "gang" ) == "XANA" ) and (Estado == false) Estado = true moveObject ( objeto1, 2000, -2563.19995, 580.40002, 15.3, 0, 0, 0 ) outputChatBox ( "Cerrando Puerta", source, 255, 0, 0, true ) end end addCommandHandler ( "BS", Funcion1 ) Link to comment
Daniel1zD Posted August 14, 2013 Share Posted August 14, 2013 Funcion1 = createObject ( 13028, -2563.19995, 580.40002, 15.3, 0, 0, 0) isMoved = false function Funcion1(player) --if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("EJEMPLO")) then ---- ACL si gustas añadirlo if not isMoved then moveObject (objeto1, 2500, -2563.19995, 580.40002, 5, 0, 0, 0) outputChatBox("Bienvenido", player, 255,255,0, true) else moveObject (objeto1, -2563.19995, 580.40002, 15.3, 0, 0, 0) outputChatBox("Cerrando Puerta.", player, 255,255,0, true) end isMoved = not isMoved end end addCommandHandler("BS", Funcion1) seria algo asi no ? Link to comment
Narutimmy Posted August 14, 2013 Author Share Posted August 14, 2013 Funcion1 = createObject ( 13028, -2563.19995, 580.40002, 15.3, 0, 0, 0) isMoved = false function Funcion1(player) --if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("EJEMPLO")) then ---- ACL si gustas añadirlo if not isMoved then moveObject (objeto1, 2500, -2563.19995, 580.40002, 5, 0, 0, 0) outputChatBox("Bienvenido", player, 255,255,0, true) else moveObject (objeto1, -2563.19995, 580.40002, 15.3, 0, 0, 0) outputChatBox("Cerrando Puerta.", player, 255,255,0, true) end isMoved = not isMoved end end addCommandHandler("BS", Funcion1) seria algo asi no ? pero para aumentarle la scala al objeto? Link to comment
Daniel1zD Posted August 14, 2013 Share Posted August 14, 2013 (edited) Funcion1 = createObject ( 13028, -2563.19995, 580.40002, 15.3, 0, 0, 0) isMoved = false setObjectScale ( objeto1, 5 ) function Funcion1(player) --if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("EJEMPLO")) then ---- ACL si gustas añadirlo if not isMoved then moveObject (objeto1, 2500, -2563.19995, 580.40002, 5, 0, 0, 0) outputChatBox("Bienvenido", player, 255,255,0, true) else moveObject (objeto1, 2500,-2563.19995, 580.40002, 15.3, 0, 0, 0) outputChatBox("Cerrando Puerta.", player, 255,255,0, true) end isMoved = not isMoved end end addCommandHandler("BS", Funcion1) perdón por el fallo puedes intentar con este Edited August 14, 2013 by Guest Link to comment
Narutimmy Posted August 14, 2013 Author Share Posted August 14, 2013 setObjectScale () ya lo tenia eso en el primero post, pero no lo pude aplicar bien... Link to comment
Bc# Posted August 14, 2013 Share Posted August 14, 2013 Tienes un error horrendo al comienzo al llamar a la variable de objeto como "Funcion1", tendría que ser así mira: objeto1 = createObject ( 13028, -2563.19995, 580.40002, 15.3, 0, 0, 0) isMoved = false setObjectScale ( objeto1, 5 ) function Funcion1(player) --if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("EJEMPLO")) then ---- ACL si gustas añadirlo if not isMoved then moveObject (objeto1, 2500, -2563.19995, 580.40002, 5, 0, 0, 0) outputChatBox("Bienvenido", player, 255,255,0, true) else moveObject (objeto1, 2500,-2563.19995, 580.40002, 15.3, 0, 0, 0) outputChatBox("Cerrando Puerta.", player, 255,255,0, true) end isMoved = not isMoved end end addCommandHandler("BS", Funcion1) Link to comment
Narutimmy Posted August 14, 2013 Author Share Posted August 14, 2013 Tienes un error horrendo al comienzo al llamar a la variable de objeto como "Funcion1", tendría que ser así mira: objeto1 = createObject ( 13028, -2563.19995, 580.40002, 15.3, 0, 0, 0) isMoved = false setObjectScale ( objeto1, 5 ) function Funcion1(player) --if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("EJEMPLO")) then ---- ACL si gustas añadirlo if not isMoved then moveObject (objeto1, 2500, -2563.19995, 580.40002, 5, 0, 0, 0) outputChatBox("Bienvenido", player, 255,255,0, true) else moveObject (objeto1, 2500,-2563.19995, 580.40002, 15.3, 0, 0, 0) outputChatBox("Cerrando Puerta.", player, 255,255,0, true) end isMoved = not isMoved end end addCommandHandler("BS", Funcion1) sep ,ya note el error jeje , gracias. Link to comment
Narutimmy Posted August 14, 2013 Author Share Posted August 14, 2013 perdon por ese fallo No pasa nada , me ayudastes Link to comment
NIKO_19997 Posted August 16, 2013 Share Posted August 16, 2013 desde hace un tiempo uso ese systema de puertas , pero aveces se me bugea .......nose si les pasa a ustedes Link to comment
Rankox Posted August 16, 2013 Share Posted August 16, 2013 desde hace un tiempo uso ese systema de puertas , pero aveces se me bugea .......nose si les pasa a ustedes La puerta del post https://forum.multitheftauto.com/viewtopic.php?f=145&t=49563 Se bugea al haber varias puertas, y si mientras una esta abajo y intentas bajar o subir otra no lo hace Link to comment
MTA Team 0xCiBeR Posted August 17, 2013 MTA Team Share Posted August 17, 2013 Se soluciona cambiando la logica de la funcion utilizando: getElementPosition Y comparando lo que obtiene con tus 2 valores.. Tambien seria util utilizar la funcion(para comprobar si la puerta esta en movimiento y cancelar la ejecucion del comando): function isElementMoving(theElement) if isElement(theElement)then --First check if the given argument is an element local x, y, z = getElementVelocity(theElement) --Get the velocity of the element given in our argument return x ~= 0 or y ~= 0 or z ~= 0 --When there is a movement on X, Y or Z return true because our element is moving end return false end Asi lo uso yo, y funciona lo mas bien (Funcion Util de aqui: https://wiki.multitheftauto.com/wiki/IsElementMoving Link to comment
Recommended Posts