Jump to content

[Ayuda] Bloquear autos


Recommended Posts

Hola bueno quiero que los skins 67,68,69,y 70 no puedan entrar a ningun auto pero no me funciona :(

   function bloqeo ( thePlayer, seat, jacked ) 
   local id = getElementModel ( source ) 
     if ( seat == 0 ) and ( id == 67 or id == 68 or id == 69 or id == 70 )  then 
      
        cancelEvent() 
     end 
   end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), bloqeo ) 
   

Link to comment

No estoy seguro pero intenta:

  
-- #Server-Side 
  
 function bloqeo ( thePlayer, seat, jacked ) 
     if ( seat == 0 )  then 
      if (getElementModel( thePlayer ) == 67) or (getElementModel( thePlayer ) == 68) or (getElementModel( thePlayer ) == 69) or (getElementModel( thePlayer ) == 70)  then    
outputChatBox ( "No puedes usar este Coche!", thePlayer, 255, 0, 0, false )   
        cancelEvent() 
     end 
   end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), bloqeo ) 
  

Link to comment
  function bloqeo ( thePlayer, seat, jacked ) 
   local id = getElementModel ( thePlayer ) 
     if ( seat == 0 ) and ( id == 67 or id == 68 or id == 69 or id == 70 )  then 
      
        cancelEvent() 
     end 
   end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), bloqeo ) 
  

tenias puesto getElementModel(source)

y source no esta definido.

Link to comment
  function bloqeo ( thePlayer, seat, jacked ) 
   local id = getElementModel ( thePlayer ) 
     if ( seat == 0 ) and ( id == 67 or id == 68 or id == 69 or id == 70 )  then 
      
        cancelEvent() 
     end 
   end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), bloqeo ) 
  

tenias puesto getElementModel(source)

y source no esta definido.

Gracias ahora si funciona :D

Link to comment
  function bloqeo ( thePlayer, seat, jacked ) 
   local id = getElementModel ( thePlayer ) 
     if ( seat == 0 ) and ( id == 67 or id == 68 or id == 69 or id == 70 )  then 
      
        cancelEvent() 
     end 
   end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), bloqeo ) 
  

tenias puesto getElementModel(source)

y source no esta definido.

Te corrijo: 'source' si esta definido pero representa al vehículo en el que el jugador entra.

Link to comment
  function bloqeo ( thePlayer, seat, jacked ) 
   local id = getElementModel ( thePlayer ) 
     if ( seat == 0 ) and ( id == 67 or id == 68 or id == 69 or id == 70 )  then 
      
        cancelEvent() 
     end 
   end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), bloqeo ) 
  

tenias puesto getElementModel(source)

y source no esta definido.

Te corrijo: 'source' si esta definido pero representa al vehículo en el que el jugador entra.

es posible no mire el evento ... asi que no sabia solo mire los argumentos...

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...