Hazardinho

Members
  • Content Count

    25
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Hazardinho

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 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?
  2. 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.mtasa.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)
  3. 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?
  4. 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?
  5. Can you give me an example please?
  6. Do you have any light to give me? What can I do?
  7. 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?
  8. 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
  9. 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.
  10. 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?
  11. Hello, should native functions like 'onVehicleEnter' or 'onClientClick' be used ResourceRoot, or are they just trigger created on the resource?
  12. 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.
  13. 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.
  14. 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?
  15. 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 )