Jump to content

كود سهل جدا


h-a-m-z-a

Recommended Posts

السلام عليكم ورحمة الله تعالى وبركاته اليوم عندي مركرات السيارات

سويت 2 مود يعني ماركر خاصو بسوات وحد لارمي بس المشكلة

لما اشغل المودات السيارات تخرب يصير يعطيني 2سيارات وحدا لارمي وحدا سوات

مركرات ســـــــــــــوات

هدا سيرفر

            markers = { 
                {1218,-1656.6999511719,10.800000190735}, 
                {1218,-1652,10.800000190735}, 
                {1218,-1646.3000488281,10.800000190735}, 
              --{ x, y, z }, 
              } 
              
              
            for i,v in ipairs (markers) do 
                marker = createMarker(v[1], v[2], v[3], "cylinder", get("markerSize"), get("markerColorR"), get("markerColorG"), get("markerColorB"), get("markerAlpha")) 
            end 
              
            veh = {} 
              
            addEvent ("getCar", true) 
            addEventHandler ("getCar", getRootElement(), 
            function(car) 
                if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
                veh[source] = nil 
                end 
                local carID = getVehicleModelFromName (car) 
                local x,y,z = getElementPosition(source) 
                local carName = getVehicleNameFromModel (carID) 
                veh[source] = createVehicle(carID, x,y,z) 
                addVehicleUpgrade(veh[source],1010) 
                addVehicleUpgrade(veh[source],1085) 
                if ( carID == 497 ) then 
                setElementPosition ( veh[source], 1228.1999511719,-1685.3000488281,35) 
            end 
             if ( carID == 563 ) then 
                setElementPosition ( veh[source], 1254.3000488281,-1684.4000244141,35) 
            end 
                setElementData ( veh[source], "DriveGroup", "SWAT" ) 
                setVehicleColor(veh[source], 255, 255, 255) 
                warpPedIntoVehicle(source, veh[source])       
            end 
            ) 
              
            addEventHandler ( "onPlayerQuit", getRootElement(), 
            function () 
                if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
                veh[source] = nil 
                end 
            end) 
          
        addEventHandler ( "onVehicleStartEnter", root, 
            function ( player ) 
                if ( getElementData ( source, "DriveGroup" ) ) then 
                    if ( getElementData ( source, "DriveGroup" ) ~= getElementData ( player, "gang" ) ) then 
                        cancelEvent ( ) 
                        outputChatBox ( "* Error: This car for group 'SWAT' only!", player, 210, 0, 0, true ) 
                    end 
                end 
            end 
        ) 
                    
            function markerHit (hitPlayer, matchingDimension) 
            if isPedInVehicle (hitPlayer) then return end 
            if getElementType(hitPlayer) == "player" then 
            if (getElementData(hitPlayer, "gang") == "SWAT") then 
             triggerClientEvent ("openMean", hitPlayer) 
            end 
            end 
            end 
            addEventHandler ("onMarkerHit", resourceRoot, markerHit) 
              
            function markerLeave (hitPlayer, matchingDimension) 
            if getElementType(hitPlayer) == "player" then 
               triggerClientEvent ("closeOpenMean", hitPlayer) 
            end 
            end 
            addEventHandler ("onMarkerLeave", resourceRoot, markerLeave) 
  

وهدا حق وندوا

GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
cars = { 
    {490}, 
    {528}, 
    {601}, 
    {522}, 
    {411}, 
    {541}, 
    {497}, 
    {563}, 
  --{carID}, 
    } 
  
local l, w = guiGetScreenSize() 
GUIEditor.window[1] = guiCreateWindow((l - 144) / 2, (w - 353) / 2, 144, 353, "Group car", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetVisible(GUIEditor.window[1],false) 
guiSetAlpha(GUIEditor.window[1], 1.00) 
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF5A5A") 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 24, 126, 265, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.3) 
guiGridListAddColumn(GUIEditor.gridlist[1], "Vehicle", 0.9) 
GUIEditor.button[1] = guiCreateButton(9, 295, 126, 22, "Get", false, GUIEditor.window[1]) 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF5A5A") 
guiSetFont(GUIEditor.button[1], "default-bold-small") 
GUIEditor.button[2] = guiCreateButton(9, 321, 126, 22, "Close", false, GUIEditor.window[1]) 
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFB50000") 
guiSetFont(GUIEditor.button[2], "default-bold-small") 
  
for i,v in ipairs (cars) do 
    local carName = getVehicleNameFromModel (v[1]) 
    local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
    guiGridListSetItemText (GUIEditor.gridlist[1], row, 1, i.."-", false, true) 
    guiGridListSetItemText (GUIEditor.gridlist[1], row, 2, carName, false, true) 
    guiGridListSetItemColor(GUIEditor.gridlist[1], row, 1, 255, 90, 90, 255) 
end 
  
addEvent ("openMean", true) 
function openMean () 
if (getLocalPlayer() == source) then 
guiSetVisible(GUIEditor.window[1],true) 
showCursor(true) 
end 
end 
addEventHandler ("openMean", getRootElement(), openMean) 
  
addEvent ("closeOpenMean", true) 
function closeOpenMean () 
if (getLocalPlayer() == source) then 
guiSetVisible(GUIEditor.window[1],false) 
showCursor(false) 
end 
end 
addEventHandler ("closeOpenMean", getRootElement(), closeOpenMean) 
  
addEventHandler ("onClientGUIClick", GUIEditor.button[2], 
function (button, state, absoluteX, absoluteYe) 
 guiSetVisible(GUIEditor.window[1],false) 
 showCursor(false) 
end) 
function trigger () 
if (guiGridListGetSelectedItem (GUIEditor.gridlist[1])) then 
local car = guiGridListGetItemText (GUIEditor.gridlist[1], guiGridListGetSelectedItem (GUIEditor.gridlist[1]), 2) 
if car == "" or car == nil then outputChatBox( "#FFFF00Please Selected Car From List.",255,90,90,true ) return end 
  triggerServerEvent ("getCar", getLocalPlayer(), car) 
  guiSetVisible(GUIEditor.window[1],false) 
  showCursor(false) 
end 
end 
  
addEventHandler ("onClientGUIClick", GUIEditor.button[1], 
function (button, state, absoluteX, absoluteYe) 
trigger(getLocalPlayer()) 
end) 
  
addEventHandler ("onClientGUIDoubleClick", GUIEditor.gridlist[1], 
function (button, state, absoluteX, absoluteYe) 
trigger(getLocalPlayer()) 
end) 

مركرات ارمـــــــــــــــــي

سيرفر

markers = { 
                {206.3994140625,1863.19921875,12.39999961853}, 
                {205.8994140625,1869.5,12.39999961853}, 
              --{ x, y, z }, 
                }            
              
            for i,v in ipairs (markers) do 
                marker = createMarker(v[1], v[2], v[3], "cylinder", get("markerSize"), get("markerColorR"), get("markerColorG"), get("markerColorB"), get("markerAlpha")) 
            end 
              
            veh = {} 
              
            addEvent ("getCar", true) 
            addEventHandler ("getCar", getRootElement(), 
            function(car) 
                if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
                veh[source] = nil 
                end 
                local carID = getVehicleModelFromName (car) 
                local x,y,z = getElementPosition(source) 
                local carName = getVehicleNameFromModel (carID) 
                veh[source] = createVehicle(carID, x,y,z) 
                addVehicleUpgrade(veh[source],1010) 
                addVehicleUpgrade(veh[source],1085) 
                if ( carID == 497 ) then 
                setElementPosition ( veh[source],90.19108 ,1863.17017 ,18.02813) 
            end 
             if ( carID == 548 ) then 
                setElementPosition ( veh[source], 89.87344 ,1838.84375 ,18.02813) 
            end 
                setElementData ( veh[source], "DriveGroup", "ARMY" ) 
                setVehicleColor(veh[source], 255, 255, 255) 
                warpPedIntoVehicle(source, veh[source])       
            end 
            ) 
              
            addEventHandler ( "onPlayerQuit", getRootElement(), 
            function () 
                if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
                veh[source] = nil 
                end 
            end) 
          
        addEventHandler ( "onVehicleStartEnter", root, 
            function ( player ) 
                if ( getElementData ( source, "DriveGroup" ) ) then 
                    if ( getElementData ( source, "DriveGroup" ) ~= getElementData ( player, "gang" ) ) then 
                        cancelEvent ( ) 
                        outputChatBox ( "* Error: This car for group 'ARMY' only!", player, 210, 0, 0, true ) 
                    end 
                end 
            end 
        ) 
                    
            function markerHit (hitPlayer, matchingDimension) 
            if isPedInVehicle (hitPlayer) then return end 
            if getElementType(hitPlayer) == "player" then 
            if (getElementData(hitPlayer, "gang") == "ARMY") then 
             triggerClientEvent ("openMean", hitPlayer) 
            end 
            end 
            end 
            addEventHandler ("onMarkerHit", resourceRoot, markerHit) 
              
            function markerLeave (hitPlayer, matchingDimension) 
            if getElementType(hitPlayer) == "player" then 
               triggerClientEvent ("closeOpenMean", hitPlayer) 
            end 
            end 
            addEventHandler ("onMarkerLeave", resourceRoot, markerLeave) 
     

وندوا

GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
  
cars = { 
    {490}, 
    {528}, 
    {522}, 
    {411}, 
    {541}, 
    {497}, 
    {548}, 
  --{carID}, 
    } 
  
local l, w = guiGetScreenSize() 
GUIEditor.window[1] = guiCreateWindow((l - 144) / 2, (w - 353) / 2, 144, 353, "Group car", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetVisible(GUIEditor.window[1],false) 
guiSetAlpha(GUIEditor.window[1], 1.00) 
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF5A5A") 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 24, 126, 265, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.3) 
guiGridListAddColumn(GUIEditor.gridlist[1], "Vehicle", 0.9) 
GUIEditor.button[1] = guiCreateButton(9, 295, 126, 22, "Get", false, GUIEditor.window[1]) 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF5A5A") 
guiSetFont(GUIEditor.button[1], "default-bold-small") 
GUIEditor.button[2] = guiCreateButton(9, 321, 126, 22, "Close", false, GUIEditor.window[1]) 
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFB50000") 
guiSetFont(GUIEditor.button[2], "default-bold-small") 
  
for i,v in ipairs (cars) do 
    local carName = getVehicleNameFromModel (v[1]) 
    local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
    guiGridListSetItemText (GUIEditor.gridlist[1], row, 1, i.."-", false, true) 
    guiGridListSetItemText (GUIEditor.gridlist[1], row, 2, carName, false, true) 
    guiGridListSetItemColor(GUIEditor.gridlist[1], row, 1, 255, 90, 90, 255) 
end 
  
addEvent ("openMean", true) 
function openMean () 
if (getLocalPlayer() == source) then 
guiSetVisible(GUIEditor.window[1],true) 
showCursor(true) 
end 
end 
addEventHandler ("openMean", getRootElement(), openMean) 
  
addEvent ("closeOpenMean", true) 
function closeOpenMean () 
if (getLocalPlayer() == source) then 
guiSetVisible(GUIEditor.window[1],false) 
showCursor(false) 
end 
end 
addEventHandler ("closeOpenMean", getRootElement(), closeOpenMean) 
  
addEventHandler ("onClientGUIClick", GUIEditor.button[2], 
function (button, state, absoluteX, absoluteYe) 
 guiSetVisible(GUIEditor.window[1],false) 
 showCursor(false) 
end) 
function trigger () 
if (guiGridListGetSelectedItem (GUIEditor.gridlist[1])) then 
local car = guiGridListGetItemText (GUIEditor.gridlist[1], guiGridListGetSelectedItem (GUIEditor.gridlist[1]), 2) 
if car == "" or car == nil then outputChatBox( "#FFFF00Please Selected Car From List.",255,90,90,true ) return end 
  triggerServerEvent ("getCar", getLocalPlayer(), car) 
  guiSetVisible(GUIEditor.window[1],false) 
  showCursor(false) 
end 
end 
  
addEventHandler ("onClientGUIClick", GUIEditor.button[1], 
function (button, state, absoluteX, absoluteYe) 
trigger(getLocalPlayer()) 
end) 
  
addEventHandler ("onClientGUIDoubleClick", GUIEditor.gridlist[1], 
function (button, state, absoluteX, absoluteYe) 
trigger(getLocalPlayer()) 
end) 

المرجوا الحل

Link to comment

local Markers = { 
    [1] = { 1218,-1656.6999511719,10.800000190735 }, 
    [2] = { 1218,-1652,10.800000190735}, 
    [3] = {1218,-1646.3000488281,10.800000190735 }, 
} 
  
addEventHandler ( "onClientResourceStart", resourceRoot, 
    function ( ) 
        for _, TheMarkers in ipairs ( Markers ) do 
            TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 2, 0, 0, 255, 250 ) 
        end 
    end 
) 
              
            local veh = {} 
              
            addEvent ("getCar", true) 
            addEventHandler ("getCar", getRootElement(), 
            function(car) 
                if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
                veh[source] = nil 
                end 
                local carID = getVehicleModelFromName (car) 
                local x,y,z = getElementPosition(source) 
                local carName = getVehicleNameFromModel (carID) 
                veh[source] = createVehicle(carID, x,y,z) 
                addVehicleUpgrade(veh[source],1010) 
                addVehicleUpgrade(veh[source],1085) 
                if ( carID == 497 ) then 
                setElementPosition ( veh[source], 1228.1999511719,-1685.3000488281,35) 
            end 
             if ( carID == 563 ) then 
                setElementPosition ( veh[source], 1254.3000488281,-1684.4000244141,35) 
            end 
                setElementData ( veh[source], "DriveGroup", "SWAT" ) 
                setVehicleColor(veh[source], 255, 255, 255) 
                warpPedIntoVehicle(source, veh[source])       
            end 
            ) 
              
            addEventHandler ( "onPlayerQuit", getRootElement(), 
            function () 
                if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
                veh[source] = nil 
                end 
            end) 
          
        addEventHandler ( "onVehicleStartEnter", root, 
            function ( player ) 
                if ( getElementData ( source, "DriveGroup" ) ) then 
                    if ( getElementData ( source, "DriveGroup" ) ~= getElementData ( player, "gang" ) ) then 
                        cancelEvent ( ) 
                        outputChatBox ( "* Error: This car for group 'SWAT' only!", player, 210, 0, 0, true ) 
                    end 
                end 
            end 
        ) 
                    
            function markerHit (hitPlayer, matchingDimension) 
            if isPedInVehicle (hitPlayer) then return end 
            if getElementType(hitPlayer) == "player" then 
            if (getElementData(hitPlayer, "gang") == "SWAT") then 
             triggerClientEvent ("openMean", hitPlayer) 
            end 
            end 
            end 
            addEventHandler ("onMarkerHit", resourceRoot, markerHit) 
              
            function markerLeave (hitPlayer, matchingDimension) 
            if getElementType(hitPlayer) == "player" then 
               triggerClientEvent ("closeOpenMean", hitPlayer) 
            end 
            end 
            addEventHandler ("onMarkerLeave", resourceRoot, markerLeave) 
  

الماركر الثاني

local Markers = { 
    [1] = { 206.3994140625,1863.19921875,12.39999961853 }, 
    [2] = { 205.8994140625,1869.5,12.39999961853}, 
} 
  
addEventHandler ( "onClientResourceStart", resourceRoot, 
    function ( ) 
        for _, TheMarkers in ipairs ( Markers ) do 
            TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 2, 0, 0, 255, 250 ) 
        end 
    end 
) 
  
  
           local veh = {} 
              
            addEvent ("getCar", true) 
            addEventHandler ("getCar", getRootElement(), 
            function(car) 
                if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
                veh[source] = nil 
                end 
                local carID = getVehicleModelFromName (car) 
                local x,y,z = getElementPosition(source) 
                local carName = getVehicleNameFromModel (carID) 
                veh[source] = createVehicle(carID, x,y,z) 
                addVehicleUpgrade(veh[source],1010) 
                addVehicleUpgrade(veh[source],1085) 
                if ( carID == 497 ) then 
                setElementPosition ( veh[source],90.19108 ,1863.17017 ,18.02813) 
            end 
             if ( carID == 548 ) then 
                setElementPosition ( veh[source], 89.87344 ,1838.84375 ,18.02813) 
            end 
                setElementData ( veh[source], "DriveGroup", "ARMY" ) 
                setVehicleColor(veh[source], 255, 255, 255) 
                warpPedIntoVehicle(source, veh[source])       
            end 
            ) 
              
            addEventHandler ( "onPlayerQuit", getRootElement(), 
            function () 
                if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
                veh[source] = nil 
                end 
            end) 
          
        addEventHandler ( "onVehicleStartEnter", root, 
            function ( player ) 
                if ( getElementData ( source, "DriveGroup" ) ) then 
                    if ( getElementData ( source, "DriveGroup" ) ~= getElementData ( player, "gang" ) ) then 
                        cancelEvent ( ) 
                        outputChatBox ( "* Error: This car for group 'ARMY' only!", player, 210, 0, 0, true ) 
                    end 
                end 
            end 
        ) 
                    
            function markerHit (hitPlayer, matchingDimension) 
            if isPedInVehicle (hitPlayer) then return end 
            if getElementType(hitPlayer) == "player" then 
            if (getElementData(hitPlayer, "gang") == "ARMY") then 
             triggerClientEvent ("openMean", hitPlayer) 
            end 
            end 
            end 
            addEventHandler ("onMarkerHit", resourceRoot, markerHit) 
              
            function markerLeave (hitPlayer, matchingDimension) 
            if getElementType(hitPlayer) == "player" then 
               triggerClientEvent ("closeOpenMean", hitPlayer) 
            end 
            end 
            addEventHandler ("onMarkerLeave", resourceRoot, markerLeave) 
    

لم يتم التجربه

Link to comment

local Markers = { 
    [1] = { 1218,-1656.6999511719,10.800000190735 }, 
    [2] = { 1218,-1652,10.800000190735}, 
    [3] = {1218,-1646.3000488281,10.800000190735 }, 
} 
  
addEventHandler ( "onClientResourceStart", resourceRoot, 
    function ( ) 
        for _, TheMarkers in ipairs ( Markers ) do 
            TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 2, 0, 0, 255, 250 ) 
        end 
    end 
) 
              
            local veh = {} 
              
            addEvent ("getCar", true) 
            addEventHandler ("getCar", getRootElement(), 
            function(car) 
                if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
                veh[source] = nil 
                end 
                local carID = getVehicleModelFromName (car) 
                local x,y,z = getElementPosition(source) 
                local carName = getVehicleNameFromModel (carID) 
                veh[source] = createVehicle(carID, x,y,z) 
                addVehicleUpgrade(veh[source],1010) 
                addVehicleUpgrade(veh[source],1085) 
                if ( carID == 497 ) then 
                setElementPosition ( veh[source], 1228.1999511719,-1685.3000488281,35) 
            end 
             if ( carID == 563 ) then 
                setElementPosition ( veh[source], 1254.3000488281,-1684.4000244141,35) 
            end 
                setElementData ( veh[source], "DriveGroup", "SWAT" ) 
                setVehicleColor(veh[source], 255, 255, 255) 
                warpPedIntoVehicle(source, veh[source])       
            end 
            ) 
              
            addEventHandler ( "onPlayerQuit", getRootElement(), 
            function () 
                if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
                veh[source] = nil 
                end 
            end) 
          
        addEventHandler ( "onVehicleStartEnter", root, 
            function ( player ) 
                if ( getElementData ( source, "DriveGroup" ) ) then 
                    if ( getElementData ( source, "DriveGroup" ) ~= getElementData ( player, "gang" ) ) then 
                        cancelEvent ( ) 
                        outputChatBox ( "* Error: This car for group 'SWAT' only!", player, 210, 0, 0, true ) 
                    end 
                end 
            end 
        ) 
                    
            function markerHit (hitPlayer, matchingDimension) 
            if isPedInVehicle (hitPlayer) then return end 
            if getElementType(hitPlayer) == "player" then 
            if (getElementData(hitPlayer, "gang") == "SWAT") then 
             triggerClientEvent ("openMean", hitPlayer) 
            end 
            end 
            end 
            addEventHandler ("onMarkerHit", resourceRoot, markerHit) 
              
            function markerLeave (hitPlayer, matchingDimension) 
            if getElementType(hitPlayer) == "player" then 
               triggerClientEvent ("closeOpenMean", hitPlayer) 
            end 
            end 
            addEventHandler ("onMarkerLeave", resourceRoot, markerLeave) 
  

window

GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
cars = { 
    {490}, 
    {528}, 
    {601}, 
    {522}, 
    {411}, 
    {541}, 
    {497}, 
    {563}, 
  --{carID}, 
    } 
  
local l, w = guiGetScreenSize() 
GUIEditor.window[1] = guiCreateWindow((l - 144) / 2, (w - 353) / 2, 144, 353, "Group car", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetVisible(GUIEditor.window[1],false) 
guiSetAlpha(GUIEditor.window[1], 1.00) 
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF5A5A") 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 24, 126, 265, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.3) 
guiGridListAddColumn(GUIEditor.gridlist[1], "Vehicle", 0.9) 
GUIEditor.button[1] = guiCreateButton(9, 295, 126, 22, "Get", false, GUIEditor.window[1]) 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF5A5A") 
guiSetFont(GUIEditor.button[1], "default-bold-small") 
GUIEditor.button[2] = guiCreateButton(9, 321, 126, 22, "Close", false, GUIEditor.window[1]) 
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFB50000") 
guiSetFont(GUIEditor.button[2], "default-bold-small") 
  
for i,v in ipairs (cars) do 
    local carName = getVehicleNameFromModel (v[1]) 
    local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
    guiGridListSetItemText (GUIEditor.gridlist[1], row, 1, i.."-", false, true) 
    guiGridListSetItemText (GUIEditor.gridlist[1], row, 2, carName, false, true) 
    guiGridListSetItemColor(GUIEditor.gridlist[1], row, 1, 255, 90, 90, 255) 
end 
  
addEvent ("openMean", true) 
function openMean () 
if (getLocalPlayer() == source) then 
guiSetVisible(GUIEditor.window[1],true) 
showCursor(true) 
end 
end 
addEventHandler ("openMean", getRootElement(), openMean) 
  
addEvent ("closeOpenMean", true) 
function closeOpenMean () 
if (getLocalPlayer() == source) then 
guiSetVisible(GUIEditor.window[1],false) 
showCursor(false) 
end 
end 
addEventHandler ("closeOpenMean", getRootElement(), closeOpenMean) 
  
addEventHandler ("onClientGUIClick", GUIEditor.button[2], 
function (button, state, absoluteX, absoluteYe) 
 guiSetVisible(GUIEditor.window[1],false) 
 showCursor(false) 
end) 
function trigger () 
if (guiGridListGetSelectedItem (GUIEditor.gridlist[1])) then 
local car = guiGridListGetItemText (GUIEditor.gridlist[1], guiGridListGetSelectedItem (GUIEditor.gridlist[1]), 2) 
if car == "" or car == nil then outputChatBox( "#FFFF00Please Selected Car From List.",255,90,90,true ) return end 
  triggerServerEvent ("getCar", getLocalPlayer(), car) 
  guiSetVisible(GUIEditor.window[1],false) 
  showCursor(false) 
end 
end 
  
addEventHandler ("onClientGUIClick", GUIEditor.button[1], 
function (button, state, absoluteX, absoluteYe) 
trigger(getLocalPlayer()) 
end) 
  
addEventHandler ("onClientGUIDoubleClick", GUIEditor.gridlist[1], 
function (button, state, absoluteX, absoluteYe) 
trigger(getLocalPlayer()) 
end) 

الماركر الثاني

local Markers = { 
    [1] = { 206.3994140625,1863.19921875,12.39999961853 }, 
    [2] = { 205.8994140625,1869.5,12.39999961853}, 
} 
  
addEventHandler ( "onClientResourceStart", resourceRoot, 
    function ( ) 
        for _, TheMarkers in ipairs ( Markers ) do 
            TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 2, 0, 0, 255, 250 ) 
        end 
    end 
) 
  
  
           local veh = {} 
              
            addEvent ("getCar2", true) 
            addEventHandler ("getCar2", getRootElement(), 
            function(car) 
                if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
                veh[source] = nil 
                end 
                local carID = getVehicleModelFromName (car) 
                local x,y,z = getElementPosition(source) 
                local carName = getVehicleNameFromModel (carID) 
                veh[source] = createVehicle(carID, x,y,z) 
                addVehicleUpgrade(veh[source],1010) 
                addVehicleUpgrade(veh[source],1085) 
                if ( carID == 497 ) then 
                setElementPosition ( veh[source],90.19108 ,1863.17017 ,18.02813) 
            end 
             if ( carID == 548 ) then 
                setElementPosition ( veh[source], 89.87344 ,1838.84375 ,18.02813) 
            end 
                setElementData ( veh[source], "DriveGroup", "ARMY" ) 
                setVehicleColor(veh[source], 255, 255, 255) 
                warpPedIntoVehicle(source, veh[source])       
            end 
            ) 
              
            addEventHandler ( "onPlayerQuit", getRootElement(), 
            function () 
                if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
                veh[source] = nil 
                end 
            end) 
          
        addEventHandler ( "onVehicleStartEnter", root, 
            function ( player ) 
                if ( getElementData ( source, "DriveGroup" ) ) then 
                    if ( getElementData ( source, "DriveGroup" ) ~= getElementData ( player, "gang" ) ) then 
                        cancelEvent ( ) 
                        outputChatBox ( "* Error: This car for group 'ARMY' only!", player, 210, 0, 0, true ) 
                    end 
                end 
            end 
        ) 
                    
            function markerHit (hitPlayer, matchingDimension) 
            if isPedInVehicle (hitPlayer) then return end 
            if getElementType(hitPlayer) == "player" then 
            if (getElementData(hitPlayer, "gang") == "ARMY") then 
             triggerClientEvent ("openMean2", hitPlayer) 
            end 
            end 
            end 
            addEventHandler ("onMarkerHit", resourceRoot, markerHit) 
              
            function markerLeave (hitPlayer, matchingDimension) 
            if getElementType(hitPlayer) == "player" then 
               triggerClientEvent ("closeOpenMean2", hitPlayer) 
            end 
            end 
            addEventHandler ("onMarkerLeave", resourceRoot, markerLeave) 
    

window

GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
  
cars = { 
    {490}, 
    {528}, 
    {522}, 
    {411}, 
    {541}, 
    {497}, 
    {548}, 
  --{carID}, 
    } 
  
local l, w = guiGetScreenSize() 
GUIEditor.window[1] = guiCreateWindow((l - 144) / 2, (w - 353) / 2, 144, 353, "Group car", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetVisible(GUIEditor.window[1],false) 
guiSetAlpha(GUIEditor.window[1], 1.00) 
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF5A5A") 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 24, 126, 265, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.3) 
guiGridListAddColumn(GUIEditor.gridlist[1], "Vehicle", 0.9) 
GUIEditor.button[1] = guiCreateButton(9, 295, 126, 22, "Get", false, GUIEditor.window[1]) 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF5A5A") 
guiSetFont(GUIEditor.button[1], "default-bold-small") 
GUIEditor.button[2] = guiCreateButton(9, 321, 126, 22, "Close", false, GUIEditor.window[1]) 
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFB50000") 
guiSetFont(GUIEditor.button[2], "default-bold-small") 
  
for i,v in ipairs (cars) do 
    local carName = getVehicleNameFromModel (v[1]) 
    local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
    guiGridListSetItemText (GUIEditor.gridlist[1], row, 1, i.."-", false, true) 
    guiGridListSetItemText (GUIEditor.gridlist[1], row, 2, carName, false, true) 
    guiGridListSetItemColor(GUIEditor.gridlist[1], row, 1, 255, 90, 90, 255) 
end 
  
addEvent ("openMean2", true) 
function openMean2 () 
if (getLocalPlayer() == source) then 
guiSetVisible(GUIEditor.window[1],true) 
showCursor(true) 
end 
end 
addEventHandler ("openMean2", getRootElement(), openMean2) 
  
addEvent ("closeOpenMean2", true) 
function closeOpenMean2 () 
if (getLocalPlayer() == source) then 
guiSetVisible(GUIEditor.window[1],false) 
showCursor(false) 
end 
end 
addEventHandler ("closeOpenMean2", getRootElement(), closeOpenMean2) 
  
addEventHandler ("onClientGUIClick", GUIEditor.button[2], 
function (button, state, absoluteX, absoluteYe) 
 guiSetVisible(GUIEditor.window[1],false) 
 showCursor(false) 
end) 
function trigger () 
if (guiGridListGetSelectedItem (GUIEditor.gridlist[1])) then 
local car = guiGridListGetItemText (GUIEditor.gridlist[1], guiGridListGetSelectedItem (GUIEditor.gridlist[1]), 2) 
if car == "" or car == nil then outputChatBox( "#FFFF00Please Selected Car From List.",255,90,90,true ) return end 
  triggerServerEvent ("getCar2", getLocalPlayer(), car) 
  guiSetVisible(GUIEditor.window[1],false) 
  showCursor(false) 
end 
end 
  
addEventHandler ("onClientGUIClick", GUIEditor.button[1], 
function (button, state, absoluteX, absoluteYe) 
trigger(getLocalPlayer()) 
end) 
  
addEventHandler ("onClientGUIDoubleClick", GUIEditor.gridlist[1], 
function (button, state, absoluteX, absoluteYe) 
trigger(getLocalPlayer()) 
end) 

لم يتم التجربه

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