Andrixx Posted January 26, 2013 Share Posted January 26, 2013 Hola, he intentado bloquear un auto (el 420) para todos los skin, ha excepcion del skin 303, pero no se como hacerlo. He buscado por la wiki y he encontrado el setVehicleLocked pero dice como bloquear un auto en el que estas y yo no necesito eso No sabria que poner aqui del script porque solo tengo esto function block1( source ) if (getElementModel(source) == 303) end addEventHandler ( "onResourceStart", getRootElement(), block1) Por favor si alguien sabe que me ayude... y si no es muy dificil que lo haga para mi Gracias.. Link to comment
Castillo Posted January 26, 2013 Share Posted January 26, 2013 Eso no tiene el menor sentido. Tenes que usar el evento: onVehicleStartEnter Y: getElementModel cancelEvent Link to comment
Andrixx Posted January 26, 2013 Author Share Posted January 26, 2013 Castillo, he utilizado lo que me dijiste de onVehicleStartEnter Vehicles = { [420]=true } Skins = { [303]=true } function enterVehicle ( player, seat, jacked ) --when a player enters a vehicle if ( Vehicles[getElementModel(source)] ) and ( not Skins[getElementModel(player)] ) then --if the vehicle is one of 4 police cars, and the skin is not a police skin cancelEvent() outputChatBox ( "Tu no eres taxista", player ) --and tell the player why end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) Pero no pueden entrar ni con la "G" ¿Como lo arreglo? Gracias... Link to comment
Castillo Posted January 26, 2013 Share Posted January 26, 2013 Verifica si "seat" es igual a 0. Link to comment
Andrixx Posted January 26, 2013 Author Share Posted January 26, 2013 Como verifico eso?, es primera ves que veo lo de "seat" Link to comment
FraN-724 Posted January 26, 2013 Share Posted January 26, 2013 Prueba Así Vehicles = { [420]=true } Skins = { [303] =true function enterVehicle ( player, seat, jacked ) if ( Vehicles [getElementModel ( source )] ) and ( not Skins [getElementModel ( player )] ) and ( seat == 0 ) then cancelEvent() outputChatBox ( "Tu no eres taxista.", player , 255, 0, 0) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) Link to comment
Castillo Posted January 26, 2013 Share Posted January 26, 2013 Como verifico eso?, es primera ves que veo lo de "seat" "seat" es un argumento en tu funcion. Link to comment
Andrixx Posted January 26, 2013 Author Share Posted January 26, 2013 Gracias a ambos en especial a FraN-724 ya que me diste el script con el "seat", porque no tenia idea de donde iba.. Solucionado Vehicles = { [420]=true } Skins = { [303] =true } function enterVehicle ( player, seat, jacked ) if ( Vehicles [getElementModel ( source )] ) and ( not Skins [getElementModel ( player )] ) and ( seat == 0 ) then cancelEvent() outputChatBox ( "Tu no eres taxista.", player , 255, 0, 0) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) Link to comment
Recommended Posts