Client :
jobMarker1 = createMarker(837.22449,-2066.94556,12.86719-1,"cylinder",2,0,0,0,0)
jobPed = createPed(285,837.22449,-2066.94556,12.86719,0)
jobBlip = createBlip(837.22449,-2066.94556,12.86719,56)
setBlipVisibleDistance(jobBlip,170)
setElementFrozen(jobPed,true)
addEventHandler("onClientPedDamage",root,
function ()
if source == jobPed then
cancelEvent()
end
end)
local x,y = guiGetScreenSize()
addEventHandler("onClientMarkerHit",resourceRoot,
function (hit)
if source == jobMarker1 and hit == localPlayer then
if getElementType(hit) == "player" and getPlayerTeam(hit) ~= getTeamFromName("1") then
if not isPedInVehicle(hit) then
if getPlayerWantedLevel(hit) == 0 then
guiSetVisible(GUIEditor.window[1],true)
showCursor(true)
else
outputChatBox ( "" )
end
else
outputChatBox ( "")
end
else
outputChatBox ( "")
end
end
end)
GUIEditor = {
gridlist = {},
window = {},
button = {}
}
local x = x - 332
local y = y - 333
GUIEditor.window[1] = guiCreateWindow(345, 90, 379, 544, "1", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetVisible(GUIEditor.window[1],false)
GUIEditor.button[1] = guiCreateButton(54, 487, 94, 41, "1", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[2] = guiCreateButton(244, 487, 88, 41, "الغاء", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
Memo1 = guiCreateMemo(13, 30, 356, 166, " يجب ان تكون في قروب", false, GUIEditor.window[1])
guiMemoSetReadOnly(Memo1, true)
GUIEditor.gridlist[1] = guiCreateGridList(10, 236, 357, 227, false, GUIEditor.window[1])
guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.3)
guiGridListAddColumn(GUIEditor.gridlist[1], "Skin Number", 0.3)
guiGridListAddColumn(GUIEditor.gridlist[1], "Skin Name", 0.3)
for i = 1, 3 do
guiGridListAddRow(GUIEditor.gridlist[1])
end
guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "1", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "285", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 0, 3, "1", false, false)
addEventHandler("onClientGUIClick",root,
function ()
if source == GUIEditor.button[1] then
local skin = guiGridListGetItemText( GUIEditor.gridlist[1],guiGridListGetSelectedItem(GUIEditor.gridlist[1]),2)
if skin ~= "" then
triggerServerEvent("startJobww",localPlayer,skin)
guiSetVisible(GUIEditor.window[1],false)
showCursor(false)
end
elseif source == GUIEditor.button[2] then
guiSetVisible(GUIEditor.window[1],false)
showCursor(false)
end
end)
addEvent("createPilotMarkersww",true)
addEventHandler("onClientRender", getRootElement(),
function()
local x, y, z = getElementPosition(jobPed)
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+1.3)
if(sx) and (sy) then
local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
if(distance < 30) then
dxDrawText("1", sx+2, sy+2, sx, sy, tocolor(0,0,0), 2-(distance/20), "arial", "center", "center")
dxDrawText("1", sx, sy, sx, sy, tocolor(0, 255, 9 ), 2-(distance/20), "arial", "center", "center")
end
end
end
end)
guiSetVisible (Window, false)
bindKey("F5", "down",
function()
triggerServerEvent ( "AdWin", localPlayer)
end)
addEvent("open",true)
addEventHandler("open",root,
function ()
guiSetVisible(Window,not guiGetVisible(Window))
showCursor(guiGetVisible(Window))
end)
Server :
addEvent("AdWin",true)
addEventHandler("AdWin",root,
function()
local acc=getPlayerAccount(client)
if(isObjectInACLGroup("user."..getAccountName(acc),aclGetGroup("Console"))) then
triggerClientEvent(client,"open",client)
end
end
)