FraN-724 Posted November 5, 2012 Share Posted November 5, 2012 Hola quisiera saber Como puedo reservar autos por Clan, tengo uno pero es por Team y cuando alguien elije otro team de spawn ya no puede subirse. Bueno La idea que quiero es saber Reservarlos por ACL del Clan. Aqui Dejo El Script Que Tengo vehicle1 = createVehicle ( 411, -1419.1999511719, -71, 13.89999961853, 0, 0, 0 ) vehicle2 = createVehicle ( 415, -1424.1999511719, -70.800003051758, 14, 0, 0, 0 ) vehicle3 = createVehicle ( 451, -1429.6999511719, -71.099998474121, 13.89999961853, 0, 0, 0 ) function enterVehicle ( thePlayer, seat, jacked ) if ( source == vehicle1 or source == vehicle2 or source == vehicle3 ) and ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "SKA" ) then removePedFromVehicle ( thePlayer ) outputChatBox("Este Vehículo Esta Reservado Para El Clan SKA", thePlayer, 255,90,0, true) end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) Gracias. Link to comment
Renkon Posted November 5, 2012 Share Posted November 5, 2012 Usa un event handler en: OnVehicleEnter y la función isObjectInACLGroup Link to comment
Plate Posted November 5, 2012 Share Posted November 5, 2012 vehicle1 = createVehicle ( 411, -1419.1999511719, -71, 13.89999961853, 0, 0, 0 ) vehicle2 = createVehicle ( 415, -1424.1999511719, -70.800003051758, 14, 0, 0, 0 ) vehicle3 = createVehicle ( 451, -1429.6999511719, -71.099998474121, 13.89999961853, 0, 0, 0 ) function autos ( player, seat, jacked ) if ( seat == 0 and source == auto or source == auto1 or source == auto2 or source == auto3 ) then local accountName = getAccountName ( getPlayerAccount ( player ) ) if ( not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "SKA" ) ) ) then cancelEvent ( ) outputChatBox("Este Vehículo Esta Reservado Para El Clan SKA", thePlayer, 255,90,0, true) end end end addEventHandler ( "onVehicleStartEnter", root, autos ) PD: onVehicleEnter esta mal lo que tenes que usar es onVehicleStartEnter Link to comment
Renkon Posted November 5, 2012 Share Posted November 5, 2012 Lo postié sin fijarme la wiki... Igual creo que me expliqué Por cierto el tuyo está mal y no funcionará ya que estas comparando source con auto1, auto2 y auto3 que no están definidos. Link to comment
Alexs Posted November 5, 2012 Share Posted November 5, 2012 vehicle1 = createVehicle ( 411, -1419.1999511719, -71, 13.89999961853, 0, 0, 0 ) vehicle2 = createVehicle ( 415, -1424.1999511719, -70.800003051758, 14, 0, 0, 0 ) vehicle3 = createVehicle ( 451, -1429.6999511719, -71.099998474121, 13.89999961853, 0, 0, 0 ) function autos ( player, seat, jacked ) if ( seat == 0 and source == auto or source == vehicle1 or source == vehicle2 or source == vehicle3 ) then local accountName = getAccountName ( getPlayerAccount ( player ) ) if ( not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "SKA" ) ) ) then cancelEvent ( ) outputChatBox("Este Vehículo Esta Reservado Para El Clan SKA", thePlayer, 255,90,0, true) end end end addEventHandler ( "onVehicleStartEnter", root, autos ) Ya corregí el de Plate, Aunque no usaría la 7ma linea tan larga, pero debería servir. Link to comment
FraN-724 Posted November 5, 2012 Author Share Posted November 5, 2012 Muchas Gracias a Todos, Me Sirvió Link to comment
Plate Posted November 6, 2012 Share Posted November 6, 2012 OT: Renkon si funciona por que yo lo usaba en mi servidor y funcionaba de 10 PD: me habia olvidado de cambiar auto por vehiculo Link to comment
Recommended Posts