Jump to content

Recommended Posts

local myMarker = createMarker (1098.0620117188, -1772.7397460938, 13.346570014954, "cylinder", 2, 225, 250, 255, 125) 
function visible(source) 
local tteam = getElementData( source, "Occupation", "Taxi Driver", true ) 
    local wanted = getPlayerWantedLevel (localPlayer) 
        local vehicle = getPedOccupiedVehicle (localPlayer) 
    if ((not vehicle) and (wanted == 0)) then 
                guiSetVisible(window,true) 
                showCursor(true) 
    end 
    setElementVisibleTo ( myMarker, getRootElement (source), false ) 
    setElementVisibleTo ( myMarker, tteam, true ) 
    end 
    addEventHandler ("onClientMarkerHit", myMarker, visible) 

n7eb l marker hethi matraha w mate5demlk ken ki tebda occupation mte3ek Taxi Driver

Link to comment

setElementVisibleTo => server side only

-- Client Side: 
local myMarker = createMarker (1098.0620117188, -1772.7397460938, 13.346570014954, "cylinder", 2, 225, 250, 255, 125) 
  
function visible() 
    local tteam = getElementData( localPlayer, "Occupation") 
    local wanted = getPlayerWantedLevel (localPlayer) 
    local vehicle = getPedOccupiedVehicle (localPlayer) 
    if ((not vehicle) and (wanted == 0)and (tteam == "Taxi Driver")) then 
        guiSetVisible(window,true) 
        showCursor(true) 
    end 
    triggerServerEvent("viSible", getLocalPlayer(), myMarker) 
end 
addEventHandler ("onClientMarkerHit", myMarker, visible) 
  
-- Server Side 
function serverSide(myMarker) 
setElementVisibleTo ( myMarker, getRootElement (), false ) 
setElementVisibleTo ( myMarker, tteam, true ) 
end 
addEvent("viSible", true) 
addEventHandler("viSible", root, serverSide) 

Link to comment
    -- Server Side: 
    function serverSide(myMarker) 
    local tteam = getElementData( source, "Occupation") 
    if (tteam == "Taxi Driver") then 
    setElementVisibleTo ( myMarker, getRootElement (), false ) 
    setElementVisibleTo ( myMarker, tteam, true ) 
    end 
    end 
    addEvent("viSible", true) 
    addEventHandler("viSible", root, serverSide) 
      
    -- Client Side: 
    local myMarker = createMarker (1098.0620117188, -1772.7397460938, 13.346570014954, "cylinder", 2, 225, 250, 255, 125) 
      
    function disableMarker() 
    triggerServerEvent("viSible", getLocalPlayer(), myMarker) 
    end 
    addEventHandler ("onClientResourceStart", resourceRoot, disableMarker) 
      
    function visible() 
        local wanted = getPlayerWantedLevel (localPlayer) 
        local vehicle = getPedOccupiedVehicle (localPlayer) 
        if ((not vehicle) and (wanted == 0)) then 
            guiSetVisible(window,true) 
            showCursor(true) 
        end 
    end 
    addEventHandler ("onClientMarkerHit", myMarker, visible) 

Link to comment

Muahahahaha, this is it :P

setElementAlpha trick :D

-- Server Side: 
local myMarker = createMarker (1098.0620117188, -1772.7397460938, 13.346570014954, "cylinder", 2, 225, 250, 255, 125) 
  
function serverSide() 
    for k,v in ipairs(getElementsByType("player")) do 
        local occ = getElementData(v, "Occupation") 
        if (occ == "Taxi Driver") then 
            setElementAlpha(myMarker, 125) 
        elseif not(occ == "Taxi Driver") then 
            setElementAlpha(myMarker, 0) 
        end 
    end 
end 
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), serverSide) 
  
function serverVisible(thePlayer) 
    local wanted = getPlayerWantedLevel(thePlayer) 
    local vehicle = getPedOccupiedVehicle(thePlayer) 
    if ((getElementData(thePlayer, "Occupation") == "Taxi Driver") and (not vehicle) and (wanted == 0)) then 
        triggerClientEvent(thePlayer, "clientSide", root) 
    end 
end 
addEventHandler("onMarkerHit", myMarker, serverVisible) 
  
-- Client Side: 
function clientVisible() 
    guiSetVisible(window, true) 
    showCursor(true) 
end 
addEvent("clientSide", true) 
addEventHandler("clientSide", root, clientVisible) 

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