-
Posts
52 -
Joined
-
Last visited
Everything posted by Mature
-
Hello community, I created a script to mark the location of the location in dx, where it shows the location, how many meters are from the location, and I was looking to improve this function where, basically, if the 3D Dx image is not activated On the player screen , the image will be in the corner of the image corresponding to the side where the mark is. Image: https://imgur.com/a1AKZ96 Expectation made in the Photo Shop: https://imgur.com/Tskkamp
-
Hello community, Well, I need your help ... I'm trying to create a system in which the player releases an object, and the object is next to the player, regardless of the rotation, I did this check, but it always falls on the first check, regardless of rotation. local _, _, rotz = getElementRotation(element) outputChatBox(math.floor(rotz), element) if math.floor(rotz) > 0 and math.floor(rotz) < 80 then local x,y,z = getElementPosition(element) object[element] = createObject(2969, x, y - 1, z - 0.8) setObjectScale(object[element],1.4) setElementCollisionsEnabled(object[element],false) outputChatBox("1", element) else if math.floor(rotz) > 165 and 250 < math.floor(rotz) then local x,y,z = getElementPosition(element) object[element] = createObject(2969, x, y - 1, z - 0.8) setObjectScale(object[element],1.4) setElementCollisionsEnabled(object[element],false) outputChatBox("2", element) else if math.floor(rotz) > 251 and 350 < math.floor(rotz) then local x,y,z = getElementPosition(element) object[element] = createObject(2969, x, y - 1, z - 0.8) setObjectScale(object[element],1.4) setElementCollisionsEnabled(object[element],false) outputChatBox("3", element) end end end The coordinates are incorrect, I know, but basically I just want help checking the element's rotation.
-
I will solve the loop problem, thanks for remembering, but I was wondering, is there any way to create a function that can execute chat commands? being dx or just using F8? if so, can you give me a code example?
-
Hi, I'm creating a dx chat script, but I have a problem that I don't understand why it's happening. Basically, I want the player to be able to give basic commands in the chat, I already searched the forum and found but I don't understand why my script is not working and it is exactly the same. Can someone help me? Topic: https://forum.multitheftauto.com/topic/70958-execute-commands/ Client: triggerServerEvent("RZK:Chat", resourceRoot, localPlayer, sett, guiGetText(boxText)) Server addEvent("RZK:Chat", true) addEventHandler("RZK:Chat", resourceRoot, function (thePlayer, set, ...) if set and {...} then local tableM = {...} local first = tableM[1] table.remove(tableM, 1) if string.sub(first,1,1) == "/" then local command = string.sub(first, 2, string.len(first)) local arguments = table.concat(tableM, " ") executeCommandHandler( command, thePlayer, arguments ) print(command..' A '..arguments) else if set == "local" then local x,y,z = getElementPosition(thePlayer) local players = getElementsWithinRange(x, y, z, 50, "player") for i,player in ipairs(players) do triggerClientEvent(player, "chat:box", root, thePlayer, set, first) end else triggerClientEvent(root, "chat:box", root, thePlayer, set, first) end end end end)
-
Hello, I'm developing a system and I need it, when executing an action that creates a 'guiEditBox', to automatically select the box, without having to click (similar to F8). Can someone help me?
-
Thanks, a question, how will this update per second not affect the server? because you are pulling a table every second, I worry about that, in your opinion, what do you think?
-
Can you give me an example please?
-
Do you have any light to give me? What can I do?
-
Hello, I'm creating a STAFF system that, basically, when the administrator enters the server, creates an event, with a count to see how many hours he was online, but I have a problem when he leaves the client to inform the hours. Client addEventHandler( "onClientPlayerQuit", getRootElement(), function () if localPlayer == source then if isTimer(timerAdmin) then triggerServerEvent("RZK:Attime", resourceRoot, localPlayer, 0, hour, minute) killTimer(timerAdmin) end if isTimer(timerExtra) then triggerServerEvent("RZK:Attime", resourceRoot, localPlayer, 1, (hour + 4), minute) killTimer(timerExtra) end end end) Server addEvent("RZK:Attime", true) addEventHandler("RZK:Attime", resourceRoot, function (thePlayer, typ, h, m) if thePlayer and h and m and typ then local gid = getElementData(thePlayer, "char:id") if typ == 0 then local ad = dbQuery(sql, "SELECT * FROM Admin WHERE ID=?", gid) local rd = dbPoll(ad, -1) if #rd ~= 0 then dbExec(sql, "UPDATE Admin SET H = ?, M = ? WHERE ID = ?", h, m, gid) end end if typ == 1 then local ad = dbQuery(sql, "SELECT * FROM Admin WHERE ID=?", gid) local rd = dbPoll(ad, -1) if #rd ~= 0 then dbExec(sql, "UPDATE Admin SET H = ?, M = ? WHERE ID = ?", h, m, gid) end end end end) How can I fix this?
-
Does setting a variable or memory to 'nil' help server performance or not? If you can give tips on things that help in running the script to get better performance, I would be grateful, thanks. =D
-
I'm looking to learn how to model interiors etc., open a building, these things, but I would like to know if there is only the blender for this or if there are other programs that are easier to use and if you have a complete video that teaches well, thank you to you.
-
Hello community, I have the following question, what is the difference between a local function and a function? Example: local function () For this function () When should I use a local function and when should I use a common function?
-
Hello, should native functions like 'onVehicleEnter' or 'onClientClick' be used ResourceRoot, or are they just trigger created on the resource?
-
Hello, I am trying to create a function that if an object enters a colShape, its element will appear, as if it were a common player.
-
Hello community, as some already know, I am developing a server that involves a lot of appearance and information, and I would like some code tips that I should avoid and some tips, because I don't have much experience and doubt, Dx starts to give a problem until Score? I'm looking to create a chat box in dx, but I'm not sure if it can affect performance ... But I appreciate your help.
-
Hello community, well, in the past, I played on a server and the default chat was in the lower left, different from the original in the upper left, can this be modified? If so, what is the function?
-
local posicoes = { { 2488, -1670, 14 }, } function PosicaoPlayer ( thePlayer, command ) setTimer(function() local azar = math.random ( #posicoes ) local veh = getPedOccupiedVehicle(thePlayer) if (veh) then setElementPosition(veh, unpack ( posicoes [ azar ] ) ) else setElementPosition(thePlayer, unpack ( posicoes [ azar ] ) ) end outputChatBox ('#FFFFFF[ #00FF00Tele#FFFFFF ]: #FFFFFF' .. getPlayerName(thePlayer) .. ' #828282Foi Para A Casa Do Cj #FFFFFF(#00FF00 /cj #FFFFFF)', root, 255, 255, 255, true) end, 5000, 1) end addCommandHandler ( "cj", PosicaoPlayer ) --- local posicoes = { { 324, -1779, 5 }, } function PosicaoPlayer ( thePlayer, command ) setTimer(function() local azar = math.random ( #posicoes ) local veh = getPedOccupiedVehicle(thePlayer) if (veh) then setElementPosition(veh, unpack ( posicoes [ azar ] ) ) else setElementPosition(thePlayer, unpack ( posicoes [ azar ] ) ) end outputChatBox ('#FFFFFF[ #00FF00Tele#FFFFFF ]: #FFFFFF' .. getPlayerName(thePlayer) .. ' #828282Foi Para A Praia #FFFFFF(#00FF00 /praia #FFFFFF)', root, 255, 255, 255, true) end, 5000, 1) end addCommandHandler ( "praia", PosicaoPlayer )
-
Hello community, well, I was thinking of creating a system where you start to bleed more without being dead (for a while) The blood would be basically the same as the GTA San Andreas ambulance mission image: Print
-
Hello community, well, I was thinking of creating a system where you start to bleed more without being dead (for a while) The blood would be basically the same as the GTA San Andreas ambulance mission image: Print
-
Vou chamar meu querido Chamei MaTuURe#0069
-
Olá, Então cara você pode fazer o seguinte, pega sua função e pelo oque entendi ele da /curar e faz uma animação durante 5 segundos correto? Oque você pode fazer é oque pegar o setTimer por e fazer uma verificação para ver se aquele tempo está correndo, se estiver a função não é seguida Exemplo: local timerCura = {} -- Coloque isso fora da função la no topo if isTimer(timerCura[thePlayer]) then -- Verificar se o tempo está correndo ou não outputChatBox("O jogador já está sendo reanimado!.", thePlayer) -- Use para informar que o comando já foi dado. else -- Se a verificação for falsa ai o começa a reanimação. timerCura[thePlayer] = setTimer(givePlayerMoney, 5000, 1, thePlayer, 3000) -- Utilize isso para o script verifica se está ocorrendo o set timer Creio que vai lhe ajudar!
-
Hello guys, I have a problem where is the following, I am creating a system of clothes with shaders to have more varieties, it seems, I do not know how to apply the shader correctly, when the player goes to the store buys the clothes, the shader is applied to all players, but how do I get the newly connected player to see the shader? Can someone help me?
-
Hello community, I am creating a customization system by Shaders, where the player creates his modification on the client and, after finishing the modification, each element he selects has a certain "ID" created by me, I want to make the script flow in the best way. . possible, and could someone give me a tip on how to send this information to the server to distribute to everyone and return to the client of all players? Here is a brief syntax: Client: (Note: The element has already been set correctly in the model, everything is correct and I will summarize using the ID's already!) Tshirt = 3 -- These are the ID's that are set in the script. Pants = 10 triggerServerEvent("Script:ServerDs", localPlayer, localPlayer, Tshirt, Paint) -- That would be the way to send the server that I would do most not think correct. Ok, after uploading to the server and distributing it, I may even return to the client to add the fixed Shader to the player, but the way I have in mind doesn't seem to be the safest thing to do, I want to improve it as much as possible. and I would like someone to help me with the right indication. Also, the script would basically add something to CJ's face, I used a t-shirt and pants as an example. In conclusion: I just want that after the modification, make the distribution to the server with the IDs, after the distribution returns to the client of all players to make the modification visible.
-
Hi guys, I have a server and would like you to give me some important tips for good performance and the shortest possible time on server and client, and one question, I created a Shaders system where CJ leaves White, which can result in frame drops? as all players would use this modification!