Jump to content

JeViCo

Members
  • Posts

    605
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by JeViCo

  1. What do you mean - street lights or car lights? Anyway you should know this: - If you want to apply shader on a single object/car/skin you should add targetElement (3-rd argument of engineApplyShaderToWorldTexture). If you didn't add this, shader would apply on every element with your texture name - If you want to apply shader on several object/cars/skins you should add targetElement which i indicated in the paragraph above AND create own shader for each element (i took both from wiki notes) for example you can use tables vehs = {} vehs["vehicle element"] = "dxCreateShader stuff (shader element)"
  2. no problem. I'm glad i can help you while testing your awesome script. Keep it up
  3. same addCommandHandler("ttt",function() local x, y, z = getElementPosition ( localPlayer ) local px,py,pz = x,y,z local _,_,r = getElementRotation ( localPlayer ) x = x - math.sin ( math.rad ( r ) ) * 2 y = y + math.cos ( math.rad ( r ) ) * 2 d3 = dgsCreate3DInterface(x, y, z+1,2,2,512,512,0xFF000000,nil,nil,nil) w_main = dgsCreateWindow(0, 0, 100, 100, "test window", false) dgsSetParent(w_main,d3) dgsSetProperty(d3,"faceTo",{px,py,pz}) end)
  4. addCommandHandler("ttt",function() local x, y, z = getElementPosition ( localPlayer ) local _,_,r = getElementRotation ( localPlayer ) x = x - math.sin ( math.rad ( r ) ) * 2 y = y + math.cos ( math.rad ( r ) ) * 2 d3 = dgsCreate3DInterface(x, y, z+1,2,2,512,512,0xFF000000,nil,nil,nil) w_main = dgsCreateWindow(0, 0, 100, 100, "test window", false) dgsSetParent(w_main,d3) end)
  5. i found this page and i think it can be useful. But i don't know what does it exactly clear/remove and when should i use it
  6. Hello everyone. My question is in title - what does it exactly do? Does it clear global/local variables?
  7. i didn't know about that, thanks! p.s. i've just tested those offsets and they don't work for me (at all) addCommandHandler("ttt",function(cmd,amount) local x, y, z = getElementPosition ( localPlayer ) local _,_,r = getElementRotation ( localPlayer ) x = x - math.sin ( math.rad ( r ) ) * 2 y = y + math.cos ( math.rad ( r ) ) * 2 d3 = dgsCreate3DInterface(x, y, z+1,2,2,512,512,0xFF000000,tonumber(amount),r) w_main = dgsCreateWindow(0, 0, 100, 100, "test window", false) dgsSetParent(w_main,d3) end) i thought i can rotate those menus using offsets and player rotation but all of them Could you add something like camera position settings then? 1. Menu always facing towards the player (dynamic world position) 2. Menu always facing towards the single point (static world position)
  8. i cut that from my code. I forgot to add dgsSetParent i tried to add coordinates from getCameraMatrix and getElementPosition - same. I'll try with nil,nil,nil
  9. you should use setElementData ( set it server-side to make it synced using triggerServerEvent function), add onClientElementStreamIn to create an object, read any information using getElementData, remove object using onClientElementStreamOut AND onClientElementDestroy when the car disappears 100% works (custom vehicle wheels experience)
  10. Hello everyone. I used an example (2) from wiki but cancelEvent() doesn't work so i can see double messages in chat --This function is executed when a player joins, it sets the player's name-tag color to a random color. local function playerJoin() local red, green, blue = math.random (50, 255), math.random (50, 255), math.random (50, 255) setPlayerNametagColor(source, red, green, blue) end addEventHandler ("onPlayerJoin", root, playerJoin) --This function is executed when a player says something in chat, it outputs the player's message, with their nick colored to match their name tag color. local function playerChat(message, messageType) if messageType == 0 then --Global (main) chat cancelEvent() local red, green, blue = getPlayerNametagColor(source) outputChatBox(getPlayerName(source)..": #FFFFFF"..message, root, red, green, blue, true ) outputServerLog("CHAT: "..getPlayerName(source)..": "..message)--NOTE: Beacuse we cancelled the onPlayerChat event, we need to log chat manually. end end addEventHandler("onPlayerChat", root, playerChat)
  11. Could you help me a little bit? (maybe not). Something wrong with my code - 3d menu always facing the wrong way local x, y, z = getElementPosition ( localPlayer ) local _,_,r = getElementRotation ( localPlayer ) x = x - math.sin ( math.rad ( r ) ) * 2 y = y + math.cos ( math.rad ( r ) ) * 2 d3 = dgsCreate3DInterface(x, y, z+1,2,2,512,512,0xFF000000) w_main = dgsCreateWindow(0, 0, 0.32, 0.58, "test window", true)
  12. if you created an element client-side you're not able to make it visible for other players - you can only create same object for others. I recommend you to create it server-side and manage it using setElementVisibleTo and SetElementCollidableWith + onClientElementStreamIn/out functions @BlockFighter
  13. client variable = the client that called the event (wiki) source variable = the element you defined in triggerServerEvent after event name Try to use player element (source) instead of client element local PasajENP = {} function KnowAmountFunction (pia) outputChatBox ("AA",source) -- it will send to player who triggered this event if (pia == 1) then PasajENP[source] = PasajENP_a1 triggerClientEvent (source, "GotoClient", source, PasajENP[source] ) end end addEvent( "KnowAmount", true ) addEventHandler( "KnowAmount", getRootElement(), KnowAmountFunction ) @Lormateve
  14. JeViCo

    AC Kick

    you're probably running prohibited software on background. For example Sandboxie, Chean Engine, HEX editor are not allowed. Also your computer may have a virus so MTA blocks it
  15. GUYS i found the problem but i have no idea how to fix it. I create render targets using this rt[p] = dxCreateRenderTarget(512,512,true) -- p - player variable If i hit any marker or teleport somewhere, this rendertarget disappears/removes etc. I used this code addCommandHandler("fff",function() print(tostring(rt[localPlayer])) print("test") end) and got this result: Any suggestions?
  16. i've already gotten "jbib_diff_007_k_uni" from this function
  17. texNames = {"jbib_diff_007_k_uni"} -- custom skin texture name streamedPlayers = {} addEvent("setClientStuff",true) addEventHandler("setClientStuff",getRootElement(),function() local p = source --if not getElementData(p,"player:loaded.clothing") then table.insert(streamedPlayers,p) fx[p] = dxCreateShader ( "shad.fx", 0, 0, false, "ped" ) for _, t in pairs(texNames) do engineApplyShaderToWorldTexture(fx[p],t,p) end rt[p] = dxCreateRenderTarget(512,512,true) dxSetShaderValue(fx[p],"tex",rt[p]) -- variable defined in shader so everything OK --end end)
  18. if you want to make images of each vehicle for in-game usage, you can use this resource.
  19. I guess this can be useful for you combine it with onClientKey and that's it. I didn't test it so i might be wrong @Tekken
  20. yeah, i've recently discovered that thing too. It appeares sometimes for no reason. Any time mate
  21. i recommend you to use this instead of executing on each client: addEventHandler("onClientObjectDamage",root,function() if getElementData(source,"object:unbreakable") == true then cancelEvent() end end) And of course you should add this server-side setElementData(obj,"object:unbreakable",true) -- obj - your object variable or this client-side setElementData(obj,"object:unbreakable",true,true) -- obj - your object variable. Last argument allows to read this information server-side to make it everything work. Anyway let's analize your problem. The most common problem - you put server-side script above client-side script in meta.xml. Another problem - you have another errors in client-side script, so you can't use it. @JanKy
  22. oops i described it wrong. Image doesn't disappear. If i spawn, i can apply image on shader and everything OK. BUT If i spawn and then i step on marker (change my dimension) or teleport somewhere using default freeroam resource, image doesn't apply then for some reason. So i'm trying to find out the source of problem
  23. this function encodes/decodes strings. For example you can read whole file using fileRead and fileGetSize functions (added this on wiki), encode them with password, save client-side. Nobody won't steal decoded file if they don't have password. This method is a little bit better but is unsafe too because you should always keep html file opened to work on client-side. Someone may steal it using common software
  24. Hello everyone. I met 1 problem ~5 minutes ago. When player spawns, shader creates and applies on ped's texture (custom skin texture) dxCreateShader ( "shad.fx", 0, 0, false, "ped" ) Then i add image on as dxSetShaderValue material <--- everything OK here and i can see this texture. If i teleport somewhere using default freeroam resource/hit the marker (it changes my dimension), this texture disappeares. i use gTexture(source material) + my texture + alpha blending.
×
×
  • Create New...