Jump to content

Que significa este error y como lo soluciono


vallejo

Recommended Posts

Este es el código, lo tengo del lado del client:

Error: 291nfbb.png

function vehicle() 
    if getElementType(localPlayer) == "player" then 
     
    if isPedInVehicle(localPlayer)==true then  
    return  
    end 
         if isElement( veh ) then  
         destroyElement( veh )  
         end 
         local x,y,z = getElementPosition(localPlayer) 
         veh = createVehicle(462, x, y, z) 
         warpPedIntoVehicle(client, veh) 
end 
end 

Link to comment

warpPedIntoVehicle(localPlayer, veh) Ah y fíjate en esto:

Note: Client side IsPedInVehicle can be unreliable. Solution is to use: not getPedOccupiedVehicle(ped) 

Lo que te recomienda/obliga usar es:

if not getPedOccupiedVehicle( localPlayer ) then 

Sustituyendo el isPedInVehicle

Link to comment
function vehicle() 
    if getElementType(localPlayer) == "player" then 
        if not getPedOccupiedVehicle( localPlayer ) then 
            return  
        end 
         
        if isElement( veh ) then  
            destroyElement( veh )  
         end 
         
        local x,y,z = getElementPosition(localPlayer) 
         veh = createVehicle(462, x,y,z) 
         warpPedIntoVehicle(localPlayer, veh) 
    end 
end 
addEventHandler("onClientGUIClick", Obtener,vehicle, false) -- Boton cerrar 

No me funciona porque?

Link to comment
  • Recently Browsing   0 members

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