السلام عليكم ورحمة الله وبركاتة
سويت نافذه حق سيارات الشرطة
وشغاله تمام بس في مشكلة
سيارتين شغاله
وسيارتين مو شغالين
والنافذه ماتظهر الا اذا ضغط علي السياره الاوله كثير
انا عايزه السياراتين يشتغلو والنافذه تظهر لما اروح المركر
وهذا الكود
هذا كلنت
Markers = {
[1] = { 1561.6853027344, -1610.3962402344, 13.3828125 },
[2] = { 1567.1374511719, -1609.6643066406, 13.3828125 },
[3] = { 1572.4000244141, -1609.6999511719, 13.39999961853 },
[4] = { 1557.6053466797, -1610.416015625, 13.3828125 },
}
addEventHandler ( "onClientResourceStart", resourceRoot,
function ( )
for _, TheMarkers in ipairs ( Markers ) do
TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 2, 0, 0, 255, 255 )
end
end
)
GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Label = {}
GUIEditor_Window[1] = guiCreateWindow(290,179,172,343,"Cars Police v1.0",false)
guiSetAlpha(GUIEditor_Window[1],1)
GUIEditor_Button[1] = guiCreateButton(303,226,139,49,"Police LS",false)
GUIEditor_Button[2] = guiCreateButton(302,294,137,48,"Police Hpv1000",false)
GUIEditor_Button[4] = guiCreateButton(300,362,136,46,"Police Enforcer",false)
GUIEditor_Button[5] = guiCreateButton(298,427,136,45,"Police Ranger",false)
GUIEditor_Label[2] = guiCreateLabel(0.61046516895294,0.05830904841423,2.3841857910156e-007,-5.9604644775391e-008,"",true,GUIEditor_Window[1])
guiSetAlpha(GUIEditor_Label[2],1)
guiLabelSetVerticalAlign(GUIEditor_Label[2],center)
guiLabelSetHorizontalAlign(GUIEditor_Label[2],center,false)
GUIEditor_Label[3] = guiCreateLabel(292,202,147,21,"By MR.KING",false)
guiLabelSetVerticalAlign(GUIEditor_Label[3],center)
guiLabelSetHorizontalAlign(GUIEditor_Label[3],center,false)
addEventHandler ( "onClientMarkerHit", resourceRoot,
function ( hitPlayer )
if hitPlayer == localPlayer then
local team = getPlayerTeam ( hitPlayer )
if team and getTeamName ( team ) == "Police" then
guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) )
showCursor ( guiGetVisible ( GUIEditor_Window[1] ) )
guiSetInputEnabled ( guiGetVisible ( GUIEditor_Window[1] ) )
end
end
end
)
function givecar ( id )
triggerServerEvent ( "givecar", localPlayer, id )
guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) )
showCursor ( guiGetVisible(GUIEditor_Window[1] ) )
guiSetInputEnabled ( guiGetVisible ( GUIEditor_Window[1] ) )
end
addEventHandler( "onClientGUIClick", root,
function ( )
if ( source == GUIEditor_Button[1] ) then
givecar(596)
elseif ( source == GUIEditor_Button[6] ) then
givecar(523)
elseif ( source == GUIEditor_Button[3] ) then
givecar(427)
elseif ( source == GUIEditor_Button[4] ) then
givecar(599)
end
end
)
هذه سيرفر
Vehicles = {}
addEvent ( "givecar", true )
addEventHandler ( "givecar", root,
function ( id )
if Vehicles [ source ] then
destroyElement ( Vehicles [ source ] )
end
if tonumber( id ) then
local x, y, z = getElementPosition ( source )
Vehicles [ source ] = createVehicle ( tonumber( id ), x, y, z )
if Vehicles [ source ] then
warpPedIntoVehicle ( source, Vehicles [ source ] )
end
end
end
)
شيء كمان اللازرار تفضل ظاهره