سيرفر #
markers = {
{1831.8994140625,1057.3994140625,29.700000762939},
{1823.599609375,1057.3994140625,29.700000762939},
{1816.599609375,1057.3994140625,29.700000762939},
{1809.599609375,1057.3994140625,29.700000762939},
{1802.69921875,1057.3994140625,29.700000762939},
--{ 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)
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)
function markerHit (hitPlayer, matchingDimension)
if isPedInVehicle (hitPlayer) then return end
if getElementType(hitPlayer) == "player" then
if (getElementData(hitPlayer, "gang") == "WAWI") then
triggerClientEvent (hitPlayer,"openMean", hitPlayer)
end
end
end
addEventHandler ("onMarkerHit", resourceRoot, markerHit)
function markerLeave (hitPlayer, matchingDimension)
if getElementType(hitPlayer) == "player" then
triggerClientEvent (hitPlayer,"closeOpenMean", hitPlayer)
end
end
addEventHandler ("onMarkerLeave", resourceRoot, markerLeave)
كلنت #
GUIEditor = {
gridlist = {},
window = {},
button = {}
}
cars = {
{411},
{415},
{451},
{541},
{560},
{542},
{565},
{487},<===== طائرة
--{carID},
}
local l, w = guiGetScreenSize()
GUIEditor.window[1] = guiCreateWindow((l - 144) / 2, (w - 353) / 2, 144, 353, "Window", 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 ()
guiSetVisible(GUIEditor.window[1],true)
showCursor(true)
end
addEventHandler ("openMean", getRootElement(), openMean)
addEvent ("closeOpenMean", true)
function closeOpenMean ()
guiSetVisible(GUIEditor.window[1],false)
showCursor(false)
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