Jump to content

setElementModel


yMassai

Recommended Posts

Posted (edited)
addEventHandler ( "JobCaminhoneiro", getRootElement(), 
function () 
setElementModel(source, 202) 
end 
) 

how can I give temporarily using SetTimer?

Edited by Guest
Posted
trcukJob = setElementData( source, "Occupation", "Trucker", true ) 

function startMarker( hitPlayer ) 
    if ( getElementType(hitPlayer) == "player" and hitPlayer == localPlayer and not(isPedInVehicle(localPlayer)) ) then 
        guiSetVisible ( carrosw, true ) 
        showCursor(true) 
    end 
end 
addEventHandler ( "onClientMarkerHit", getcami, startMarker) 

I want the window open only if the player have the occupation.

What can I do?

Posted
function startMarker( hitPlayer ) 
    if ( getElementType(hitPlayer) == "player" and hitPlayer == localPlayer and not(isPedInVehicle(localPlayer)) ) then 
      elseif (getElementData ( source, "Occupation", "Trucker", true )) then 
        guiSetVisible ( carrosw, true ) 
        showCursor(true) 
    end 
end 
addEventHandler ( "onClientMarkerHit", getcami, startMarker) 

'-' how error, i dont know...

Posted

Maybe this..

function startMarker( hitPlayer ) 
    if ( getElementType(hitPlayer) == "player" and hitPlayer == localPlayer and not(isPedInVehicle(localPlayer)) ) then 
         if (getElementData ( source, "Occupation" ) == "Trucker") then 
        guiSetVisible ( carrosw, true ) 
        showCursor(true) 
    end 
    end 
end 
addEventHandler ( "onClientMarkerHit", getRootElement(), startMarker) 

Posted
Maybe this..
function startMarker( hitPlayer ) 
    if ( getElementType(hitPlayer) == "player" and hitPlayer == localPlayer and not(isPedInVehicle(localPlayer)) ) then 
         if (getElementData ( source, "Occupation" ) == "Trucker") then 
        guiSetVisible ( carrosw, true ) 
        showCursor(true) 
    end 
    end 
end 
addEventHandler ( "onClientMarkerHit", getRootElement(), startMarker) 

Dont work.

Why u put getRootElement()?? i know are from server-side but have a marker to open the window

getcami = createMarker( -50.28254, -1142.70104, 0.12812, "cylinder", 2.0, 255, 255, 0, 170) 

Posted

Yea.. my bad,

  
function startMarker( hitPlayer ) 
if source == getcami then 
    if ( getElementType(hitPlayer) == "player" and hitPlayer == localPlayer and not(isPedInVehicle(localPlayer)) ) then 
         if (getElementData ( hitPlayer, "Occupation" ) == "Trucker") then 
             guiSetVisible ( carrosw, true ) 
             showCursor(true) 
            end 
        end 
    end 
end 
addEventHandler ( "onClientMarkerHit", getRootElement(), startMarker) 

Posted
You can save temporary the skin on element data and load it back when leave job.

You can also store all data in lua tables, it's more faster instead of MTA functions.

Posted

I was going to suggest that, but maybe he needs to use it outside that resource, and it would been harder for him to make a function to export it after.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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