Leaderboard
Popular Content
Showing content with the highest reputation on 25/07/19 in all areas
-
Try this local playersUsingMic = {} local x, y = guiGetScreenSize ( ) local sx, sy = 1600, 900 function onStartVoiceChat() local x, y, z = getElementPosition(source) local x2, y2, z2 = getElementPosition(localPlayer) local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if (distance <= 15) then local myIndex = getMyValue(source) if (not myIndex or not playersUsingMic[myIndex]) then local p_id = getElementData (source, "ID") or "0" table.insert(playersUsingMic, {source, p_id}) end end end addEventHandler("onClientPlayerVoiceStart", root, onStartVoiceChat) function onStopVoiceChat() for i, v in ipairs(playersUsingMic) do if (v[1] == source) then table.remove(playersUsingMic, i) end end end addEventHandler("onClientPlayerVoiceStop", root, onStopVoiceChat) function drawText() if (#playersUsingMic > 0) then for i, v in ipairs(playersUsingMic) do dxDrawText("Talk: "..getPlayerName(v[1]).." ["..v[2].."]", x * (27/sx), i*30 + y * (341/sy), x * (294/sx), i*30 + y * (376/sy), tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) end end end addEventHandler("onClientRender", root, drawText) function getMyValue(player) for i, v in ipairs(playersUsingMic) do if v[1] == player then return i end end end1 point
-
Just a little advise: if you're trying to find something (on Windows; non-grep) in future, then use Notepad++ and: 1) open your windows explorer and navigate to your gamemode's root directory 2) search there for: *.Lua like this: Now, your search results will be all script files in all of your gamemode resources. 3) press CTRL + A (select all script files), and right click > "Edit with Notepad++" like this: So when you clicked that, it will open all code files at the same time (Notepad++ supports having files open simultaneously). This may take a while depending on their amount and your gamemode's size, and whether or not you're using the 64-bit version of Notepad++; just be patient and wait until it's loaded. Now, we are going to search a keyword that refers to what you want to find. As you can imagine, all commands in your gamemode can be found on the term addCommandHandler, but commands also start with either ' or " so for this example, we are going to search for this keyword: I explained that part so you can learn how to find specific categories of things, by figuring the hints it may hold. So now, let's do the actual search: Notepad++ search box (CTRL + F) > "Find All in All Opened Documents", this is the trick. It will search all of your gamemode, because you got all script files opened at the same time. Like this: So now you will have results on the bottom for all files in which it is found, like here: Double click the line to conveniently go to the relevant file and location of the result. Another example (a more common search; multiple hits): This method will help anyone that doesn't know their codebase very well in and out/knows where everything is located. It's not only used for locating a function that you know exists somewhere, but also to find all scripts/functions that deal with a specific thing (obvious but - for example if there are bugs with vehicle fixing, you would search for fixVehicle and/or setElementHealth, to evaluate the code of all occurences for a flaw). @majqq1 point
-
1 point
-
شوك قوزال كارديش , ماهو غريب عليك هالابداع , أبدعت1 point
-
1 point
-
1 point
-
1 point
-
local myTimers = {} function leaveVehicle(player) if veh1[player] and isElement(veh1[player]) then myTimers[player] = setTimer(destroyElement, 5000, 1, veh1[player]) end end addEventHandler("onVehicleExit", getRootElement(), leavevehicle) function entervehicle(player) if (isTimer(myTimers[player])) then killTimer(myTimers[player]) end end addEventHandler("onVehicleEnter", getRootElement(),entervehicle)1 point
-
function draw () dxDrawLoading(196*sx/800, 482*sy/600,422*sx/800, 58*sy/600, 196*sx/800 , 450*sy/600 ,1.00*sx/800,tocolor(0,0,0,170),tocolor(0,255,0,170),5000) if (not isTimer(myTimer)) then myTimer = setTimer(stopDraw, 5000, 1) end end addEventHandler("onClientRender",root,draw) stopDraw() removeEventHandler("onClientRender", root, draw) end local start = getTickCount() function dxDrawLoading (x, y, width, height, x2, y2, size, color, color2, second) local now = getTickCount() local seconds = second or 5000 local color = color or tocolor(0,0,0,170) local color2 = color2 or tocolor(255,255,0,170) local size = size or 1.00 local with = interpolateBetween(0,0,0,width,0,0, (now - start) / ((start + seconds) - start), "Linear") local text = interpolateBetween(0,0,0,100,0,0,(now - start) / ((start + seconds) - start),"Linear") --dxDrawText ( "Loading ... "..math.floor(text).."%", x2, y2 , width, height, tocolor ( 0, 255, 0, 255 ), size, "pricedown" ) dxDrawRectangle(x, y ,width ,height -10, color) dxDrawRectangle(x, y, with ,height -10, color2) end1 point
-
O evento que irá mostrar o dx é o "PAINELCORPOUGANG", você não está chamando ele. E também, existem duas funções com o mesmo nome, chame a função showPanel no "onMarkerHit" Esse código precisa de uma melhorada, completamente bagunçada a indentação, utiliza funções antigas (setPedSkin) e além disso está muito mal otimizado. @madgameron1 point
-
Sorry for late response, I was sleeping. ? local playersUsingMic = {} local x, y = guiGetScreenSize ( ) local sx, sy = 1600, 900 function onStartVoiceChat() local myIndex = getMyValue(source) if (not myIndex or not playersUsingMic[myIndex]) then local p_id = getElementData (source, "ID") or "0" table.insert(playersUsingMic, {source, p_id}) end end addEventHandler("onClientPlayerVoiceStart", root, onStartVoiceChat) function onStopVoiceChat() for i, v in ipairs(playersUsingMic) do if (v[1] == source) then table.remove(playersUsingMic, i) end end end addEventHandler("onClientPlayerVoiceStop", root, onStopVoiceChat) function drawText() if (#playersUsingMic > 0) then for i, v in ipairs(playersUsingMic) do dxDrawText("Talk: "..getPlayerName(v[1]).." ["..v[2].."]", x * (27/sx), i*30 + y * (341/sy), x * (294/sx), i*30 + y * (376/sy), tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) end end end addEventHandler("onClientRender", root, drawText) function getMyValue(player) for i, v in ipairs(playersUsingMic) do if v[1] == player then return i end end end1 point
-
It is just an extra block, which runs 1 time. Similar to: if true then end And no it is not required, but it makes it very clear that some action are happening there. You more often see those be used to enclose reused variables, without overwrite the original. local base = 1 if 1 == base then do local base = 2 print(base) -- 2 end do local base = 3 print(base) -- 3 end print(base) -- 1 end Or delete unused variables: local a do local b = 100 a = b * b * b end1 point
-
No scoreboard, só acessar as configurações dele pelo painel admin e mudar o parâmetro Allow colorcoded names para false. No chat, vc deve cancelar o envio normal das mensagens e reenviá-las sem o parâmetro colorcoded (aquele true que vem depois dos 255). Se você estiver com um resource de TAGs, faça a correção nele. Se não tiver um resource de TAGs, crie um resource novo com um server.Lua e coloque isso nele: function chatbox (text, msgtype) local name = getPlayerName (source) if (msgtype == 0) then cancelEvent (true) -- Cancela a mensagem original. outputChatBox (name..": "..text, root, 231, 217, 176) -- Reenvia a mensagem sem cores. (vai aparecer os códigos de cor em vez disso) outputServerLog ("CHAT: "..name..": "..text) end end No killmessages dai é mais complexo, pois ele vem nativamente bugado. Substitua o script inteiro do textlib.Lua por esse:1 point
-
@Kenix @majqq I think the issue is now solved. Had to make some annoying adjustments, before it finally did work in all the different context/scenario's. Now it doesn't matter when and where an item gets remove at any index. When it is remove, it gets temporary replaced by a boolean and removed while iterating/rendering. The render order is correct as well. I know it is a bit of a dirty hack, but it does not things up as it is in some of the known scenario's. Let me know if there are no new issues occurring. New version: (need some more testing, just in case)1 point
-
Try this: local playersUsingMic = {} local x, y = guiGetScreenSize ( ) local sx, sy = 1600, 900 function onStartVoiceChat() local p_id = getElementData (source, "ID") or "0" table.insert(playersUsingMic, {source, p_id}) end addEventHandler("onClientPlayerVoiceStart", root, onStartVoiceChat) function onStopVoiceChat() for i, v in ipairs(playersUsingMic) do if (v[1] == source) then table.remove(playersUsingMic, i) end end end addEventHandler("onClientPlayerVoiceStop", root, onStopVoiceChat) function drawText() if (#playersUsingMic > 0) then for i, v in ipairs(playersUsingMic) do dxDrawText("Talk: "..getPlayerName(v[1]).." ["..v[2].."]", x * (27/sx), i*30 + y * (341/sy), x * (294/sx), i*30 + y * (376/sy), tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) end end end addEventHandler("onClientRender", root, drawText)1 point
-
Substitua aquela linha 10 por isso: local allowed = {"DM", "Moderador", "SuperModerator", "Admin"} -- Lista de ACL Groups que a mensagem vai aparecer. for i, jogador in ipairs (getElementsByType ("player")) do -- Para cada jogador do servidor, faça: for k, accN in ipairs (allowed) do -- Para cada string da table allowed, faça: if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount(jogador)), aclGetGroup(accN)) then outputChatBox ("[#4888f7FW-SETAGEM#c9c9c9]#fae7a2O #4888f7"..SetNamePlayer.." #fae7a2Setou o Player #4888f7"..nameR.." #fae7a2De Dono do Morro (DM)", jogador, 201, 201, 201, true) break end end end1 point
-
<?php $programmers = array("SuperX", "KhaledAlamri", "RolExAlamri"); echo "the best programmers " . $programmers[0] . ", " . $programmers[1] . " and " . $programmers[2] . "."; ?>1 point
-
Dependendo do modelo da construção, a porta é separada e dai vc consegue tirar ela no editor de mapas do MTA. Sobre colocar o interior dentro da construção, vc vai precisar modificar o modelo do interior, pois eles geralmente não cabem dentro das construções. Você vai ter um trabalho absurdo que não vale a pena. Mais detalhes nesse outro tópico com mesmo assunto:1 point
-
1 point
-
عمل جيد , ولو سويت الرسالة تظهر علي الشاشة لفترة وتختفي من غير ماتخرب الشاشة علي اللاعب الي وصلته الرسالة يكون افضل وشكرا ع الاهداء يا بطل1 point
-
1 point
-
ههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههه1 point
-
1 point
-
1 point
-
update : Best Programmers : local BestProgrammers = { {'Mr.Tn6eL'}, {'ZA7F'}, {'TAPL'}, {'ALw7sH'}, {'Wizard'}, {'EH10'}, {'JustBoy'}, {'LoOs'}, {'Mr.SAUD'}, {'#CroSs'}, {'Moder 2014'}, {'Al3grab'}, {'StrOnG'}, {'RolEx'}, {'DABL'}, {'Ronaldo'}, -- trying hacked servers {'ahmedfef'}, }1 point
-
1 point
-
@EduardoMega não reviva tópicos antigos. Da próxima vez crie seu próprio tópico.0 points
