Ahmed Abo-elezz Posted November 16, 2014 Share Posted November 16, 2014 please help faaast!!!! i want whan player join job he only can see markers and blips and about other player cant see it only have ajob he can see blips and markers please fix code and show to me edites please faaaaaaaaaaast local Markers = { [1]={ 1819.35986, -2430.48096, 13.55469 }, [2]={ -1306.38330, -249.23454, 14.14844 }, [3]={ 365.97522, 2536.92969, 16.66176 }, [4]={ 1557.38379, 1392.78687, 10.85596 } } local Markere = { [1]={ 1983.82495, -2627.80347, 12.54688 }, [2]={ -1275.60242, 19.60469, 13.14844 }, [3]={ 268.06848, 2464.47119, 15.47656 }, [4]={ 11533.20911, 1775.58008, 9.82031 } } local pedCus = { [1]={ 9 }, [2]={ 10 }, [3]={ 14 } } theteam = createTeam("Driver", 255, 255, 0) Teams = { [theteam] = true } Vehs = { [487 or 593] = true } function Teamin ( ) local team = getTeamFromName ( "Driver" ) if team then setPlayerTeam ( source, team ) setPlayerNametagColor ( source, 0, 255, 0 ) outputChatBox("انت الان طيار", source) end end addEvent ( "JoTeam", true) addEventHandler ( "JoTeam", root, Teamin ) ---------------------------- function enterVehicle ( thePlayer, seat, jacked ) if getElementType ( thePlayer ) == "player" then if ( Vehs[getElementModel ( source )] ) and ( not Teams[getPlayerTeam( thePlayer )] ) then removePedFromVehicle( thePlayer ) outputChatBox("الطيار فقط من يستطع القياده", thePlayer) end end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) ------------------------------ markert = { } blipt = { } pedt = { } cuss = { } cuse = {} function startJob ( thePlayer ) local x, y, z = unpack ( Markers [ math.random ( #Markers ) ] ) markert [ thePlayer ] = createMarker ( x, y, z, "cylinder", 5.0, 255, 0, 0, 0 ) cuss = { getElementPosition( markert [ thePlayer ] ) } local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) pedt [ thePlayer ] = createPed( skins, x, y, z ) blipt [ thePlayer ] = createBlipAttachedTo ( markert [ thePlayer ], 58 ) addEventHandler ( "onMarkerHit", markert [ thePlayer ], warpit ) end function inVEH ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then if ( getElementModel ( source ) == 487 or 593) then startJob ( thePlayer ) end end end addEventHandler ( "onVehicleEnter", getRootElement(), inVEH ) function warpit ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then local vehiclee = getPedOccupiedVehicle ( thePlayer ) if ( getElementModel ( vehiclee ) == 487 or 593 ) then setTimer ( warpPedIntoVehicle, 500, 1, pedt [ thePlayer ], vehiclee, 2 ) destroyJob ( thePlayer ) local x, y, z = unpack ( Markere [ math.random ( #Markere ) ] ) markert [ thePlayer ] = createMarker ( x, y, z - 1, "cylinder", 5.0, 255, 0, 0, 50 ) cuse = { getElementPosition( markert [ thePlayer ] ) } blipt [ thePlayer ] = createBlipAttachedTo ( markert [ thePlayer ], 56 ) addEventHandler ( "onMarkerHit", markert [ thePlayer ], pickmeup ) end end end function pickmeup ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then destroyJob ( thePlayer ) local mx, my, mz = unpack ( cuss ) local mmx, mmy, mmz = unpack ( cuse ) local money = getDistanceBetweenPoints2D ( mx, my, mmx, mmy ) finalmoney = 2 * math.floor ( money ) if finalmoney then setTimer( givePlayerMoney, 500, 1, thePlayer, finalmoney ) setTimer ( function ( ) if ( isElement ( pedt [ thePlayer ] ) ) then destroyElement ( pedt [ thePlayer ] ) end startJob ( thePlayer ) end ,500, 1 ) end end end function deleteOnExit ( thePlayer ) if ( isElement ( markert [ thePlayer ] ) ) then destroyElement ( markert [ thePlayer ] ) end if ( isElement ( blipt [ thePlayer ] ) ) then destroyElement ( blipt [ thePlayer ] ) end if ( isElement ( pedt [ thePlayer ] ) ) then destroyElement ( pedt [ thePlayer ] ) end end addEventHandler ( "onVehicleExit", getRootElement(), deleteOnExit ) function destroyJob ( thePlayer ) if ( isElement ( markert [ thePlayer ] ) ) then destroyElement ( markert [ thePlayer ] ) end if ( isElement ( blipt [ thePlayer ] ) ) then destroyElement( blipt [ thePlayer ] ) end end -------------------------------------------------------- addEvent("driver1",true) addEventHandler("driver1",root, function () setPedSkin ( source, 253 ) end ) ----------------------------------- addEvent("driver2",true) addEventHandler("driver2",root, function () setPedSkin ( source, 297 ) end ) ----------------------- addEvent("car1",true) addEventHandler("car1",root, function () if ( isElement ( vehicle ) ) then destroyElement ( vehicle ) end vehicle = createVehicle ( 487, 1948.95215, -2284.68774, 13.54688 ) warpPedIntoVehicle ( source, vehicle ) end ) ------------------------------------ addEvent("car2",true) addEventHandler("car2",root, function () if ( isElement ( vehicle ) ) then destroyElement ( vehicle ) end vehicle = createVehicle ( 593, 1948.95215, -2284.68774, 13.54688 ) warpPedIntoVehicle ( source, vehicle ) end ) Link to comment
Perfect Posted November 17, 2014 Share Posted November 17, 2014 First calm down, Second It is not that serious like you are thinking, Its just a freaking script. Third your "ffffaasssst!!!!111" will not make it any better for us to help you, after all it is in our hands to help you or not. Fourth and last, try your self to fix it using the following function:- setElementVisibleTo Link to comment
SkatCh Posted November 17, 2014 Share Posted November 17, 2014 (edited) First calm down, Second It is not that serious like you are thinking, Its just a freaking script. Third your "ffffaasssst!!!!111" will not make it any better for us to help you, after all it is in our hands to help you or not. Fourth and last, try your self to fix it using the following function:- setElementVisibleTo i agree with you , anyway he already gave u the correct answer. Edited November 17, 2014 by Guest Link to comment
Perfect Posted November 17, 2014 Share Posted November 17, 2014 anyway he already gave the correct answer. What ? Who gave the what answer ? 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