Jump to content

Como hago que anuncio funcione en un auto?


Andrixx

Recommended Posts

Hola.

Estaba creando un script de CNN pero no logro hacer que al escribir "/nn mas el texto" funcione solo para los que se encuentran en el team y vehiculo inidicados.

Server:

  
teamCNN = createTeam ( "CNN News", 100, 255, 100 ) 
cnnVehicles = { [582]=true } 
Teams  = { [teamCNN] =true } 
  
function input_Console ( text )  
    local team = getTeamFromName ( "CNN News" ) 
    if team then 
        if ( cnnVehicles[getElementModel ( source )] ) then 
                local command = gettok ( text, 1, 32 ) 
                if ( command == "nn" ) then 
                        local actionText = string.sub ( text, 3 ) 
                        outputChatBox ( ".:*[CNN News]*:. " .. actionText, getRootElement(), 100, 255, 100 ) 
        end 
end 
end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), input_Console ) 

Entonces, ¿En esta fallando el script y que me falta para lo que necesito? ya que el debugscript 3 me dice 'bad argument getElementModel'.

Gracias

Link to comment
teamCNN = createTeam ( "CNN News", 100, 255, 100 ) 
  
function input_Console ( source, text ) 
    local team = getTeamFromName ( "CNN News" ) 
    if team then 
        veh = getPedOccupiedVehicle(source) 
        if veh and getElementData(veh) == 441 then 
                local command = gettok ( text, 1, 32 ) 
                if ( command == "nn" ) then 
                        local actionText = string.sub ( text, 3 ) 
                        outputChatBox ( ".:*[CNN News]*:. " .. actionText, getRootElement(), 100, 255, 100 ) 
        end 
end 
end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), input_Console ) 

Link to comment
teamCNN = createTeam ( "CNN News", 100, 255, 100 ) 
  
function input_Console ( source text ) 
local team = getTeamFromName ( "CNN News" ) 
    if getPlayerTeam ( team ) == "CNN News" then 
        veh = getPedOccupiedVehicle(source) 
        if veh and getElementData(veh) == 441 then 
            addCommandHandler("nn", 
            function(thePlayer,Command,text) 
                if text then 
                    local actionText = string.sub ( text, 3 ) 
                    outputChatBox ( ".:*[CNN News]*:. " .. actionText, getRootElement(), 100, 255, 100 ) 
                end 
            end) 
        end 
    end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), input_Console ) 

Link to comment
  • Recently Browsing   0 members

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