Jump to content

setElementModel


yMassai

Recommended Posts

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

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

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

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