Jump to content

حل مشكلة كود


MeZo999

Recommended Posts

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

الحين لو حطيت ماركر ثاني في اي مكان تيجيني اللوحة ضض السيارات

اي ماركر موجود تيجي عليه اللوحه

ضض هي الكود اللوحه والماركر شوفولي حل وحكولي شو الخطئ

اللوحة

addEvent("open", true) 
  
local Swat = { 
    ["FBI rancher"] = 490, 
    ["NRG-500"] = 522, 
    ["FBI Truck"] = 528, 
    ["S.W.A.T"] = 601, 
    ["Cheetah"] = 415, 
    ["Infernus"] = 411, 
    ["Slamvan"] = 535, 
    ["Sandking"] = 495, 
} 
  
Wind = guiCreateWindow(478, 201, 296, 372, "Swat Vehicles", false) 
guiWindowSetSizable(Wind, false) 
guiSetVisible(Wind, false) 
  
GRID = guiCreateGridList(9, 21, 278, 243, false, Wind) 
guiGridListAddColumn(GRID, "Vehicle :", 0.9) 
for i = 1, 15 do 
    guiGridListAddRow(GRID) 
end 
guiGridListSetItemText(GRID, 1, 1, "FBI rancher", false, false) 
guiGridListSetItemText(GRID, 2, 1, "NRG-500", false, false) 
guiGridListSetItemText(GRID, 3, 1, "FBI Truck", false, false) 
guiGridListSetItemText(GRID, 4, 1, "S.W.A.T", false, false) 
guiGridListSetItemText(GRID, 5, 1, "Cheetah", false, false) 
guiGridListSetItemText(GRID, 6, 1, "Infernus", false, false) 
guiGridListSetItemText(GRID, 7, 1, "Slamvan", false, false) 
guiGridListSetItemText(GRID, 8, 1, "Sandking", false, false) 
Select = guiCreateButton(9, 270, 278, 38, "Select", false, Wind) 
guiSetProperty(Select, "NormalTextColour", "FFAAAAAA") 
Close = guiCreateButton(10, 318, 277, 38, "Close", false, Wind) 
guiSetProperty(Close, "NormalTextColour", "FFAAAAAA") 
  
addEventHandler("onClientGUIClick", root, 
function() 
if(source == Select)then 
local row, col = guiGridListGetSelectedItem(GRID) 
local Veh = guiGridListGetItemText(GRID, row, col) 
if(Veh and Swat[Veh])then 
guiSetVisible(Wind, false) 
guiSetInputEnabled(false) 
if(Veh == "FBI rancher")then 
triggerServerEvent("Vehiclee", localPlayer, Swat[Veh], "Cars") 
end 
triggerServerEvent("Vehiclee", localPlayer, Swat[Veh], "[swat]") 
end 
elseif(source == Close)then 
guiSetVisible(Wind, false) 
guiSetInputEnabled(false) 
end 
end 
) 
  
addEventHandler("open", root, 
    function(state) 
        if(state == "true")then 
            guiSetVisible(Wind, true) 
            guiSetInputEnabled(true) 
        elseif(state == "false")then 
            guiSetVisible(Wind, false) 
            guiSetInputEnabled(false) 
        end 
    end 
) 

الماركر #

addEvent("Vehiclee", true) 
  
Markers = { 
    [1] = { 1223.8000488281,-1651.1999511719,12 }, -- احداثيات الماركر 
} 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, TheMarkers in ipairs ( Markers ) do 
            TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 1.8, 149, 0, 0, 255 ) 
        end 
    end 
) 
  
addEventHandler("onMarkerHit", resourceRoot, 
    function(hitElem) 
        if(getElementType(hitElem) == "player")then 
                   if getElementData ( hitElem,'Group' ) ~= 'Swat' then 
            outputChatBox("#FF0000* #FFF000Only For #FF0000 .:[swat]:. #FFF000Group ", hitElem, 255, 255, 0, true) 
            else 
            if not(isPedInVehicle(hitElem))then 
                triggerClientEvent(hitElem, "open", hitElem, "true") 
            end 
        end 
    end 
 end 
) 
  
local vehicles = {} 
  
addEventHandler("Vehiclee", root, 
    function(model, state) 
        if(state == "Cars")then 
            if(isElement(vehicles[ client ]))then 
                destroyElement(vehicles[ client ]) 
                vehicles[ client ] = nil 
            vehicles[ client ] = createVehicle(model, getElementPosition(client)) 
            end 
            warpPedIntoVehicle(client, vehicles[ client ]) 
        elseif(state == "[swat]")then 
            if(isElement(vehicles[ client ]))then 
                destroyElement(vehicles[ client ]) 
                vehicles[ client ] = nil 
            end 
            vehicles[ client ] = createVehicle(model, getElementPosition(client)) 
            warpPedIntoVehicle(client, vehicles[ client ]) 
                        setVehicleColor(vehicles[ client ], 0, 0, 255 ) -- هنا تلون السياره 
        end 
    end 
) 
  
addEventHandler("onPlayerQuit", root, 
    function() 
        if(vehicles[ source ])then 
            destroyElement(vehicles[ source ]) 
            vehicles[ source ] = nil 
        end 
    end 
) 

Link to comment

اذكر المصدر

Client !

addEvent("open", true) 
  
local GHOST = { 
    ["Sultan"] = 560, 
    ["NRG-500"] = 522, 
    ["PCJ-600"] = 461, 
    ["Jester"] = 559, 
    ["Infernus"] = 411, 
    ["Huntely"] = 579, 
    ["HotKnife"] = 434, 
    ["Euros"] = 587, 
    ["Elgy"] = 562, 
    ["Elegant"] = 507, 
    ["Cheetah"] = 415, 
    ["Bullet"] = 541, 
} 
  
Wind = guiCreateWindow(478, 201, 296, 372, "GHOST Vehicles", false) 
guiWindowSetSizable(Wind, false) 
guiSetVisible(Wind, false) 
  
GRID = guiCreateGridList(9, 21, 278, 243, false, Wind) 
guiGridListAddColumn(GRID, "Vehicle :", 0.9) 
for i = 1, 15 do 
    guiGridListAddRow(GRID) 
end 
guiGridListSetItemText(GRID, 1, 1, "Sultan", false, false) 
guiGridListSetItemText(GRID, 2, 1, "NRG-500", false, false) 
guiGridListSetItemText(GRID, 3, 1, "PCJ-600", false, false) 
guiGridListSetItemText(GRID, 4, 1, "Jester", false, false) 
guiGridListSetItemText(GRID, 5, 1, "Infernus", false, false) 
guiGridListSetItemText(GRID, 6, 1, "Huntely", false, false) 
guiGridListSetItemText(GRID, 7, 1, "HotKnife", false, false) 
guiGridListSetItemText(GRID, 8, 1, "Euros", false, false) 
guiGridListSetItemText(GRID, 9, 1, "Elgy", false, false) 
guiGridListSetItemText(GRID, 10, 1, "Elegant", false, false) 
guiGridListSetItemText(GRID, 11, 1, "Cheetah", false, false) 
guiGridListSetItemText(GRID, 12, 1, "Bullet", false, false) 
Select = guiCreateButton(9, 270, 278, 38, "Select", false, Wind) 
guiSetProperty(Select, "NormalTextColour", "FFAAAAAA") 
Close = guiCreateButton(10, 318, 277, 38, "Close", false, Wind) 
guiSetProperty(Close, "NormalTextColour", "FFAAAAAA") 
  
addEventHandler("onClientGUIClick", root, 
function() 
if(source == Select)then 
local row, col = guiGridListGetSelectedItem(GRID) 
local Veh = guiGridListGetItemText(GRID, row, col) 
if(Veh and GHOST[Veh])then 
guiSetVisible(Wind, false) 
guiSetInputEnabled(false) 
if(Veh == "Sultan")then 
triggerServerEvent("Vehiclee", localPlayer, GHOST[Veh], "Cars") 
end 
triggerServerEvent("Vehiclee", localPlayer, GHOST[Veh], "[GHOST]") 
end 
elseif(source == Close)then 
guiSetVisible(Wind, false) 
guiSetInputEnabled(false) 
end 
end 
) 
  
addEventHandler("open", root, 
    function(state) 
        if(state == "true")then 
            guiSetVisible(Wind, true) 
            guiSetInputEnabled(true) 
        elseif(state == "false")then 
            guiSetVisible(Wind, false) 
            guiSetInputEnabled(false) 
        end 
    end 
) 

Server !

--**************** 
-- By Manster .. 
--**************** 
  
addEvent("Vehiclee", true) 
  
Markers = { 
    [1] = { x,y,z }, -- احداثيات الماركر 
    [2] = { x,y,z }, -- احداثيات الماركر 
    [3] = { x,y,z }, -- احداثيات الماركر 
    [4] = { x,y,z }, -- احداثيات الماركر 
    [5] = { x,y,z }, -- احداثيات الماركر 
} 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, TheMarkers in ipairs ( Markers ) do 
            TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 2, 255, 255, 255, 250 ) 
        end 
    end 
) 
  
addEventHandler("onMarkerHit", resourceRoot, 
    function(hitElem) 
        if(getElementType(hitElem) == "player")then 
                   if getElementData ( hitElem,'Group' ) == 'Group Name' then 
            outputChatBox("#FF0000* #FFF000Only For #FF0000 .:[Group Name]:. #FFF000Group ", hitElem, 255, 255, 0, true) 
            else 
            if not(isPedInVehicle(hitElem))then 
                triggerClientEvent(hitElem, "open", hitElem, "true") 
            end 
        end 
    end 
 end 
) 
  
local vehicles = {} 
  
addEventHandler("Vehiclee", root, 
    function(model, state) 
        if(state == "Cars")then 
            if(isElement(vehicles[ client ]))then 
                destroyElement(vehicles[ client ]) 
                vehicles[ client ] = nil 
            vehicles[ client ] = createVehicle(model, getElementPosition(client)) 
                        setVehicleColor( vehicles[ client ], 255, 0, 0 ) 
                        setVehiclePaintjob(vehicles[ client ], 0) 
            end 
            warpPedIntoVehicle(client, vehicles[ client ]) 
        elseif(state == "[GHOST]")then 
            if(isElement(vehicles[ client ]))then 
                destroyElement(vehicles[ client ]) 
                vehicles[ client ] = nil 
            end 
            vehicles[ client ] = createVehicle(model, getElementPosition(client)) 
                        setVehicleColor( vehicles[ client ], 255, 0, 0 ) --  ! هنا لو تبي تغير لون السياره 
                        setVehiclePaintjob(vehicles[ client ], 0) -- هنا الباينت جوب يعني الشكل ! 
            warpPedIntoVehicle(client, vehicles[ client ]) 
        end 
    end 
) 
  
addEventHandler("onPlayerQuit", root, 
    function() 
        if(vehicles[ source ])then 
            destroyElement(vehicles[ source ]) 
            vehicles[ source ] = nil 
        end 
    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...