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

Community Profile MTA:SA = Click Here

Posted

You can store timers on a table, for then kill them after quit.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
setElementData -- To save the old skin. 
getElementData -- To load the skin when leave job. 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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?

Community Profile MTA:SA = Click Here

Posted

Use getElementData and check if it's "Trucker".

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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...

Community Profile MTA:SA = Click Here

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) 

Community Profile MTA:SA = Click Here

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.

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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...