Jump to content

احتاج مساعدة


ryan112

Recommended Posts

سلام عليكم شباب  انا عملت مود spwn Vehicle 

اريد لوحة تشتغل بس بتيم 

local window = guiCreateWindow(559, 212, 267, 318, "Clan Vehicle Spawner", false)
guiWindowSetSizable(window, false)
guiSetVisible (window,false)
guiSetAlpha(window, 1.00)

local gridlist = guiCreateGridList(11, 35, 246, 203, false, window)
guiGridListAddColumn(gridlist, "                                Vehicles", 5.0)
local button2 = guiCreateButton(9, 245, 248, 30, "Spwn", false, window)
local button = guiCreateButton(190, 285, 67, 24, "Close", false, window)
local button3 = guiCreateButton(9, 285, 89, 23, "Destroy", false, window)
guiSetProperty(button3, "NormalTextColour", "FFFF0000")   
local car = { 520, 432, 425, 476, 447 }

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("Please Use Car",255, 0, 0,true) end
triggerServerEvent("carx",localPlayer,carxx) 
guiSetVisible(window,false)
showCursor(false)
end,false
)

-------------------------------
local car = createMarker ( -1533.974609375, 331.65972900391, 56.767894744873-2, "cylinder", 3, 0, 254, 239, 100 )
addEventHandler('onClientMarkerHit', car,
function ( hitPlayer )
         if ( hitPlayer == localPlayer ) then
         guiSetVisible ( window ,true )
        showCursor( true )
      guiSetInputEnabled(false)
    end
end
)

addEventHandler( "onClientGUIClick", button ,
function ()
    guiSetVisible(window,false)
    showCursor(false,false)
end
)

واريد اشغل رز Destroy عشان لو لاعب اخد سيارة ورجع اخد وحدة كمان لازم يدوس هي بعدين ينزل 

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

Edited by ryan112
Link to comment

client

local window = guiCreateWindow(559, 212, 267, 318, "Clan Vehicle Spawner", false)
guiWindowSetSizable(window, false)
guiSetVisible (window,false)
guiSetAlpha(window, 1.00)

local gridlist = guiCreateGridList(11, 35, 246, 203, false, window)
guiGridListAddColumn(gridlist, "                                Vehicles", 5.0)
local button2 = guiCreateButton(9, 245, 248, 30, "Spwan", false, window)
local button = guiCreateButton(190, 285, 67, 24, "Close", false, window)
local button3 = guiCreateButton(9, 285, 89, 23, "Destroy", false, window)
guiSetProperty(button3, "NormalTextColour", "FFFF0000")   
local car = { 520, 432, 425, 476, 447 }

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("Please Use Car",255, 0, 0,true) end
triggerServerEvent("carx",localPlayer,carxx) 
guiSetVisible(window,false)
showCursor(false)
end,false
)

-------------------------------
local teamName = 'NoTeam' -- اسم التيم

local car = createMarker ( -1533.974609375, 331.65972900391, 56.767894744873-2, "cylinder", 3, 0, 254, 239, 100 )
addEventHandler('onClientMarkerHit', car,
function ( hitPlayer )
         if ( hitPlayer == localPlayer ) and getPlayerTeam( hitPlayer ) and getTeamName( getPlayerTeam( hitPlayer ) ) == teamName then
         guiSetVisible ( window ,true )
        showCursor( true )
      guiSetInputEnabled(false)
    end
end
)

addEventHandler( "onClientGUIClick", button ,
function ()
    guiSetVisible(window,false)
    showCursor(false,false)
end,false)

addEventHandler("onClientGUIClick",button3,
function ()
triggerServerEvent("desVehicle", localPlayer)
    guiSetVisible(window,false)
showCursor(false)
end,false)

server
 

addEvent("carx",true)
addEventHandler("carx",root,
 function (carxx)
if getElementData ( source, "destroy" ) then
destroyElement ( getElementData ( source, "destroy"))
end	
local carname = getVehicleIDFromName(carxx)
local x, y, z = getElementPosition ( source )
veh = createVehicle (carname, x+2, y, z )
warpPedIntoVehicle ( source, veh)
setElementData ( source, "destroy", veh )
end
)

addEvent("desVehicle",true)
addEventHandler("desVehicle",root,
function( )
if getElementData ( source, "destroy" ) then
destroyElement ( getElementData ( source, "destroy"))
end	
end
)

 

منشور من زمان اصلا .

Edited by #Himoo
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...