Jump to content

JeViCo

Members
  • Posts

    605
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by JeViCo

  1. Hello everyone. Does somebody know why? Wiki says that source of that event is a player but it doesn't work for some reason. Simple example (the second one works while the first one is not) addEventHandler("onPlayerSpawn",root,function() outputChatBox(tostring(getAccountID(getPlayerAccount(source)))) end) addCommandHandler("getID",function(p) outputChatBox(tostring(getAccountID(getPlayerAccount(p)))) end)
  2. solved. I used this info. Thanks everyone for suggestions anyway
  3. not really. Ok, forget about rows - concentrate on tables. table.insert adds value to the end of table right?. I want to add this value and then drag it on first place without replacing it (all other values will move forwards by 1 step)
  4. i tried. Text and player's data is fine now but rows' data is reversed somehow =D function moveTable(curpos) for m = 1, curpos do r = ( curpos + 1 ) - m -- добавка if r-1 > 0 then local r1_data = dgsGridListGetItemData(layergrid,r,1) -- привязка к номеру local r1_data2 = dgsGridListGetItemData(layergrid,r,1) -- привязка к номеру --local r1_text1 = dgsGridListGetItemText(layergrid,r,1) local r1_text2 = dgsGridListGetItemText(layergrid,r,2) local r1_text3 = dgsGridListGetItemText(layergrid,r,3) local r1_text4 = dgsGridListGetItemText(layergrid,r,4) -- добавка 2 local r2_data = dgsGridListGetItemData(layergrid,r-1,1) -- привязка к номеру local r2_data2 = dgsGridListGetItemData(layergrid,r-1,1) -- привязка к номеру --local r2_text1 = dgsGridListGetItemText(layergrid,r-1,1) local r2_text2 = dgsGridListGetItemText(layergrid,r-1,2) local r2_text3 = dgsGridListGetItemText(layergrid,r-1,3) local r2_text4 = dgsGridListGetItemText(layergrid,r-1,4) -- dgsGridListSetItemData(layergrid,r-1,1,r1_data) dgsGridListSetItemData(layergrid,r-1,2,r1_data2) --dgsGridListSetItemText(layergrid,r-1,1,r1_text1) dgsGridListSetItemText(layergrid,r-1,2,r1_text2) dgsGridListSetItemText(layergrid,r-1,3,r1_text3) dgsGridListSetItemText(layergrid,r-1,4,r1_text4) -- dgsGridListSetItemData(layergrid,r,1,r2_data) dgsGridListSetItemData(layergrid,r,2,r2_data2) --dgsGridListSetItemText(layergrid,r,1,r2_text1) dgsGridListSetItemText(layergrid,r,2,r2_text2) dgsGridListSetItemText(layergrid,r,3,r2_text3) dgsGridListSetItemText(layergrid,r,4,r2_text4) -- local k = getElementData(localPlayer,"player:data") local mid = k[m-1] k[m-1] = k[m] k[m] = mid setElementData(localPlayer,"player:data",k) end end end
  5. function attached to onClientRender event won't work if you used return at least once gate = Object(1337,712.61853, 659.00409, 9.94867) addEventHandler('onClientRender',root,function() if isCursorShowing() then local _,_,wx,wy,wz = getCursorPosition() gate:setPosition(wx,wy,wz) end end) @WelCome
  6. JeViCo

    Client Mission

    oops. Marker didn't appear for player who hit it (fixed). I recommend you to create those markers server-side (and make your code shorter of course). You'll able to set marker's element data to prevent bugs -- server for _, pl in ipairs(getElementsByType("player")) do --if pl ~= source -- if player is not that one who hit the marker if getElementData(pl,"mission") == getElementData(source,"mission") then -- if mission is the same (i attached it to ElementData) -- triggerClientEvent stuff (remove marker and create a new one) end --end end
  7. @killingyasoon walls = {"wall_1.png","wall_2.png","wall_3.png"} -- your wallpapers num = 1 setTimer(function() num = num + 1 if num > #walls then num = 1 end end,3*1000,0) -- 3 seconds addEventHandler("onClientRender",root,function() -- drawing image stuff dxDrawImage(0,0,100,100,walls[num]) end) fixed
  8. JeViCo

    Client Mission

    Markers are not synced so you should do it manually. You can use triggerClient/Server events for this action. when player hits the marker, use triggerServerEvent -- server for _, pl in ipairs(getElementsByType("player")) do if pl ~= source -- if player is not that one who hit the marker if getElementData(pl,"mission") == getElementData(source,"mission") then -- if mission is the same (i attached it to ElementData) -- triggerClientEvent stuff (remove marker and create a new one) end end end @Lalalu
  9. walls = {"wall_1.png","wall_2.png"} -- your wallpapers num = 1 setTimer(function() num = num + 1 if num > #walls then num = 1 end end,3*1000,1) -- 3 seconds addEventHandler("onClientRender",root,function() -- drawing image stuff dxDrawImage(0,0,100,100,walls[num] end) you can also add smooth transitions using interpolateBetween + render targets
  10. Hello everyone! Could you help me with this? I tried to make it but it doesn't work properly (at all) function moveToFirst(curpos) --local curpos = 5 for r = 1,curpos do --print(r) if r == curpos then dgsGridListSetItemText(layergrid,1,1,"#1") dgsGridListSetItemText(layergrid,r,1,"#"..r) else local r1_data = dgsGridListGetItemData(layergrid,curpos-r,1) -- 4 local r1_data2 = dgsGridListGetItemData(layergrid,curpos-r,2) -- local r1_text = dgsGridListGetItemText(layergrid,curpos-r,2) local r1_text2 = dgsGridListGetItemText(layergrid,curpos-r,3) local r1_text3 = dgsGridListGetItemText(layergrid,curpos-r,4) -- local r2_data = dgsGridListGetItemData(layergrid,curpos-r+1,1) -- 5 local r2_data2 = dgsGridListGetItemData(layergrid,curpos-r+1,2) -- local r2_text = dgsGridListGetItemText(layergrid,curpos-r+1,2) local r2_text2 = dgsGridListGetItemText(layergrid,curpos-r+1,3) local r2_text3 = dgsGridListGetItemText(layergrid,curpos-r+1,4) -- dgsGridListSetItemData(layergrid,curpos-r+1,1,r1_data) dgsGridListSetItemData(layergrid,curpos-r+1,2,r1_data2) dgsGridListSetItemText(layergrid,curpos-r+1,2,r1_text) dgsGridListSetItemText(layergrid,curpos-r+1,3,r1_text2) dgsGridListSetItemText(layergrid,curpos-r+1,4,r1_text3) -- dgsGridListSetItemData(layergrid,curpos-r,1,r2_data) dgsGridListSetItemData(layergrid,curpos-r,2,r2_data2) dgsGridListSetItemText(layergrid,curpos-r,2,r2_text) dgsGridListSetItemText(layergrid,curpos-r,3,r2_text2) dgsGridListSetItemText(layergrid,curpos-r,4,r2_text3) end end end p.s. for i = 1,10 works however for i = 10,1 is not pp.s. i used thisdp's DX Gui system for this action
  11. not really. You can add tuning part (wheels) to vehicles when they spawn and replace their model. Then you should add tire texture to each wheel (that's really not simple so you can look for finished one). you should use setElementData/getElementData server-side to make it synced (using triggerServerEvent) same ?
  12. JeViCo

    Raw data

    Sorry for bothering you. A agree that downloading files and removing them is really bad. I've already found out that i can add enctypted files to meta.xml, download them, and load them using temporary file.
  13. first of all i recommend you to use encodeString and decodeString to encrypt everything with your own password. Also you have to use those functions server-side to make your own password secure. By the way your protection depends from your code. If you send password + some info which attach current account to player (for example serial) using triggerServerEvent function - that would not be safe at all. Another example: when player log in, he/she gets elementData with account id/account name and you send it server-side - this is unsafe too. You have to send only player's password using triggerServerEvent and get other information server-side @tommymaster
  14. @overlocus, try to find something similar to this setPlayerHudComponentVisible("radar", true) or this showPlayerHudComponent("radar", true) in your code and remove it
  15. i recommend you to use createColCuboid, createColPolygon for this actions. You can attach own name to each colshape and easily detect them with onColShapeHit/onClientColShapeHit @22small
  16. @thisdp, could you check label properties? "clip" property doesn't work if current label has "colorcoded" property
  17. I want that for all resolutions, Not just for 1360 it WILL fit in each resolution - this is the simplest way. Your coordinates will be multiplied by (for example x: 1366/player_resolution) -> Bigger resolution x>0, smaller - 0<x<1 You can try it yourself by changing in-game/pc resolutions. By the way you should multiply dxDrawText's scale too
  18. This might be a little bit offtopic but i 100% understand you - that's quite nasty problem. Anyway you can't avoid it all the time. This page may help you. Also you can attach other information elements such as ID, type, etc so you can manage them with the least risk
  19. oh, i didn't see that. Thank you
  20. (server-side !!!) use setElementData for each vehicle. Load your data after on resource start and remove it (removeElementData)
  21. function enter (thePlayer, dim) if getElementType(thePlayer) == "player" then if not getPedIccupiedVehicle(thePlayer) and dim then --setElementPosition(thePlayer, 834.66796875, 7.431640625, 1004.1870117188 ) setElementInterior(thePlayer, 3, 834.66796875, 7.431640625, 1004.1870117188) if (getPlayerMoney(thePlayer)>= 100) then takePlayerMoney(thePlayer, 100) else outputChatBox("#ff0000You Don't Have Enough Money!",thePlayer,255,255,255,true) end end end end addEventHandler("onMarkerHit",markerJoin,enter) Use optional arguments @xXGhostXx
  22. Hello everyone. Something wrong here and i can't understand what - it always outputs boolean server-side addCommandHandler("gac",function(pl) setAccountData(getPlayerAccount(pl),"player:weapon_accur",{}) local acc = getPlayerAccount(pl) tab = getAccountData(acc,"player:weapon_accur") print(type(tab)) end)
×
×
  • Create New...