Jump to content

ayuda , deberia dar nombre del auto


Brad96

Recommended Posts

Posted

buenas , estoy haciendo este script practicando , porque soy noob en esto .. enfin .. me podria corregir que pude aver hecho mal o que use mal ? gracias

addCommandHandler("1", 
function carName (theVehicle) 
    local id = getElementModel (theVehicle) 
    if id == 411 or id == 511 then  
    local vehicleName = getVehicleName (theVehicle) 
    outputChatBox("Tu Auto Se Llama " ..vehicleName.." ) 
    end 
end 
addEventHandler ("onPlayerVehicleEnter", getRootElement(),carName) 
) 
 

Posted

Eso no tiene sentido, ¿por qué un comando + addEventHandler?

Además, finalizaste mal el comando. Y el outputChatBox está mal, no lo finalizaste...

function carName (theVehicle) 
    local id = getElementModel (theVehicle) 
    if id == 411 or id == 511 then 
    local vehicleName = getVehicleName (theVehicle) 
    outputChatBox("Tu Auto Se Llama " ..vehicleName.."." ) 
   end 
end 
addCommandHandler("1", carName) 
addEventHandler ("onPlayerVehicleEnter", getRootElement(),carName) 
  

Posted

si , funciona casi perfectamente , solo que se activa cuando entro al auto y la idea es ingresar el comando y que me diga el nombre

Posted

Usa este (eso era por el comando + el evento, y el evento 'onPlayerVehicleEnter' es cuando entras a un vehículo).

function carName (theVehicle) 
    local id = getElementModel (theVehicle) 
    if id == 411 or id == 511 then 
    local vehicleName = getVehicleName (theVehicle) 
    outputChatBox("Tu Auto Se Llama " ..vehicleName.."." ) 
   end 
end 
addCommandHandler("1", carName) 

  • Recently Browsing   0 members

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