السسلام عليكم
كيكفكم شباب
ابي اعدل ع الكود
ابي اسوي يطلع وسط الماركر نار
حطيت التتش حقي ذذ سطر 66 مازبط
local jobped = createPed ( 27, 602.15997, 867.88513, -42.96094, 90 )
local skins = { "Skin Jobs 1 (skin: 27)" }
GUIEditor = {
-- label = {},
button = {},
window = {},
memo = {},
gridlist = {}
}
GUIEditor.window = guiCreateWindow(256, 98, 294, 435, "", false)
guiWindowSetSizable(GUIEditor.window, false)
--GUIEditor.label = guiCreateLabel(9, 27, 275, 219, "", false, GUIEditor.window)
--guiSetFont(GUIEditor.label, "default-bold-small")
GUIEditor.memo = guiCreateMemo(9, 27, 275, 219, ", false, GUIEditor.window)
guiMemoSetReadOnly(GUIEditor.memo, true)
GUIEditor.aceptar = guiCreateButton(9, 397, 127, 28, "Take Skin Jop", false, GUIEditor.window)
GUIEditor.cancelar = guiCreateButton(157, 397, 127, 28, "Exit", false, GUIEditor.window)
GUIEditor.gridlist = guiCreateGridList(9, 256, 275, 131, false, GUIEditor.window)
guiGridListSetSelectionMode(GUIEditor.gridlist,2)
_skins = guiGridListAddColumn(GUIEditor.gridlist, "Enter To Your skin Pest", 0.9)
guiSetVisible(GUIEditor.window, false)
for index, skin in ipairs ( skins ) do
local row = guiGridListAddRow ( GUIEditor.gridlist )
guiGridListSetItemText ( GUIEditor.gridlist, row, _skins, tostring ( skin ), false, false )
end
addEventHandler ( "onClientGUIClick", guiRoot,
function ( )
if ( source == GUIEditor.aceptar ) then
local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist )
if ( row and col and row ~= -1 and col ~= -1 ) then
local skinName = guiGridListGetItemText ( GUIEditor.gridlist, row, 1 )
if ( skinName == "Skin Jobs 1 (skin: 27)" ) then
triggerServerEvent ( "setBarco", localPlayer, 27 )
end
guiSetVisible ( GUIEditor.window, false )
showCursor ( false )
else
outputChatBox ( "Error: press Enter To your Skin Or press Exit", 255, 0, 0 )
end
elseif ( source == GUIEditor.cancelar ) then
guiSetVisible ( GUIEditor.window, false )
showCursor ( false )
end
end
)
function pe ()
if guiGetVisible (GUIEditor.window) == true then
else
showCursor (true)
guiSetVisible (GUIEditor.window,true)
end
end
addEvent ("Miner", true)
addEventHandler ("Miner",root, pe)
addEvent ( "barco_set_location", true )
addEventHandler ( "barco_set_location", root,
function ( x, y, z )
marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 )
createFire ( marker x, y, z )
blip = createBlipAttachedTo ( marker, 41 )
addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit )
end
)
function onBarcoStopHit ( hitPlayer )
if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then
triggerServerEvent ( "pizza_finish", localPlayer )
if isElement ( blip ) then
destroyElement ( blip )
end
if isElement ( marker ) then
removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit )
destroyElement ( marker )
end
end
end
addEventHandler ( "onClientVehicleExit", root,
function ( thePlayer )
if ( thePlayer == localPlayer ) then
if isElement ( blip ) then
destroyElement ( blip )
end
if isElement ( marker ) then
removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit )
destroyElement ( marker )
end
end
end
)
GUIEditor_Button = {}
GUIEditor_Grid = {}
GUIEditor_Marker = {}
GUIEditor_Window = {}
vehicleId = {468,444}--1279.17859 -805.24109 86.12299
GUIEditor_Marker[1] = createMarker(602.02991 ,878.37085 ,-44,"cylinder",3,255,255,0,255)
GUIEditor_Marker[2] = createMarker(601.96082 ,867.69849 ,-42.96094,"cylinder",3,255,0,0,0)
local x,y = guiGetScreenSize()
local x = x - 208
local y = y - 321
GUIEditor_Window[1] = guiCreateWindow(309,72,195,377,"",false)
guiSetVisible(GUIEditor_Window[1],false)
guiSetAlpha(GUIEditor_Window[1],1)
guiWindowSetSizable(GUIEditor_Window[1],false)
GUIEditor_Grid[1] = guiCreateGridList(9,22,176,255,false,GUIEditor_Window[1])
guiGridListSetSelectionMode(GUIEditor_Grid[1],2)
column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9)
GUIEditor_Button[2] = guiCreateButton(12,303,81,33,"Select",false,GUIEditor_Window[1])
GUIEditor_Button[1] = guiCreateButton(108,303,74,33,"Close",false,GUIEditor_Window[1])
for i,id in ipairs ( vehicleId ) do
guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false )
end
------------------------------------------------------------------------------------------------------
addEventHandler ("onClientMarkerHit", GUIEditor_Marker[1],
function( player )
if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'Miner' and not isPedInVehicle( player ) and player == localPlayer then
x999,y999,z999 = getElementPosition( localPlayer )
setElementFrozen ( localPlayer, true )
guiSetVisible(GUIEditor_Window[1],true)
showCursor( true )
end
end
)
addEventHandler('onClientGUIClick', root,
function()
if ( source == GUIEditor_Button[1] ) then
guiSetVisible(GUIEditor_Window[1],false)
showCursor( false )
setElementFrozen ( localPlayer, false )
elseif ( source == GUIEditor_Button[2] ) then
local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 )
triggerServerEvent('gvoa', getLocalPlayer(), name)
guiSetVisible(GUIEditor_Window[1],false)
setElementFrozen ( localPlayer, false )
showCursor( false )
end
end
)
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
addEventHandler("onClientRender", getRootElement(),
function()
local x, y, z = getElementPosition (GUIEditor_Marker[2])
local x2, y2, z2 = getElementPosition(localPlayer)
if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then
local sx, sy = getScreenFromWorldPosition(x, y, z+2)
if(sx) and (sy) then
local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
if(distance < 100) then
dxDrawText("", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center")
dxDrawText("", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center")
end
end
end
end)
اتمنى الافادةة