Jump to content

Ayuda please


Matt

Recommended Posts

local vehicle = createVehicle (411, -2914.0886230469, 460.09802246094, 4.9140625)

addEventHandler ( "onVehicleStartEnter", root,

function ( thePlayer, seat )

if ( seat ~= 0 ) then --

end

if ( source == vehicle ) then --

if ( getPlayerName ( thePlayer ) and getPlayerName ( getPlayerName ( thePlayer ) ) ~= "Matt" ) then --

outputChatBox ( "Este Vehiculo esta reservado para el user Matt", thePlayer, 255, 342, 78 )

cancelEvent ( )

end

end

end

)

Yo lo puse asi pero no puedo entrar me sale error

Link to comment

Intenta Así

Matt = createVehicle (411, -2914.0886230469, 460.09802246094, 4.9140625) 
setElementData(Matt , "owner", "Matt") 
setVehicleDamageProof (Matt, true ) 
  
  
  
function onLockedVehicleEnter ( player, seat, jacked ) 
    if getElementData(source, "owner") and getElementData(source, "owner" ) ~= getAccountName(getPlayerAccount(player)) and ( seat == 0 ) then 
        outputChatBox ("Propiedad De "..tostring(getElementData(source, "owner"  )), player, 255, 50, 0) 
        cancelEvent() 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), onLockedVehicleEnter ) 

Link to comment

Y para poner el coche solo con un color como seria para que sea solo de color negro es un ejemplo

Una cosa mas para hacer un comando para que el que tenga reservado el auto se lo pueda prestar a otro user seria un comando tipo /prestarvehi y se abren las puertas para que entren la gente o bueno me refiero para prestar a la gente gacias.

Link to comment

por esa cara ke pones supongo que quieres que te lo den echo e_e ??

    Matt = createVehicle (411, -2914.0886230469, 460.09802246094, 4.9140625) 
    setElementData(Matt , "owner", "Matt") 
    setVehicleDamageProof (Matt, true ) 
    setVehicleColor ( Matt , 255 , 255 , 255 , 0 , 0 , 0 ) -- los numeros 255, 255 , 255 es el primer color del auto segun el color ke kieras puede cambiarse entre 0 - 255 y los numeros 0 , 0 , 0 es el segundo color del autos tambien pueden cambiarse entre 0 y 255 ( ahora mismo el auto sera, el color 1 blanco y el color 2 negro ) 
      
      
      
    function onLockedVehicleEnter ( player, seat, jacked ) 
        if getElementData(source, "owner") and getElementData(source, "owner" ) ~= getAccountName(getPlayerAccount(player)) and ( seat == 0 ) then 
            outputChatBox ("Propiedad De "..tostring(getElementData(source, "owner"  )), player, 255, 50, 0) 
            cancelEvent() 
        end 
    end 
    addEventHandler ( "onVehicleStartEnter", getRootElement(), onLockedVehicleEnter ) 

Link to comment

El Problema que le veo, es que con este método seria poco eficiente y trabajo innecesario hacer mas de 1 vehículo, te recomiendo buscar una forma mas automatizada.

PD:

Para que comprobar 2 veces si el vehículo tiene dueño?

  if getElementData(source, "owner") and getElementData(source, "owner" ) ~= getAccountName(getPlayerAccount(player)) and ( seat == 0 ) then 

Edited by Guest
Link to comment
  • Recently Browsing   0 members

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