khaledmhammed Posted August 29, 2015 Share Posted August 29, 2015 السلام عليكم كيفككم باختصار ممعي مود جربته تمام ذذ لكن طلع فيه مشكله الحين لو الاعب نزل من الموتر البلب يختفي لكن لو مات وهو داخل الموتر ورسبن البلب ماراح يختفي وراح يكون بق لذالك ابي اخليه الماركر يختفي لو الاعب مات وهو داخل السيارة .. اتمنى الافادة هذا الكود اللي ممكن تحتاجونه حاولت اسوي حدث الموت بدال بدال حدث النزول من سياره لكن اكتشفت ان الحدث الموت سيرفر وقلت ممكن تحتاج ترايقر و يمكن لا ومو فاهم لة addEvent ( "barco_set_locationPizz", true ) addEventHandler ( "barco_set_locationPizz", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 ) blip = createBlipAttachedTo ( marker, 23 ) addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) end ) function onBarcoStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "pizza_finishPizz", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end addEventHandler ( "onClientVehicleExit", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end ) Link to comment
iMr.SFA7 Posted August 29, 2015 Share Posted August 29, 2015 فيه أحداث كلنت وفيه أحداث سيرفر "onClientPlayerWasted" -- Client Side "onPlayerWasted" -- Server Side Link to comment
khaledmhammed Posted August 29, 2015 Author Share Posted August 29, 2015 اهاا صح والله لكن سويته ذا الحدث ونسخت الكود تحته وحطيت addEventHandler ( "onClientPlayerWasted", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end ) Link to comment
iMr.SFA7 Posted August 29, 2015 Share Posted August 29, 2015 addEvent ( "barco_set_locationPizz", true ) addEventHandler ( "barco_set_locationPizz", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 ) blip = createBlipAttachedTo ( marker, 23 ) addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) end ) function onBarcoStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "pizza_finishPizz", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end addEventHandler ( "onClientPlayerWasted", root, function ( ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end ) Link to comment
khaledmhammed Posted August 29, 2015 Author Share Posted August 29, 2015 ماشتغل البلب معاد يطلع Link to comment
iMr.SFA7 Posted August 29, 2015 Share Posted August 29, 2015 ماشتغل البلب معاد يطلع الدي بق يقول شيء ؟ Link to comment
khaledmhammed Posted August 29, 2015 Author Share Posted August 29, 2015 مافي خطاء يمكن انا غلطت ب التركيب شوف ذا كامل function pe () if guiGetVisible (GUIEditor.window) == true then else showCursor (true) guiSetVisible (GUIEditor.window,true) end end addEvent ("MinerPizz", true) addEventHandler ("MinerPizz",root, pe) addEvent ( "barco_set_locationPizz", true ) addEventHandler ( "barco_set_locationPizz", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 ) blip = createBlipAttachedTo ( marker, 41 ) addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) end ) function onBarcoStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "pizza_finishPizz", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end addEventHandler ( "onClientVehicleExit", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end ) GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Marker = {} GUIEditor_Window = {} vehicleId = {448}--1279.17859 -805.24109 86.12299 GUIEditor_Marker[1] = createMarker(1224.5068359375, -900.4482421875, 42.898097991943-1,"cylinder",2,255,255,0,255) -- السيارة GUIEditor_Marker[2] = createMarker(1209.6396484375, -904.720703125, 43.020980834961,"cylinder",3,255,0,0,0) -- الكلام فوق البيد local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(432, 152, 211, 297,"Pizz Job",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9, 22, 192, 228,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9) GUIEditor_Button[2] = guiCreateButton(9, 255, 81, 33,"Select",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(127, 255, 74, 33,"Close",false,GUIEditor_Window[1]) for i,id in ipairs ( vehicleId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) end ------------------------------------------------------------------------------------------------------ addEventHandler ("onClientMarkerHit", GUIEditor_Marker[1], function( player ) if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'Pizz' and not isPedInVehicle( player ) and player == localPlayer then x999,y999,z999 = getElementPosition( localPlayer ) setElementFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) end end ) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) showCursor( false ) setElementFrozen ( localPlayer, false ) elseif ( source == GUIEditor_Button[2] ) then local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent('gvoaPizz', getLocalPlayer(), name) guiSetVisible(GUIEditor_Window[1],false) setElementFrozen ( localPlayer, false ) showCursor( false ) end end ) ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition (GUIEditor_Marker[2]) local x2, y2, z2 = getElementPosition(localPlayer) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then local sx, sy = getScreenFromWorldPosition(x, y, z+2) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 100) then dxDrawText("Pizz Job", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") dxDrawText("Pizz Job", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") end end end end) Link to comment
iMr.SFA7 Posted August 29, 2015 Share Posted August 29, 2015 function pe () if guiGetVisible (GUIEditor.window) == true then else showCursor (true) guiSetVisible (GUIEditor.window,true) end end addEvent ("MinerPizz", true) addEventHandler ("MinerPizz",root, pe) addEvent ( "barco_set_locationPizz", true ) addEventHandler ( "barco_set_locationPizz", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 ) blip = createBlipAttachedTo ( marker, 41 ) addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) end ) function onBarcoStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "pizza_finishPizz", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end function destroy ( ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end addEventHandler ("onClientPlayerVehicleExit",root,destroy) addEventHandler ( "onClientPlayerWasted", localPlayer,destroy) GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Marker = {} GUIEditor_Window = {} vehicleId = {448}--1279.17859 -805.24109 86.12299 GUIEditor_Marker[1] = createMarker(1224.5068359375, -900.4482421875, 42.898097991943-1,"cylinder",2,255,255,0,255) -- السيارة GUIEditor_Marker[2] = createMarker(1209.6396484375, -904.720703125, 43.020980834961,"cylinder",3,255,0,0,0) -- الكلام فوق البيد local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(432, 152, 211, 297,"Pizz Job",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9, 22, 192, 228,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9) GUIEditor_Button[2] = guiCreateButton(9, 255, 81, 33,"Select",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(127, 255, 74, 33,"Close",false,GUIEditor_Window[1]) for i,id in ipairs ( vehicleId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) end ------------------------------------------------------------------------------------------------------ addEventHandler ("onClientMarkerHit", GUIEditor_Marker[1], function( player ) if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'Pizz' and not isPedInVehicle( player ) and player == localPlayer then x999,y999,z999 = getElementPosition( localPlayer ) setElementFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) end end ) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) showCursor( false ) setElementFrozen ( localPlayer, false ) elseif ( source == GUIEditor_Button[2] ) then local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent('gvoaPizz', getLocalPlayer(), name) guiSetVisible(GUIEditor_Window[1],false) setElementFrozen ( localPlayer, false ) showCursor( false ) end end ) ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition (GUIEditor_Marker[2]) local x2, y2, z2 = getElementPosition(localPlayer) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then local sx, sy = getScreenFromWorldPosition(x, y, z+2) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 100) then dxDrawText("Pizz Job", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") dxDrawText("Pizz Job", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") end end end end) Link to comment
khaledmhammed Posted August 29, 2015 Author Share Posted August 29, 2015 عداك العيب تممام وتختفي ولا احلى .. شكرأ لك فكيت ازمةة بالكود Link to comment
iMr.SFA7 Posted August 29, 2015 Share Posted August 29, 2015 عداك العيب تممام وتختفي ولا احلى ..شكرأ لك فكيت ازمةة بالكود حيآكك في آي وقت / Any Time ! Link to comment
khaledmhammed Posted August 29, 2015 Author Share Posted August 29, 2015 (edited) معليش سفاح ضهرت مشكله الان لو انا راكب السياره وخويي ركب السياره ثم انا نزلت العلامه تختفي للكل اللي بتيم وراكبين السياره يعني لو واحد نزل تختفي منه العلامه وتختفي من الكل مو منه لحاله Edited August 29, 2015 by Guest Link to comment
iMr.SFA7 Posted August 29, 2015 Share Posted August 29, 2015 function pe () if guiGetVisible (GUIEditor.window) == true then else showCursor (true) guiSetVisible (GUIEditor.window,true) end end addEvent ("MinerPizz", true) addEventHandler ("MinerPizz",root, pe) addEvent ( "barco_set_locationPizz", true ) addEventHandler ( "barco_set_locationPizz", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 ) blip = createBlipAttachedTo ( marker, 41 ) addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) end ) function onBarcoStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "pizza_finishPizz", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end function destroy ( ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end addEventHandler ("onClientPlayerVehicleExit",localPlayer,destroy) addEventHandler ( "onClientPlayerWasted", localPlayer,destroy) GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Marker = {} GUIEditor_Window = {} vehicleId = {448}--1279.17859 -805.24109 86.12299 GUIEditor_Marker[1] = createMarker(1224.5068359375, -900.4482421875, 42.898097991943-1,"cylinder",2,255,255,0,255) -- السيارة GUIEditor_Marker[2] = createMarker(1209.6396484375, -904.720703125, 43.020980834961,"cylinder",3,255,0,0,0) -- الكلام فوق البيد local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(432, 152, 211, 297,"Pizz Job",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9, 22, 192, 228,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9) GUIEditor_Button[2] = guiCreateButton(9, 255, 81, 33,"Select",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(127, 255, 74, 33,"Close",false,GUIEditor_Window[1]) for i,id in ipairs ( vehicleId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) end ------------------------------------------------------------------------------------------------------ addEventHandler ("onClientMarkerHit", GUIEditor_Marker[1], function( player ) if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'Pizz' and not isPedInVehicle( player ) and player == localPlayer then x999,y999,z999 = getElementPosition( localPlayer ) setElementFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) end end ) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) showCursor( false ) setElementFrozen ( localPlayer, false ) elseif ( source == GUIEditor_Button[2] ) then local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent('gvoaPizz', getLocalPlayer(), name) guiSetVisible(GUIEditor_Window[1],false) setElementFrozen ( localPlayer, false ) showCursor( false ) end end ) ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition (GUIEditor_Marker[2]) local x2, y2, z2 = getElementPosition(localPlayer) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then local sx, sy = getScreenFromWorldPosition(x, y, z+2) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 100) then dxDrawText("Pizz Job", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") dxDrawText("Pizz Job", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") end end end end) Link to comment
khaledmhammed Posted August 29, 2015 Author Share Posted August 29, 2015 تمام شغال مية مية مشكور : ) Link to comment
iMr.SFA7 Posted August 29, 2015 Share Posted August 29, 2015 تمام شغال مية مية مشكور : ) You are welcome . 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