Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 15/03/20 in all areas

  1. No seu servidor existe a ACL Group Staff? Normalmente é mais fácil apenas verificar se o player tem permissão para mutar. (permissão de Staff) function CreateVehicle (thePlayer) local accName = getAccountName (getPlayerAccount (thePlayer)) if isObjectInACLGroup ("user."..accName, aclGetGroup ("staff")) then if getElementData (thePlayer, "Pegou", true) then return outputChatBox ("Espere #00ffff10 Segundos #FFFFFFpara pegar outro carro!", thePlayer, 255, 255, 255, true) end if Carro[thePlayer] then destroyElement(Carro[thePlayer]) Carro[thePlayer] = nil end local x, y, z = getElementPosition (thePlayer) local Cars = Veiculos[math.random(#Veiculos)] Carro[thePlayer] = createVehicle (Cars, x, y, z) setElementData (Carro[thePlayer], "creator", thePlayer) warpPedIntoVehicle (thePlayer, Carro[thePlayer]) outputChatBox ("[#00ffff/carro#000000] #bebebeVocê pegou um carro!", thePlayer, 0, 0, 0, true) setElementData (thePlayer, "Pegou", true) Timer[thePlayer] = setTimer (function (player) if isElement (player) then setElementData (player, "Pegou", false) end Timer[player] = nil end, 10000, 1, thePlayer) end end addCommandHandler ("carro", CreateVehicle) Além disso, na sua primeira função está faltando um then na linha 8 e um end no final da função.
    1 point
  2. É bom dar uma lida nesse tópico vídeo tudo sobre este fórum ! Farei um pequeno exemplo... addCommandHandler("receber", function(player, _, valor) if tonumber(valor) then outputChatBox("Você Pegou R$: "..tonumber(valor).." Reais.", player, 255,255,255, true) givePlayerMoney(player, tonumber(valor)) else outputChatBox("Error, Adicione o Valor.", player, 255,255,255, true) end end)
    1 point
  3. سلام عليكم بعد اعتززززلطووويل جيت ب مود وهوا انه لوحه وفيها دول اللي مصابين بالفايروس وعدد مود مش مشفر رابط [Link removed by moderator / تمت إزالة رابط التنزيل بواسطة المشرف ، انظر الرسالة الأخيرة لسبب] صوره لـــ مود
    1 point
  4. لقد نسخت الكود من https://community.multitheftauto.com/?p=resources&s=details&id=18041 وقمت بأستخدامه من دون القيام آخذ اذن من صاحب الكود وأيضاً لقد قمت بآخذ الفكرة بأكملها وائتمانها بأسمك وحتى من دون حتى ذكر صاحب الفكرة أو الكود. على كلً سيتم إغلاق هذا البوست وادا تفضلت يرجى عدم عمل اي ريسورس خاص بموضوع "الكورونا" في المستقبل القريب. ^ Translated & locked, @Ahmed Ly
    1 point
  5. على الاقل اذكر حقوق الشخص اللي اخذت منه نص المود.. https://community.multitheftauto.com/?p=resources&s=details&id=18041
    1 point
  6. Due of error codes, it's easy. Function expects element (mostly stored in variable or as parameter), your p is nil. Similar case, but this time you got boolean (false), let's check what returns getPlayerAccount: Your variable p was nil, and therefore function returned false on it's failure.
    1 point
  7. Please use the Portuguese board if you wish to receive help in that language. Scripting section is for English posts only. We'll have your thread moved there, but for future reference please see: https://forum.multitheftauto.com/forum/127-programação-em-Lua/ Thanks
    1 point
  8. Dear Moony, I assume that your script is serverside, thus the signature of a command handler function looks like: local function commandHandler(player, commandName, args...) In your script above you wrote for the Warning1 command handler: function Warning1() but you should have written... function Warning1(p) to receive the player that executed the command. I have not inspected further errors in the script so please tell us if you have further questions.
    1 point
  9. Na função createMarker(server-side) tem um argumento que você pode especificar para qual elemento o marker deve ser visível, e também há uma função chamada setElementVisibleTo que você pode usar para definir quem poderá ver o marker.
    1 point
  10. local drawDistance = 7 g_StreamedInPlayers = {} function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then local vx, vy, vz = getPedBonePosition(player, 4) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then if getElementAlpha(player) > 0 then -- se o alpha do player for maior que 0 mostra o ID local ID = getElementData(player, "ID") or "N/A" local w = dxGetTextWidth(ID, 0.1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawText(""..ID.."", x - 1 - w / 1, y - 1 - h - 12, w, h, CorTag, 1.20, "default-bold", "left", "top", false, false, false, false, false) CorTag = tocolor(255, 255, 255) if getElementData(player, "Cor", true) then CorTag = tocolor(0, 255, 0) end end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", root, onClientRender) function CorTagid () if getElementData(localPlayer, "Cor", true) then setElementData(localPlayer, "Cor", false) else setElementData(localPlayer, "Cor", true) end end bindKey ( "z", "both", CorTagid ) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart() local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) O else estava no lugar errado. Corrigido, teste ai
    1 point
  11. setVehicleDamageProof
    1 point
×
×
  • Create New...