yMassai Posted July 11, 2012 Share Posted July 11, 2012 (edited) addEventHandler ( "JobCaminhoneiro", getRootElement(), function () setElementModel(source, 202) end ) how can I give temporarily using SetTimer? Edited July 11, 2012 by Guest Link to comment
Castillo Posted July 11, 2012 Share Posted July 11, 2012 You can store timers on a table, for then kill them after quit. Link to comment
yMassai Posted July 11, 2012 Author Share Posted July 11, 2012 want this work as a job. the player picks up the skin temporarily and when you leave employment recovers own skin. Link to comment
Castillo Posted July 11, 2012 Share Posted July 11, 2012 You can save temporary the skin on element data and load it back when leave job. Link to comment
yMassai Posted July 11, 2012 Author Share Posted July 11, 2012 could you give me a list of functions should I use? I'm still learn and thank you for helping me. Link to comment
Castillo Posted July 11, 2012 Share Posted July 11, 2012 setElementData -- To save the old skin. getElementData -- To load the skin when leave job. Link to comment
yMassai Posted July 11, 2012 Author Share Posted July 11, 2012 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? Link to comment
Castillo Posted July 11, 2012 Share Posted July 11, 2012 Use getElementData and check if it's "Trucker". Link to comment
yMassai Posted July 12, 2012 Author Share Posted July 12, 2012 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... Link to comment
Axel Posted July 12, 2012 Share Posted July 12, 2012 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) Link to comment
yMassai Posted July 12, 2012 Author Share Posted July 12, 2012 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) Link to comment
Axel Posted July 12, 2012 Share Posted July 12, 2012 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) Link to comment
Kenix Posted July 13, 2012 Share Posted July 13, 2012 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. Link to comment
Castillo Posted July 13, 2012 Share Posted July 13, 2012 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. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now