Dr.Xen Posted February 6, 2014 Share Posted February 6, 2014 السلام عليكم ورحمة الله وبركاته ابي اخلي ذالكود ثلاثة ماركرات واول ما يأخذ سيارة في ثلاثة اماكن انا احددهم + لون السيارة 0,0,255 + لو راكب السيارة ما تفتح له اللوحة function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end Wnd = guiCreateWindow(525, 157, 267, 315, "( {Vehicle Police})", false) guiSetVisible(Wnd,false) centerWindow(Wnd) guiWindowSetMovable(Wnd, false) guiWindowSetSizable(Wnd, false) guiSetAlpha(Wnd, 1.00) guiSetProperty(Wnd, "CaptionColour", "FF0388F8") gridlist = guiCreateGridList(10, 22, 245, 229, false, Wnd) guiGridListAddColumn(gridlist, "Vehicles", 0.9) button = guiCreateButton(35, 261, 195, 27, "{Create it!#}", false, Wnd) guiSetFont(button, "default-bold-small") guiSetProperty(button, "NormalTextColour", "FFFBE600") label = guiCreateLabel(8, 290, 153, 21, "Created By Dr.anAs ", false, Wnd) guiSetFont(label, "default-bold-small") guiLabelSetColor(label,math.random(0, 255), math.random(0, 255), math.random(0, 255)) local VehicleTable = { 597,598,490,596,427,523 } for _,vehicle in ipairs (VehicleTable) do local row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, 1,getVehicleNameFromModel (tonumber( vehicle )), false, false ) guiGridListSetItemColor ( gridlist, row,1, math.random(0, 255), math.random(0, 255), math.random(0, 255) ) guiSetFont(gridlist,"default-bold-small") end addEventHandler("onClientGUIClick",button, function () local Veh = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ) if Veh == "" then return outputChatBox("Please Chose Vehicle!",math.random(0, 255), math.random(0, 255), math.random(0, 255),true) end triggerServerEvent("When_asked_to_create_a_vehicle",localPlayer,Veh) playSoundFrontEnd(33) guiSetVisible(Wnd,false) showCursor(false) end,false) local marker = createMarker(1570.5,-1608.5,12.39999961853,'cylinder',1.5,0,0,255,255) addEventHandler("onClientMarkerHit", marker, function(hitPlayer) if getTeamName(getPlayerTeam(hitPlayer)) == "Police" then guiSetVisible(Wnd, true) showCursor(true) end end) addEventHandler("onClientGUIClick",button, function () local Veh = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ) if Veh == "" then return outputChatBox("Please Chose Vehicle!",math.random(0, 255), math.random(0, 255), math.random(0, 255),true) end triggerServerEvent("When_asked_to_create_a_vehicle",localPlayer,Veh) playSoundFrontEnd(33) guiSetVisible(Wnd,false) showCursor(false) end,false) local marker = createMarker(1570.5,-1608.5,12.39999961853,'cylinder',1.5,0,0,255,255) addEventHandler("onClientMarkerHit", marker, function(hitPlayer) if getTeamName(getPlayerTeam(hitPlayer)) == "Police" then guiSetVisible(Wnd, true) showCursor(true) end end) addEvent("When_asked_to_create_a_vehicle",true) addEventHandler("When_asked_to_create_a_vehicle",root, function (Veh) if getElementData ( source, "destroy" ) then destroyElement ( getElementData ( source, "destroy")) end local vehName = getVehicleIDFromName(Veh) local x, y, z = getElementPosition ( source ) Vehicle = createVehicle (vehName, 1570.5999755859,-1612,13.199999809265,0,0,181 ) warpPedIntoVehicle ( source, Vehicle) setElementData ( source, "destroy", Vehicle ) end ) Link to comment
G.KinG Posted February 7, 2014 Share Posted February 7, 2014 --- غير مجرب function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end Wnd = guiCreateWindow(525, 157, 267, 315, "( {Vehicle Police})", false) guiSetVisible(Wnd,false) centerWindow(Wnd) guiWindowSetMovable(Wnd, false) guiWindowSetSizable(Wnd, false) guiSetAlpha(Wnd, 1.00) guiSetProperty(Wnd, "CaptionColour", "FF0388F8") gridlist = guiCreateGridList(10, 22, 245, 229, false, Wnd) guiGridListAddColumn(gridlist, "Vehicles", 0.9) button = guiCreateButton(35, 261, 195, 27, "{Create it!#}", false, Wnd) guiSetFont(button, "default-bold-small") guiSetProperty(button, "NormalTextColour", "FFFBE600") label = guiCreateLabel(8, 290, 153, 21, "Created By Dr.anAs ", false, Wnd) guiSetFont(label, "default-bold-small") guiLabelSetColor(label,math.random(0, 255), math.random(0, 255), math.random(0, 255)) local VehicleTable = { 597,598,490,596,427,523 } for _,vehicle in ipairs (VehicleTable) do local row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, 1,getVehicleNameFromModel (tonumber( vehicle )), false, false ) guiGridListSetItemColor ( gridlist, row,1, math.random(0, 255), math.random(0, 255), math.random(0, 255) ) guiSetFont(gridlist,"default-bold-small") end addEventHandler("onClientGUIClick",button, function () local Veh = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ) if Veh == "" then return outputChatBox("Please Chose Vehicle!",math.random(0, 255), math.random(0, 255), math.random(0, 255),true) end triggerServerEvent("When_asked_to_create_a_vehicle",localPlayer,Veh) playSoundFrontEnd(33) guiSetVisible(Wnd,false) showCursor(false) end,false) local marker = createMarker(1570.5,-1608.5,12.39999961853,'cylinder',1.5,0,0,255,255) local marker1 = createMarker(x,y,z,'cylinder',1.5,0,0,255,255) local marker2 = createMarker(x,y,z,'cylinder',1.5,0,0,255,255) addEventHandler("onClientMarkerHit", marker, addEventHandler("onClientMarkerHit", marker1, addEventHandler("onClientMarkerHit", marker2, function(hitPlayer) if getTeamName(getPlayerTeam(hitPlayer)) == "Police" then guiSetVisible(Wnd, true) showCursor(true) end end) addEventHandler("onClientGUIClick",button, function () local Veh = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ) if Veh == "" then return outputChatBox("Please Chose Vehicle!",math.random(0, 255), math.random(0, 255), math.random(0, 255),true) end triggerServerEvent("When_asked_to_create_a_vehicle",localPlayer,Veh) playSoundFrontEnd(33) guiSetVisible(Wnd,false) showCursor(false) end,false) Link to comment
max-mohammed Posted February 7, 2014 Share Posted February 7, 2014 (edited) function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end Wnd = guiCreateWindow(525, 157, 267, 315, "( {Vehicle Police})", false) guiSetVisible(Wnd,false) centerWindow(Wnd) guiWindowSetMovable(Wnd, false) guiWindowSetSizable(Wnd, false) guiSetAlpha(Wnd, 1.00) guiSetProperty(Wnd, "CaptionColour", "FF0388F8") gridlist = guiCreateGridList(10, 22, 245, 229, false, Wnd) guiGridListAddColumn(gridlist, "Vehicles", 0.9) button = guiCreateButton(35, 261, 195, 27, "{Create it!#}", false, Wnd) guiSetFont(button, "default-bold-small") guiSetProperty(button, "NormalTextColour", "FFFBE600") label = guiCreateLabel(8, 290, 153, 21, "Created By Dr.anAs ", false, Wnd) guiSetFont(label, "default-bold-small") guiLabelSetColor(label,math.random(0, 255), math.random(0, 255), math.random(0, 255)) local VehicleTable = { 597,598,490,596,427,523 } for _,vehicle in ipairs (VehicleTable) do local row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, 1,getVehicleNameFromModel (tonumber( vehicle )), false, false ) guiGridListSetItemColor ( gridlist, row,1, math.random(0, 255), math.random(0, 255), math.random(0, 255) ) guiSetFont(gridlist,"default-bold-small") end addEventHandler("onClientGUIClick",button, function () local Veh = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ) if Veh == "" then return outputChatBox("Please Chose Vehicle!",math.random(0, 255), math.random(0, 255), math.random(0, 255),true) end triggerServerEvent("When_asked_to_create_a_vehicle",localPlayer,Veh) playSoundFrontEnd(33) guiSetVisible(Wnd,false) showCursor(false) end,false) local marker = createMarker(1570.5,-1608.5,12.39999961853,'cylinder',1.5,0,0,255,255) local marker1 = createMarker(x,y,z,'cylinder',1.5,0,0,255,255) local marker2 = createMarker(x,y,z,'cylinder',1.5,0,0,255,255) addEventHandler("onClientMarkerHit", getRootElment(), function(hitPlayer) if getElementType(getLocalPlayer) == "player" then if (source == marker) or (source == marker1) or (source == marker2) if getTeamName(getPlayerTeam(hitPlayer)) == "Police" then guiSetVisible(Wnd, true) showCursor(true) end end end end) addEventHandler("onClientGUIClick",button, function () local Veh = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ) if Veh == "" then return outputChatBox("Please Chose Vehicle!",math.random(0, 255), math.random(0, 255), math.random(0, 255),true) end triggerServerEvent("When_asked_to_create_a_vehicle",localPlayer,Veh) playSoundFrontEnd(33) guiSetVisible(Wnd,false) showCursor(false) end,false) جرب Edited February 7, 2014 by Guest Link to comment
AboShanab Posted February 7, 2014 Share Posted February 7, 2014 function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end Wnd = guiCreateWindow(525, 157, 267, 315, "( {Vehicle Police})", false) guiSetVisible(Wnd,false) centerWindow(Wnd) guiWindowSetMovable(Wnd, false) guiWindowSetSizable(Wnd, false) guiSetAlpha(Wnd, 1.00) guiSetProperty(Wnd, "CaptionColour", "FF0388F8") gridlist = guiCreateGridList(10, 22, 245, 229, false, Wnd) guiGridListAddColumn(gridlist, "Vehicles", 0.9) button = guiCreateButton(35, 261, 195, 27, "{Create it!#}", false, Wnd) guiSetFont(button, "default-bold-small") guiSetProperty(button, "NormalTextColour", "FFFBE600") label = guiCreateLabel(8, 290, 153, 21, "Created By Dr.anAs ", false, Wnd) guiSetFont(label, "default-bold-small") guiLabelSetColor(label,math.random(0, 255), math.random(0, 255), math.random(0, 255)) local VehicleTable = { 597,598,490,596,427,523 } for _,vehicle in ipairs (VehicleTable) do local row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, 1,getVehicleNameFromModel (tonumber( vehicle )), false, false ) guiGridListSetItemColor ( gridlist, row,1, math.random(0, 255), math.random(0, 255), math.random(0, 255) ) guiSetFont(gridlist,"default-bold-small") end addEventHandler("onClientGUIClick",button, function () local Veh = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ) if Veh == "" then return outputChatBox("Please Chose Vehicle!",math.random(0, 255), math.random(0, 255), math.random(0, 255),true) end triggerServerEvent("When_asked_to_create_a_vehicle",localPlayer,Veh) playSoundFrontEnd(33) guiSetVisible(Wnd,false) showCursor(false) end,false) local marker = createMarker(1570.5,-1608.5,12.39999961853,'cylinder',1.5,0,0,255,255) local marker2 = createMarker(x,y,z,'cylinder',1.5,0,0,255,255) local marker3 = createMarker(x,y,z,'cylinder',1.5,0,0,255,255) addEventHandler("onClientMarkerHit", resourceRoot, function(hitPlayer) if getTeamName(getPlayerTeam(hitPlayer)) == "Police" then guiSetVisible(Wnd, true) showCursor(true) end end) addEventHandler("onClientGUIClick",button, function () local Veh = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ) if Veh == "" then return outputChatBox("Please Chose Vehicle!",math.random(0, 255), math.random(0, 255), math.random(0, 255),true) end triggerServerEvent("When_asked_to_create_a_vehicle",localPlayer,Veh) playSoundFrontEnd(33) guiSetVisible(Wnd,false) showCursor(false) end,false) Link to comment
Dr.Xen Posted February 7, 2014 Author Share Posted February 7, 2014 ابي كذا مثلا انت اخذت موتر من ماركر اولى تجي جنبه ورحت ماركر ثانية تجي جنبها السيارة .. Link to comment
Dr.Xen Posted February 7, 2014 Author Share Posted February 7, 2014 يعني مثلا انت اخذت سيارة من ماركر الاولى يوديك في مكان واخذت من ماركر الثاني يوديك في مكان ثاني واخذت من الثالثة يوديك في مكان ثالث ض1 Link to comment
abu5lf Posted February 8, 2014 Share Posted February 8, 2014 يعني مثلا انت اخذت سيارة من ماركر الاولى يوديك في مكان واخذت من ماركر الثاني يوديك في مكان ثاني واخذت من الثالثة يوديك في مكان ثالث ض1 onMarkerHit spawnVehicle Link to comment
Dr.Xen Posted February 8, 2014 Author Share Posted February 8, 2014 مما اعرف ممكن تسوي @ Link to comment
abu5lf Posted February 9, 2014 Share Posted February 9, 2014 local aMarker = createMarker( 0, 0, 3 ) addEventHandler( 'onMarkerHit', aMarker, function( hitElement ) if ( getElementType( hitElement ) == 'vehicle' ) then spawnVehicle( hitElement, 10, 10, 4 ) end end ) 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