Zoon Posted September 23, 2012 Share Posted September 23, 2012 hola amigos, vengo aqui haber si me podrian ayudar con esto tengo este scrip de puertas automaticas funciona bien pero quisiera saber como puedo hacer para que solo se les abra la puerta a los del team "militar" aqui dejo el scrip haber si me pueden ayudar o decirme que debo hacer gracias. se los agradesco airportgate = createObject (10828, 1743.6999511719, 536.20001220703, 38.400001525879, 0, 0, 341.53845214844) MarkerOpen = createMarker (1749.6029052734, 554.51977539063, 25.887992858887, "cylinder",10, 255, 0, 0, 255) MarkerClose = createMarker (1735.0040283203, 510.98870849609, 28.605186462402,"cylinder",10, 255, 0, 0, 255) function abrir ( ) moveObject (airportgate, 5000, 1743.6999511719, 536.20001220703, 22.60000038147) end function cerrar() moveObject (airportgate, 5000, 1743.6999511719, 536.20001220703, 38.400001525879) end addEventHandler( "onMarkerHit", MarkerOpen, abrir) addEventHandler( "onMarkerHit", MarkerClose, cerrar) Link to comment
Alexs Posted September 23, 2012 Share Posted September 23, 2012 airportgate = createObject (10828, 1743.6999511719, 536.20001220703, 38.400001525879, 0, 0, 341.53845214844) MarkerOpen = createMarker (1749.6029052734, 554.51977539063, 25.887992858887, "cylinder",10, 255, 0, 0, 255) MarkerClose = createMarker (1735.0040283203, 510.98870849609, 28.605186462402,"cylinder",10, 255, 0, 0, 255) function abrir ( hitElement ) if getTeamName(getPlayerTeam(hitElement)) == "Militar" then moveObject (airportgate, 5000, 1743.6999511719, 536.20001220703, 22.60000038147) end end function cerrar(hitElement) if getTeamName(getPlayerTeam(hitElement)) == "Militar" then moveObject (airportgate, 5000, 1743.6999511719, 536.20001220703, 38.400001525879) end end addEventHandler( "onMarkerHit", MarkerOpen, abrir) addEventHandler( "onMarkerHit", MarkerClose, cerrar) Link to comment
Zoon Posted September 23, 2012 Author Share Posted September 23, 2012 gracias funciona pero solo un problemita cada ves que alguien que no es del team militar se pone encima del marker sale este error [2012-09-23 15:03:44] WARNING: PuertaMilitar\server.lua:8: Bad argument @ 'getTeamName' que pueo hacer para que no salga eso? Link to comment
Renkon Posted September 23, 2012 Share Posted September 23, 2012 (edited) airportgate = createObject (10828, 1743.6999511719, 536.20001220703, 38.400001525879, 0, 0, 341.53845214844) MarkerOpen = createMarker (1749.6029052734, 554.51977539063, 25.887992858887, "cylinder",10, 255, 0, 0, 255) MarkerClose = createMarker (1735.0040283203, 510.98870849609, 28.605186462402,"cylinder",10, 255, 0, 0, 255) function abrir ( hitElement ) if getTeamName(getPlayerTeam(hitElement)) ~= "Militar" then return end moveObject (airportgate, 5000, 1743.6999511719, 536.20001220703, 22.60000038147) end function cerrar(hitElement) if getTeamName(getPlayerTeam(hitElement)) ~= "Militar" then return end moveObject (airportgate, 5000, 1743.6999511719, 536.20001220703, 38.400001525879) end addEventHandler( "onMarkerHit", MarkerOpen, abrir) addEventHandler( "onMarkerHit", MarkerClose, cerrar) Edited September 23, 2012 by Guest Link to comment
Renkon Posted September 23, 2012 Share Posted September 23, 2012 ahi te lo edite. proba devuelta Link to comment
Recommended Posts