Jump to content

طلب تصحيحح :)


iMr5YaLeY

Recommended Posts

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

يا ليت لو تزينولي ها الكود

ابي اخليه لقروب محدد

+

يوم ياخذ سياره يقوله انك خذيت سياره بس المشكله تطلع لكل الي في السيرفر ابي تطلع له لحاله

server.lua

markers = { 
    {220.6918182373,1919.1173095703,17.640625}, 
    {190.79113769531,1919.2520751953,17.640625}, 
  --{ 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")) 
    blip = createBlip ( v[1] , v[2] , v[3] , get("blipIconID") ) 
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]) 
    outputChatBox ( "* #FF5A5ACreated #ffffff"..carName.." #FF5A5Awas successful!",player,255,90,90,true)        
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 
    triggerClientEvent ("openMean", hitPlayer) 
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.lua

GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
  
cars = { 
    {523}, 
    {463}, 
    {509}, 
    {481}, 
    {510}, 
    {470}, 
  --{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 () 
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( "please 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

# ي ريت توضضح , تبيه الماركرات ذي لـ قروبات محددة ؟ _

بالنسبة للكل : ....

markers = { 
    {220.6918182373,1919.1173095703,17.640625}, 
    {190.79113769531,1919.2520751953,17.640625}, 
  --{ 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")) 
    blip = createBlip ( v[1] , v[2] , v[3] , get("blipIconID") ) 
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]) 
    outputChatBox ( "* #FF5A5ACreated #ffffff"..carName.." #FF5A5Awas successful!",source,255,90,90,true)       
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 
    triggerClientEvent ("openMean", hitPlayer) 
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
markers = { 
    {220.6918182373,1919.1173095703,17.640625}, 
    {190.79113769531,1919.2520751953,17.640625}, 
  --{ 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")) 
    blip = createBlip ( v[1] , v[2] , v[3] , get("blipIconID") ) 
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]) 
    outputChatBox ( "* #FF5A5ACreated #ffffff"..carName.." #FF5A5Awas successful!",source,255,90,90,true)       
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 
    triggerClientEvent (hitPlayer, "openMean", hitPlayer) 
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) 

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