Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local screenW, screenH = guiGetScreenSize()
- showSelect = 0
- function drawSelect(result)
- smoothMoveCamera(1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316, 1556.9377441406, -1366.6959228516, 336.90127563477, 1542.630859375, -1352.0926513672, 329.47155761719, 5000)
- setTimer(function()
- data = result
- showSelect = 1
- if data[1] ~= nil then
- ped1 = createPed(data[1].skin, 1549.2901611328, -1353.9388427734, 329.46710205078, 220)
- setPedAnimation(ped1, "kissing", "gfwave2")
- addEventHandler("onClientClick", localPlayer, clickPed1)
- outputChatBox("esta el ped")
- end
- if data[2] ~= nil then
- ped2 = createPed(data[2].skin, 1543.9499511719, -1354.9273681641, 329.47155761719, 220)
- setPedAnimation(ped2, "cop_ambient", "coplook_think")
- end
- if data[3] ~= nil then
- ped3 = createPed(data[3].skin, 1546.9483642578, -1350.5411376953, 329.47082519531, 220)
- setPedAnimation(ped3, "kissing", "gfwave2")
- end
- if data[4] ~= nil then
- ped4 = createPed(data[4].skin, 1541.1925048828, -1355.4235839844, 329.46987915039, 220)
- setPedAnimation(ped4, "lowrider", "m_smkstnd_loop")
- end
- if data[5] ~= nil then
- ped5 = createPed(data[5].skin, 1543.0793457031, -1348.0944824219, 329.46832275391, 220)
- setPedAnimation(ped5, "gangs", "prtial_gngtlkb")
- end
- end, 5050, 1)
- end
- addEvent("showSelect", true)
- addEventHandler("showSelect", localPlayer, drawSelect)
- function clickPed1(button, state, absX, absY, wx, wy, wz, element)
- if (element) and (getElementType(element)=="ped") and (button=="left") and (state=="down") then
- outputChatBox("Ped 1")
- triggerServerEvent("spawnPed1", localPlayer)
- closeSelect()
- end
- end
- addEventHandler("onClientRender", localPlayer, function()
- outputChatBox("render")
- if showSelect == 1 then
- if isElement(ped1) then
- dxDrawTextOnElement(ped1, data[1].nombre, 1.179, 30, 0, 0, 0, 255, 2)
- dxDrawTextOnElement(ped1, data[1].nombre, 1.2, 30, 255, 255, 255, 255, 2)
- local screenx, screeny, worldx, worldy, worldz = getCursorPosition()
- local px, py, pz = getCameraMatrix()
- local hit, x, y, z, elementHit = processLineOfSight ( px, py, pz, worldx, worldy, worldz )
- local cX, cY = getCursorPosition()
- if hit then
- if elementHit and elementHit == ped1 then
- dxDrawText("Nombre: "..data[1].nombre, cX, cY, 500, 200, tocolor(255, 255, 255, 255))
- end
- end
- end
- end
- end)
- function closeSelect()
- showSelect = 0
- if ped1 or ped2 or ped3 or ped4 or ped5 then
- destroyElement(ped1 or ped2 or ped3 or ped4 or ped5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement