Jump to content

طلب ماركر سيارت


MeZo999

Recommended Posts

المطلوب:

1- يكون لجروب معين

2- مع لوحه واذا بدكم لوحه عندي

3- بدي اسوي اكثر من ماركر بس كل ماركر سيارات غير

اللوحه الي 2 او جيب لوحه من عندك على راحتك

local window = guiCreateWindow(353, 146, 323, 358, "Dz,jordan", false) 
guiWindowSetSizable(window, false) 
guiSetVisible (window,false) 
guiSetAlpha(window, 1.00) 
  
local gridlist = guiCreateGridList(33, 46, 256, 253, false, window) 
guiGridListAddColumn(gridlist, "سيارات الجروب", 0.9) 
local button2 = guiCreateButton(29, 311, 68, 35, "اختيار", false, window) 
guiSetProperty(button2, "NormalTextColour", "ffff0000") 
local button = guiCreateButton(288, 25, 26, 22, "X", false, window) 
guiSetProperty(button, "NormalTextColour", "FFFF0000")     
local car = { 541,560 } 
  
for _,vehicle in ipairs (car) do 
local row = guiGridListAddRow ( gridlist ) 
guiGridListSetItemText ( gridlist, row, 1,getVehicleNameFromModel (tonumber( vehicle )), false, false ) 
end 
  
addEventHandler("onClientGUIClick",button2, 
function () 
local carxx = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ) 
 if carxx == "" then return outputChatBox("مبروك السياره",255, 0, 0,true) end 
triggerServerEvent("carx",localPlayer,carxx) 
guiSetVisible(window,false) 
showCursor(false) 
end,false 
) 

Link to comment
لو انك مدور في المنتدى حتى في مواضيعك انت كان لقيت طلبك

من كثر طلبك للكود

حبيبي دورت ولله ما اقول ما لقيت بس مش الي بدي اياه هاذا كل الماركات الي فسكربت نفس السيارات :(

Link to comment
Client Side !

Wnd1 = guiCreateWindow ( 0.2, 0.2, 0.25, 0.5, "Free Vehicles", true ) 
guiSetAlpha( Wnd1, 1 ) 
buttonv = guiCreateButton ( 0.5, 0.8, 0.45, 0.15, "close", true, Wnd1 ) 
button1v = guiCreateButton ( 0.01, 0.8, 0.45, 0.15, "Selection", true, Wnd1 ) 
grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Wnd1) 
label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "get free vehicle", true, Wnd1 ) 
showCursor(false) 
guiSetVisible( Wnd1, false ) 
guiWindowSetSizable( Wnd1, false ) 
guiWindowSetMovable( Wnd1, false )    
  
vehicles = { 
{"Police LS", 596}, 
{"Police SF", 597}, 
{"Police LV", 598}, 
{"Police Ranger", 599}, 
{"HPV1000", 523}, 
{"Enforcer", 427}, 
{"ENTER", 427}, 
}      
guiGridListAddColumn(grid, "Vehicles", 0.85)      
  
for i,veh in ipairs(vehicles) do                   
row = guiGridListAddRow(grid)          
guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) 
guiGridListSetItemData(grid, row, 1, tostring(veh[2])) 
end 
          
function useP() 
  local row, col = guiGridListGetSelectedItem (  grid )    
   if ( row and col and row ~= -1 and col ~= -1 ) then 
        local model  = tonumber( guiGridListGetItemData( grid, guiGridListGetSelectedItem( grid ) ) ) 
     if model and model ~= '' then 
          triggerServerEvent("CreVehicePv", localPlayer, model) 
          guiSetVisible(Wnd1,false) 
          showCursor(false) 
        end 
    end 
end 
addEventHandler("onClientGUIClick", button1v, useP, false) 
      
function close() 
  if (source == buttonv) then 
    guiSetVisible(Wnd1,false) 
    showCursor(false) 
  end 
end 
addEventHandler("onClientGUIClick", buttonv, close) 
        
function showGUIpv() 
      guiSetVisible(Wnd1,true) 
      showCursor(true) 
end 
addEvent("showGUIpv",true) 
addEventHandler("showGUIpv", getRootElement(), showGUIpv) 

-------------------------

Server Side !

markerpv = createMarker( 1847.0590820313, -2552.94140625, 12.55, "cylinder", 2, 0, 0, 255, 255 ) 
  
local vehicles = {} 
      
function spawnVehp( model ) 
local x, y, z = getElementPosition(source) 
if isElement(vehicles[source]) then destroyElement(vehicles[source]) end 
vehicles[source] = createVehicle(model, x + 2, y, z) 
warpPedIntoVehicle(source, vehicles[source]) 
end 
addEvent("CreVehicePv",true) 
addEventHandler("CreVehicePv", root, spawnVehp) 
      
addEventHandler('onPlayerQuit', root,function() 
    if isElement(vehicles[source]) then 
        destroyElement(vehicles[source]) 
            vehicles[source] = nil 
         end 
    end 
) 
  
  
addEventHandler ( "onMarkerHit", markerpv, function ( za7f ) 
   if getElementType ( za7f ) == "player" then 
    if ( getElementData( za7f, "Group" ) == "G" ) then 
      triggerClientEvent (za7f, "showGUIpv", za7f) 
     end 
  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...