Jump to content

Ayuda con setElementFrozen


depato123

Recommended Posts

Hola, tengo un problema con este script:

function frenodedMano ( ) 
    if ( isPedInVehicle ( source ) ) then 
        local veh = isElementFrozen ( source ) 
        if ( isElementFrozen ( veh ) == true ) then 
            setElementFrozen ( veh, false ) 
            local px, py, pz = getElementPosition ( source ) 
            for _, v in ipairs ( getElementsByType ( "player" ) ) do 
                if isPlayerInRangeOfPoint ( v, px, py, pz, chat_range ) then 
                    outputChatBox ( "*".. getPlayerName ( source ) .." ah puesto el freno de mano.", v, 255, 40, 80 ) 
                end 
            end 
        else 
            setElementFrozen ( veh, true ) 
            local px, py, pz = getElementPosition ( source ) 
            for _, v in ipairs ( getElementsByType ( "player" ) ) do 
                if isPlayerInRangeOfPoint ( v, px, py, pz, chat_range ) then 
                    outputChatBox ( "*".. getPlayerName ( source ) .." ah removido el freno de mano.", v, 255, 40, 80 ) 
                end 
            end 
        end 
    else 
        outputChatBox ("You aren't in a vehicle!", source, 255, 0, 0) 
    end 
end 
addEvent ( "frenodeMano",true ) 
addEventHandler ( "frenodeMano", getRootElement(), frenodedMano ) 

El error

[2013-11-13 14:18:49] WARNING: vehicles\server.lua:4: Bad argument @ 'isElementFrozen' [Expected element at argument 1, got boolean]

[2013-11-13 14:18:49] WARNING: vehicles\server.lua:13: Bad argument @ 'setElementFrozen' [Expected element at argument 1, got boolean]

[2013-11-13 14:18:52] WARNING: vehicles\server.lua:4: Bad argument @ 'isElementFrozen' [Expected element at argument 1, got boolean]

[2013-11-13 14:18:52] WARNING: vehicles\server.lua:13: Bad argument @ 'setElementFrozen' [Expected element at argument 1, got boolean]

Lo que tendria que pasar si el resource funcionara es lo siguiente: Al apretar un boton que esta trigeado el vehiculo se congela. Pero eso no pasa y sale el error de arriba. !!Ayuda¡¡

Link to comment
  • MTA Team

No esta definido, pone esto:

function frenodedMano ( ) 
    if ( isPedInVehicle ( source ) ) then 
        local veh = getPedOccupiedVehicle ( source ) 
        if ( isElementFrozen ( veh ) == true ) then 
            setElementFrozen ( veh, false ) 
            local px, py, pz = getElementPosition ( source ) 
            for _, v in ipairs ( getElementsByType ( "player" ) ) do 
                if isPlayerInRangeOfPoint ( v, px, py, pz, chat_range ) then 
                    outputChatBox ( "*".. getPlayerName ( source ) .." ah puesto el freno de mano.", v, 255, 40, 80 ) 
                end 
            end 
        else 
            setElementFrozen ( veh, true ) 
            local px, py, pz = getElementPosition ( source ) 
            for _, v in ipairs ( getElementsByType ( "player" ) ) do 
                if isPlayerInRangeOfPoint ( v, px, py, pz, chat_range ) then 
                    outputChatBox ( "*".. getPlayerName ( source ) .." ah removido el freno de mano.", v, 255, 40, 80 ) 
                end 
            end 
        end 
    else 
        outputChatBox ("You aren't in a vehicle!", source, 255, 0, 0) 
    end 
end 
addEvent ( "frenodeMano",true ) 
addEventHandler ( "frenodeMano", getRootElement(), frenodedMano ) 

Link to comment
  • Recently Browsing   0 members

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