XJMLN

Members
  • Content count

    22
  • Joined

  • Last visited

Community Reputation

0 Neutral

About XJMLN

  • Rank
    Civilian

Details

  • Gang
    prmta.pl
  1. copyResource

    Code work, check is your backup resource where you have this code have a ACL to copyResource.
  2. Thank you for all.
  3. Your code work good, but blip is showing on top left corner. How i can move that there: http://i.imgur.com/ipXmU1h.jpg?1 I tried this, but no reaction of change these values: local mapX,mapY = (sw - sw*1200/1920)/2,(sh - sh*600/1080)/2
  4. How i can calculate this units, just like this? local sw,sh = guiGetScreenSize() x2,y2,z2 -- coords x2 =x2/sw y2 = y2/sh
  5. But in this post you show how, from screen pos get world pos. I have the world pos and wanna get it to screen pos.
  6. Hi, I wanna create a gui with minimap (like this), but i don't know how to calculate world position to screen position and show it on that map. I tried this: x2 =((x2 + 3000)/ 6000 *sw) y2 =((3000 - y2)/ 6000 *sh) But this show the wrong position for waypoint. Code: local sw,sh = guiGetScreenSize() local mw, mh = sw/1920, sh/1080 local t = {point=nil,pos=nil,map=false} t.gridlist = guiCreateGridList(mw*382, mh*281, mw*329, mh*530, false) t.gridlist_places = guiGridListAddColumn(t.gridlist, "Places", 0.9) guiSetVisible(t.gridlist,false) function travel_render() if not t.rendered then return end dxDrawImage((sw - sw*1200/1920)/2,(sh - sh*600/1080)/2,1200,600, "img/background.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) if t.map then dxDrawImage(t.pos[1],t.pos[2],32,32,"img/waypoint.png", 0,0,0, tocolor(255,255,255,255), false) end end function travel_fill(d) for i,v in ipairs(d) do local row = guiGridListAddRow(t.gridlist) guiGridListSetItemText(t.gridlist, row, t.gridlist_places, v.name, false, false) guiGridListSetItemData(t.gridlist, row, t.gridlist_places,v.tpPos) end end function travel_init() if (t.rendered) then removeEventHandler("onClientRender", root, travel_render) t.point = nil t.rendered = false guiSetVisible(t.gridlist,false) showCursor(false) guiGridListClear(t.gridlist) else guiGridListClear(t.gridlist) triggerServerEvent("travel_requestPlaces", localPlayer) t.rendered = true addEventHandler("onClientRender", root, travel_render) guiSetVisible(t.gridlist, true) showCursor(true) end end function interaction_fastTravel(args) if (not args.ped) then return end args.player = localPlayer local x,y,z = getElementPosition(args.player) local x2,y2,z2 = getElementPosition(args.ped) if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)>2) then outputChatBox("You need to go closer.",255,0,0) return end t.point = args.ped travel_init() end function travel_updateBlip() local selRow = guiGridListGetSelectedItem(t.gridlist) if (selRow<0) then return end local pos = guiGridListGetItemData(t.gridlist, selRow, t.gridlist_places) local x2, y2, z2 = unpack(pos) x2 =((x2 + 3000)/ 6000 *sw) y2 =((3000 - y2)/ 6000 *sh) t.pos = {x2,y2} t.map = true end function travel_doTeleport() local selRow = guiGridListGetSelectedItem(t.gridlist) if (selRow<0) then return end local pos = guiGridListGetItemData(t.gridlist, selRow, t.gridlist_places) local x2, y2, z2 = unpack(pos) fadeCamera(false) travel_init() setElementFrozen(localPlayer,true) setTimer(function() setElementPosition(localPlayer,x2,y2,z2+1) setElementFrozen(localPlayer,false) fadeCamera(true) end,1500,1) end addEvent("travels_fillList", true) addEventHandler("travels_fillList", root,travel_fill) addEventHandler("onClientGUIClick", t.gridlist, travel_updateBlip) addEventHandler("onClientGUIDoubleClick", t.gridlist, travel_doTeleport) Anyone can help with this?
  7. Editbox - cant type anything

    Okey, its work end code: addEventHandler("onClientGUIClick",g_e_login,test, true) function test () setTimer(setIndexInput,2000,1) end function setIndexInput(akcja) local tlogin = guiGetText(g_e_login) local plogin = guiGetText(g_e_password) local textLength = string.len(tlogin) if (textLength) > 0 then guiEditSetCaretIndex(g_e_login,textLength+1) else guiEditSetCaretIndex(g_e_login,1) end end Close.
  8. Editbox - cant type anything

    function isMouseIn(psx,psy,pssx,pssy,abx,aby) if not isCursorShowing() then return end cx,cy=getCursorPosition() cx,cy=cx*sx,cy*sy if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then return true,cx,cy else return false end end if isMouseIn(here code from guiCreateEdit,"",true) then guiEditSetCaretIndex(g_e_login,1) end That be good? Or better idea is eventHandler onClientClick and then code from up? EDIT: I create that code, but when i click on editbox nothing happen ;/. addEventHandler("onClientGUIClicked",g_e_login,setIndexInput, false) addEventHandler("onClientGUIClicked",g_e_password,setIndexInput, false) function setIndexInput() local tlogin = guiGetText(g_e_login) local plogin = guiGetText(g_e_password) if source == g_e_login then local textLength = string.len(tlogin) if (textLength) > 0 then guiEditSetCaretIndex(source,textLength+1) outputChatBox("1") else setTimer(function() guiEditSetCaretIndex(source,1) end,500,1) end end if source == g_e_password then local textLength = string.len(plogin) if (textLength) > 0 then guiEditSetCaretIndex(source,textLength+1) outputChatBox("1") else guiEditSetCaretIndex(source,1) outputChatBox("1") end end end
  9. Editbox - cant type anything

    On gif you can see what is doing when i click on edit, i think is bug or something block insert text to edit. ;( Edit: In GUIEditor editbox work fine, only in my code something is bad.
  10. Editbox - cant type anything

    Still the same with guiSetInputEnabled.
  11. Editbox - cant type anything

    Hi, i create panel login all works fine but is one small bug i cant insert any word to editbox. But if i'll keep LMB then i can entry word. Someone have that bug and fix it? function displayLoginPanel() showCursor(true) showChat(false) showPlayerHudComponent("all",false) guiSetInputMode("no_binds_when_editing") g_e_login = guiCreateEdit(sw*99/mw,sh*215/mh,sw*250/mw,sh*27/mh,"",false) end
  12. Server list spam

    Original: IP: mtasa://188.165.18.19:20060 https://i.gyazo.com/775c3d859fdc862cd2c ... 0b79fa.png Fakes: IP: mtasa://178.33.54.32:20392 IP: mtasa://80.72.47.182:20048 https://i.gyazo.com/7da8e0d6952b7be2239 ... 36bc0f.png They take my name and tag server and get players on that. Of course, my server was created first. Here's is video from my servers for confirmation: - The only thing that has changed is hosting, IP and address forum
  13. Need help with my scipt

    Topic to close, Tosfera help me.
  14. Need help with my scipt

    No, always content is 2x.
  15. Need help with my scipt

    This function is triggered from c-side addEventHandler("onClientColShapeLeave", colMeta, function(el,md) if getElementType(el)~="vehicle" then return end local veh=getPedOccupiedVehicle(localPlayer) if veh and veh==el and getVehicleController(veh)==localPlayer then local vehicleP = getElementModel(veh) if ts then local czas=getTickCount()-ts local tczas=string.format("%.3fs", czas/1000) outputChatBox("Twój czas:".."\n"..tczas) local timeP = czas/1000 triggerServerEvent("registerPredkosc", resourceRoot, localPlayer, vehicleP, timeP) end triggerEvent("startStoper", root, false) ts=nil end end) I think, must add something like refresh the text before createElement('text')