SpriN' Posted January 16, 2013 Share Posted January 16, 2013 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
Sparrow Posted January 16, 2013 Share Posted January 16, 2013 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
SpriN' Posted January 16, 2013 Author Share Posted January 16, 2013 walet l marker mate5dem (ma3neha tjik l gui) ken ki tebda occupation "taxi driver" ama ki tebda occupation moch taxi driver l gui matjich ama l marker tetra Link to comment
Sparrow Posted January 16, 2013 Share Posted January 16, 2013 -- 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
SpriN' Posted January 16, 2013 Author Share Posted January 16, 2013 tawa rej3et 3adeya kima melowl ma3neha 3andk l occuption wala ma3andekch be9i tra fil marker w te5dem Link to comment
Sparrow Posted January 16, 2013 Share Posted January 16, 2013 ok, nrigel el code w nchoufou 3la serveuri w npostih Link to comment
SpriN' Posted January 16, 2013 Author Share Posted January 16, 2013 ok, nrigel el code w nchoufou 3la serveuri w npostih ok rigel jawek Link to comment
Sparrow Posted January 16, 2013 Share Posted January 16, 2013 Muahahahaha, this is it setElementAlpha trick -- 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
SpriN' Posted January 16, 2013 Author Share Posted January 16, 2013 lol marker invisible walét xDD kol chay jawou behi ken l marker 7ata ki ne5ou el occupation to93ed invisble xDD Link to comment
Sparrow Posted January 16, 2013 Share Posted January 16, 2013 lezemk ta3ml start lil script wa9teli 3andk "Taxi Driver" occupation zid event "onElementDataChange" bech ki tetbadel el elemnt data, el marker ywali vis/invis Link to comment
SpriN' Posted January 16, 2013 Author Share Posted January 16, 2013 c bon addEventHandler("onElementDataChange",getRootElement(), serverSide) jawha behi tawa ty fama warning: bad 'element' pointer @ getPlayerWantedLevel'(1) bad 'ped' pointer @ getPlayerOccupiedVehicle'(1) e zouz teb3in e server side btw 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