Search the Community

Showing results for tags 'script'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 574 results

  1. This script is something like Quest but with Crystals, you will find all the crystals you will receive a large amount, but you can change the amount, the cords! Info: - Your task is to look for hidden crystals on the map. - Only 10 crystals. By finding the latter, you receive a cash reward. - Crystals are updated once a day. That means you have exactly 24 hours to collect all the crystals and get a prize. - For players to remember where the crystal is located, more points can be set for each crystal. - When a crystal is found, the soundtrack and the text appears on the screen. - You can change the coordinates of the client.lua. Look for some images: https://imgur.com/a/zRbdQfs The price of this script is 20Euro! The payment is done only through Paysafe (accept and exchange of Romanian scripts related to DayZ!) For more details contact me in private !
  2. Acest script este ceva de genu Quest dar cu Cristale,vei găsii toate cristalele vei primi o sumă mare, dar puteți să schimbați suma,cordonatele! Info: - Sarcina ta este să cauți cristale ascunse pe hartă. - Doar 10 cristale. Prin găsirea acestuia din urmă, primiți o recompensă în numerar. - Cristalele sunt actualizate o dată pe zi. Asta înseamnă că aveți exact 24 de ore să colectați toate cristalele și să obțineți un premiu. - Pentru ca jucătorii să nu-și amintească unde și cristalul este localizat, pot fi setate mai multe puncte pentru fiecare cristal. - Când se găsește un cristal, coloana sonoră și textul apare pe ecran. - Puteți Schimba coordonatele din client.lua. Uitați-vă niște imagini: https://imgur.com/a/zRbdQfs Prețul Acestui Script e de 10Euro ! Plata se face doar prin Paysafe (accept și schimb de scripturi românești legate de DayZ!Mai ales de la Gamemode-ul RomaniaZ !)(Crismar dacă vezi această postare fără supărare dar scripturile tale sunt geniale n-am cuvinte,dar am nevoie de ele pentru a deschide un server de DayZ, dar oricum voi băga creditele tale că nu sunt ca ceilalți copii!Pur și simplu vreau să deschid serverul cum era ROZ în 2013 așa vreau să fac și eu un server dar cu alt nume.)
  3. sevenlwo

    freeroam help

    Hello, i'm trying to create a checkbox to enable and disable the ghost-mode on my F1(freeroam) panel on MTA server, but actually i dont know how to do it. someone can help me?
  4. Hi, Because we have an atmosphere called winter, why is it only in reality? Abo, because you do not have this script that will add a winter climate to your server and its players. Together with the team, we have created another project! F7 - turning off the snow on the screen Download: https://www55.zippyshare.com/v/cwmhgfTo/file.html Video:
  5. I'm trying to make a resource that obtain the name of a player like this line: local who = getPlayerName(playerSource), playerSource(who) but i got this GetPlayerName [expected element at argument 1, got nil] lua:13: attempt to call global 'playerSource' (a nil value) I need help :'c the script is of the type server
  6. When i write a message to chatbox the picture appears in the right place, but when a another player output something in chatbox, the picture jumps up more than my message.. How to fix this bug?! Client: emotes = {} function showEmotes(originaltext,emote,emoteID) local totaltextwidth = getImageOffsets(originaltext) local chatwidth = getChatboxLayout()["chat_width"]*317*scaleX local originalmultiplier = math.floor(totaltextwidth/chatwidth) local text,_ = string.gsub(originaltext,tostring(emoteID..".*"),"") local width = getImageOffsets(text) local multiplier = math.floor(width/chatwidth) local width = width-multiplier*chatwidth table.insert(emotes,{emote,width,lines-(originalmultiplier-multiplier),false}) local _,index1 = string.gsub(originaltext,emoteID,emoteID) if index1>1 then local text,index = string.gsub(originaltext,emoteID,"-00",1) showEmotes(text,emote,emoteID) end end addEvent("triggerChat",true) addEventHandler("triggerChat",root,showEmotes) function getImageOffsets(text) lines = getChatboxLayout()["chat_lines"] local chatboxscale = getChatboxLayout()["text_scale"] local fontint = getChatboxLayout()["chat_font"] scaleX = getChatboxLayout()["chat_scale"][1] scaleY = getChatboxLayout()["chat_scale"][2] if fontint == 0 then font = "default" end if fontint == 1 then font = "clear" end if fontint == 2 then font = "default-bold" end if fontint == 3 then font = "arial" end fontheight = dxGetFontHeight(chatboxscale,font) local width = (dxGetTextWidth(text,chatboxscale,font)+chatxoffset)*scaleX return width end local screenWidth, screenHeight = guiGetScreenSize ( ) chatxoffset = screenWidth * 0.0145 chatyoffset = screenHeight * 0.0145 function createText ( ) for index,item in ipairs(emotes) do local line = item[3] local width = item[2] local height = (chatyoffset + (line-1)*fontheight)*scaleY if (item[3]<1) then table.remove(emotes,index) else dxDrawImage(width,height,20,20,"a.png",0,0,0,tocolor(255,255,255,255),true) end end end function emotesOnOff() if emotesVisible then removeEventHandler ( "onClientRender", root, createText ) emotesVisible = false else addEventHandler ( "onClientRender", root, createText ) emotesVisible = true end end function HandleTheRendering ( ) addEventHandler ( "onClientRender", root, createText ) emotesVisible = true addCommandHandler ("emotes", emotesOnOff ) end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) function onClientChatMessageHandler(text) local width = getImageOffsets(text) local chatwidth = getChatboxLayout()["chat_width"]*317*scaleX local multiplier = math.floor(width/chatwidth)+1 for index,item in ipairs(emotes) do if item[4] then item[3] = item[3]-1*multiplier end item[4] = true end end addEventHandler("onClientChatMessage", getRootElement(), onClientChatMessageHandler) Server: emotes = { {"a","-23"} } function playerChat(text, messageType) if (messageType ~= 0) then return end local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "tesztr" ) ) then local originalText = removeColorCodes(getPlayerName(source)) for index,item in ipairs(emotes) do text,item[3] = string.gsub(originalText,item[1],item[2]) end for index,item in ipairs(emotes) do triggerClientEvent("triggerChat",source,"[HU]"..originalText,item[1],item[2]) end for index,item in ipairs(emotes) do originalText,item[3] = string.gsub(originalText,item[1]," ") end end end addEventHandler("onPlayerChat", root, playerChat) function removeColorCodes(str) return (string.gsub(str, "#[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]", "")) end
  7. function dardinheiro ( player ) bool addCommandHandler ( string gerarkey, function dardinheiro [, bool restricted = false, bool caseSensitive = true ] )
  8. A simple script of dressable characters and deformable faces. You can move every vertex of the head with a simple displacement shader. The script is in test state right now, I'll create a new editor later. Hope you like it.
  9. I want attach images to my message in default mta chat with a word, but i dont know how to attach the image to the message.. Anyone can help, and show me a example?
  10. Actualmente necesito un scripter para un servidor freeroam de Anime, es un servidor con potencial pero necesita ser desarrollado...
  11. é um script de trabalho como painel tô tentando criar Sou novato no script lua não sei o que tá dando erro não posso dar muitas informações sobre isso porque sou muito Novato não vou mentir igual várias script fazem o programa não é meu Claro que eu tô criando ele do zero mas eu estou vendo um vídeo para fazer tentei arrumar olhando por dentro do jogo usando comando debugscript 3 mas não compreende o problema porque sou muito novato Como disse aí no começo vou postar a foto do problema e o script se puder me ajudar agradeço essa imagem do erro --- Esse é o script c.lua function CreateJob() StartMarker = createMarker ( 2126, -1788, 12.5, "cylinder", 1.5, 240, 140, 0, 255) end addEventHandler("onClientResourceStart", resourceRoot, CreateJob) function showListTojob(player, dim) if player and isElement(player) and getElementType(player) == "player" and dim then ShowPainelPizza() local x, y, z = getElementPosion(localPlayer) if getZoneName(x, y, z, true) == "Los Santos" then DefineItens("LS") elseif getZoneName(x, y, z, true) == "Los Venturas" then DefineItens("LV") elseif getZoneName(x, y, z, true) == "Los Fierro" then DefineItens("SF") end end end addEventHandler("onClientMarkerHit", resourceRoot, showListTojob) --- e esse daqui é o Gui.lua Win = guiCreateWindow(0.26, 0.28, 0.50, 0.48, "Seleção De Entrega São Paulo RP", true) guiWindowSetMovable(Win, false) guiWindowSetSizable(Win, false) guiSetAlpha(Win, 1.00) guiSetProperty(Win, "CaptionColour", "FF0000CC") guiSetVisible(Win, false) List = guiCreateGridList(0.01, 0.06, 0.97, 0.75, true, Win) guiGridListAddColumn(List, "ID", 0.07) guiGridListAddColumn(List, "Local", 0.5) guiGridListAddColumn(List, "Valor", 0.08) guiGridListAddColumn(List, "Horario", 0.3) Bt_Start = guiCreateButton(102, 310, 172, 46, "Aceitar", false, Win) guiSetFont(Bt_Start, "default-bold-small") guiSetProperty(Bt_Start, "NormalTextColour", "FF0026CA") Bt_Exit = guiCreateButton(411, 310, 172, 46, "Cancelar", false, Win) guiSetFont(Bt_Exit, "default-bold-small") guiSetProperty(Bt_Exit, "NormalTextColour", "FFCB0000") function ShowPainelPizza() guiSetVisible(Win, not guiGetVisible(Win)) showCursor(guiGetVisible(Win)) end function Click() if source == Bt_Exit then ShowPainelPizza() end end addEventHandler("onClientGUIClick", resourceRoot, Click) List_Itens = ( ["LS"] = ( [1] = ("Entrega 1", 200, 2000.146484375,-1115.544921875,27.131803512573 -1), [2] = ("Entrega 2", 100, 2244.3115234375,-1054.7958984375,52.569305419922 -1), [3] = ("Entrega 3", 200, 1803.6416015625,-1577.3876953125,13.421177864075), [4] = ("Entrega 4", 500, 552.7138671875,-1200.0556640625,44.831535339355), [5] = ("Entrega 5", 1000, 836.3583984375,-893.6337890625,68.768898010254), [6] = ("Entrega 6", 109, 2695.7744140625,-1992.921875,13.5546875), [7] = ("Entrega 7", 104, 2464.9248046875,-1997.7392578125,13.68886089325), [8] = ("Entrega 8", 50, 1849.619140625,-1922.72265625,13.546875), [9] = ("Entrega 9", 120, 1761.1123046875,-2124.44921875,14.056648254395), [10] = ("Entrega 10", 130, 1667.6533203125,-2107.9189453125,14.072273254395), [11] = ("Entrega 11", 550, 693.9052734375,-1705.87890625,3.8194825649261), [12] = ("Entrega 12", 600, 694.88671875,-1645.861328125,4.09375), ), ["LV"] = ( [1] = ("", ) [2] = ("", ) [3] = ("", ) [4] = ("", ) [5] = ("", ) [6] = ("", ) [7] = ("", ) [8] = ("", ) [9] = ("", ) [10] = ("", ) [11] = ("", ) [12] = ("", ) ), ["SF"] = ( [1] = ("", ) [2] = ("", ) [3] = ("", ) [4] = ("", ) [5] = ("", ) [6] = ("", ) [7] = ("", ) [8] = ("", ) [9] = ("", ) [10] = ("", ) [11] = ("", ) [12] = ("", ) ), ) function DefineItens(tipe) guiGridListClear(List) for i=1,12 do row = guiGriListAddRow(List) guiGridListSetItemText(List, row, 1, i, false, true) guiGridListSetItemText(List, row, 2, List_Itens(tipe)[i][1], false, false) guiGridListSetItemText(List, row, 3, List_Itens(tipe)[i][2].." $", false, false) end end
  12. Hello, I have a problem with the script, when I add id rhino and id fire truck this script does not work tankdx = 2 tankdy = 4 tankdz = 2 function boomOn () booming = true --outputDebugString("Boomon!") end function start () maxDamage = get("maxTankDamage") eightDistance = get("eightTankDistance") --outputDebugString("tankdamage settings: maxTankDamage = "..tostring(maxDamage).." - eightTankDistance = "..tostring(eightDistance)) boomOn() end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),start) function boom (x,y,z,boomType) --outputDebugString("boom type "..tostring(boomType)) if booming then booming = false boomTimer = setTimer(boomOn,1000,1) --outputDebugString("location: " .. tostring(x) .. "," .. tostring(y) .. "," .. tostring(z)) local rhinos = getVehiclesOfType(432 ) --outputDebugString(tostring(#rhinos).." rhinos found") for i,vehicle in ipairs (rhinos) do if getElementModel(vehicle) == 432 then local vx, vy, vz = getElementPosition(vehicle) local sx = x - vx local sy = y - vy local sz = z - vz --outputDebugString("distance to rhino: " .. tostring(sx) .. "," .. tostring(sy) .. "," .. tostring(sz)) if sx^2 + sy^2 + sz^2 < 1000 then local rotvX,rotvY,rotvZ = getVehicleRotation(vehicle) local t = math.rad(rotvX) local p = math.rad(rotvY) local f = math.rad(rotvZ) local ct = math.cos(t) local st = math.sin(t) local cp = math.cos(p) local sp = math.sin(p) local cf = math.cos(f) local sf = math.sin(f) local dz = ct*cp*sz + (sf*st*cp + cf*sp)*sx + (-cf*st*cp + sf*sp)*sy local dx = -ct*sp*sz + (-sf*st*sp + cf*cp)*sx + (cf*st*sp + sf*cp)*sy local dy = st*sz - sf*ct*sx + cf*ct*sy local damage if math.abs(dx) < tankdx and math.abs(dy) < tankdy and math.abs(dz) < tankdz then damage = maxDamage else dx = math.abs(dx) -tankdx dy = math.abs(dy) -tankdy dz = math.abs(dz) -tankdz if dx < 0 then dx=0 end if dy < 0 then dy=0 end if dz < 0 then dz=0 end local distance = math.sqrt(dx^2+dy^2+dz^2) if distance > 10 then damage = 0 elseif distance < 1 then damage = maxDamage else damage = maxDamage*((distance/eightDistance)+1)^(-3) end --outputDebugString("explosion distance: ".. tostring(distance)) end setElementHealth(vehicle,getElementHealth(vehicle)-damage) -- outputDebugString("tank damaged " .. tostring(damage)) end end end end end function boom (x,y,z,boomType) triggerServerEvent("onBoom",getLocalPlayer(),x,y,z,boomType) end addEventHandler("onClientExplosion",getRootElement(),boom) <meta> <info author="Killeryoyo" name="tankdamage" version="0.2.2" type="script"/> <script src="tankdamage.lua" type="server" /> <script src="tankdamageCL.lua" type="client" /> <settings> <setting name="*maxTankDamage" value="250"/> <setting name="*eightTankDistance" value="20"/> </settings> </meta>
  13. Hello everyone, guys please help me, I need a script that will protect custom machines, maps, write in a personal, or here in the topic, thank you all in advance
  14. Can someone help me? what script used in this lock on fire hydra missiles
  15. Hello, I need a marker timer script which starts a timer on screen for that player who hit marker X and stopped when that player hit marker Y. And when that player hits marker X again without hitting marker Y, it restarts/reset timer again. Help me pls.
  16. Hi, I'm in need of help. I'm trying to show the player's life on the screen, however getElementhealth returns me a number like this "96.657466574" Can I convert it to integer? type: Life: 96 Sorry for my english, I'm using the translator. local Vida = getElementHealth ( localPlayer ) or 0 dxDrawText("Vida: "..Vida, x*932, y*62, x*1072, y*87, tocolor(255, 255, 255, 255), x*1.00, "default", "center", "center", false, false, false, false, false)
  17. Estou começando a programar, então resolvi criar um script besta mas nem assim funcionou. marker = createMarker(2101.368, -1801.239, 12.5, "cylinder", 1, 0, 255, 0, 200 ) function startJob() carro = createVehicle(448, 2097.831, -1801.282, 13.383) end addEventHandler("onPlayerMarkerHit", marker, startJob) Testei trocar o OnPlayerMarkerHit por onMarkerHit e também não funcionou. Script é do servidor e no meta eu coloquei type="server" Estou assistindo um vídeo aqui e o cara fez EXATAMENTE assim, porém aqui não funciona
  18. local drawDistance = 15 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 do 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 local ID = getPlayerID(player) local w = dxGetTextWidth(ID, 0.1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawText("#ffffff"..ID.."", x - 1 - w / 1, y - 1 - h - 12, w, h, tocolor(0, 0, 0), 1.20, "default-bold", "left", "top", false, false, false, true, false) end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", root, onClientRender) 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(startedResource) visibleTick = getTickCount() counter = 0 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) function getPlayerFromID(ID) return call(getResourceFromName("ID_System"), "getPlayerFromID", tonumber(ID)) end function getPlayerID(player) return getElementData(player,"ID") end Preciso muito de ajuda, irei abrir um servidor de Role-Play e fiz esse script de id, mas gostaria de saber se alguem poderia me ajudar, a duvida seria como deixar o id fixo, tipo quando alguem sair do servidor com exemplo ID 1, quando ela voltar esteja com o mesmo id. Alguem me ajuda?
  19. Essse mod esta bugado os minutos de vida restante, quando um player atira em outra pessoa ela cai e fica os minutos de vida restante na tela enquanto o samu nao chega, e 3 minutos de espera mais quando chega ums 2 minutos porai o personagem morre, o bug esta nos minutos podem me ajudar? --[[ ################################################ # # # SAMU # # # # # # # ################################################ ]] local screenW, screenH = guiGetScreenSize() local resW, resH = 1360,768 local x, y = (screenW/resW), (screenH/resH) local screenWidth, screenHeight = guiGetScreenSize() local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight) local flickerStrength = 0 local dxfont0_fonte = dxCreateFont("font/fonte.ttf", 13) addEventHandler("onClientKey", root, function (button, press) if getElementData(getLocalPlayer(),"playerFallen") then if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "b" or button == "F9" or button == "F10" or button == "F11" or button == "F12" then cancelEvent() end end end ) function blockDead() if getElementHealth(localPlayer) <= 20 then if not getElementData(localPlayer, "jobSAMU") then if not getElementData(localPlayer, "playerFallen") then cancelEvent() end end end end addEventHandler("onClientPlayerDamage", localPlayer, blockDead) function text() for _, player in ipairs(getElementsByType('player')) do if isElementOnScreen(player) and getElementData(player, "playerFallen") then local x, y, z = getElementPosition(player) local cx, cy, cz = getCameraMatrix() local vx, vy, vz = getPedBonePosition(player, local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) local drawDistance = 30.0 if (dist < drawDistance or player == target) then if(isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false)) then local x, y = getScreenFromWorldPosition (vx, vy, vz + 0.6) if(x and y) then local px, py = getScreenFromWorldPosition (vx, vy, vz + 0.3) local w = dxGetTextWidth("PRECISANDO DE CURA!", 1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawImage(x -6 - w / 2,y - 15 - h - 12, w + 25, h + 115, 'images/hp.png', 0, 0, 0, tocolor(255, 0, 0, math.abs(math.sin(getTickCount()/170))*200)) --dxDrawRectangle(x -6 - w / 2,y - 15 - h - 12, w + 9, h, tocolor(0, 0, 0, 194), false) --dxDrawText("#FFFFFFPRECISANDO DE #FF0000CURA#FFFFFF!", x - 0 - w / 2,y - 15 - h - 12, w, h, tocolor(255,0,0, math.abs(math.sin(getTickCount()/170))*200), 1, "default-bold", "left", "top", false, false, false, true, false) end end end end end end addEventHandler("onClientRender", root, text) function convertTime(ms) local min = math.floor ( ms/60000 ) local sec = math.floor( (ms/1000)%60 ) return min, sec end function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function contador() local timer = interpolateBetween(deadTime, 0, 0, 0, 0, 0, (getTickCount()-tick)/deadTime, "Linear") local minutes, seconds = convertTime(timer) dxDrawText("Tempo de vida restante: "..minutes..":"..seconds, (screenW * 0.3801) + 1, (screenH * 0.9089) + 1, (screenW * 0.7059) + 1, (screenH * 1.0299) + 1, tocolor(0, 0, 0, 132), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawText("Tempo de vida restante: #FF0000"..minutes.."#FFFFFF:#FF0000"..seconds, screenW * 0.3801, screenH * 0.9089, screenW * 0.7059, screenH * 1.0299, tocolor(255, 255, 255, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) end function createShader() oldFilmShader, oldFilmTec = dxCreateShader("shaders/old_film.fx") end function updateShader() upDateScreenSource() if (oldFilmShader) then local flickering = math.random(100 - flickerStrength, 100)/100 dxSetShaderValue(oldFilmShader, "ScreenSource", myScreenSource); dxSetShaderValue(oldFilmShader, "Flickering", flickering); dxDrawImage(0, 0, screenWidth, screenHeight, oldFilmShader) end end function upDateScreenSource() dxUpdateScreenSource(myScreenSource) end function render() if not isEventHandlerAdded("onClientRender", root, contador) then tick = getTickCount() createShader() addEventHandler("onClientRender", root, contador) addEventHandler("onClientPreRender", root, updateShader) end end addEvent("startDeadTime", true) addEventHandler("startDeadTime", root, render) function remove() if isEventHandlerAdded("onClientRender", root, contador) then removeEventHandler("onClientRender", root, contador) removeEventHandler("onClientPreRender", root, updateShader) end end addEvent("stopDeadTime", true) addEventHandler("stopDeadTime", root, remove)
  20. --[[ ################################################ # # # SCRIPT PRODUZIDO POR # # Anderson # # # # # ################################################ ]] local screenW, screenH = guiGetScreenSize() local resW, resH = 1360,768 local x, y = (screenW/resW), (screenH/resH) local screenWidth, screenHeight = guiGetScreenSize() local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight) local flickerStrength = 0 local dxfont0_fonte = dxCreateFont("font/fonte.ttf", 13) addEventHandler("onClientKey", root, function (button, press) if getElementData(getLocalPlayer(),"playerFallen") then if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "b" or button == "F9" or button == "F10" or button == "F11" or button == "F12" then cancelEvent() end end end ) function blockDead() if getElementHealth(localPlayer) <= 20 then if not getElementData(localPlayer, "jobSAMU") then if not getElementData(localPlayer, "playerFallen") then cancelEvent() end end end end addEventHandler("onClientPlayerDamage", localPlayer, blockDead) function text() for _, player in ipairs(getElementsByType('player')) do if isElementOnScreen(player) and getElementData(player, "playerFallen") then local x, y, z = getElementPosition(player) local cx, cy, cz = getCameraMatrix() local vx, vy, vz = getPedBonePosition(player, local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) local drawDistance = 30.0 if (dist < drawDistance or player == target) then if(isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false)) then local x, y = getScreenFromWorldPosition (vx, vy, vz + 0.6) if(x and y) then local px, py = getScreenFromWorldPosition (vx, vy, vz + 0.3) local w = dxGetTextWidth("PRECISANDO DE CURA!", 1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawImage(x -6 - w / 2,y - 15 - h - 12, w + 25, h + 115, 'images/hp.png', 0, 0, 0, tocolor(255, 0, 0, math.abs(math.sin(getTickCount()/170))*200)) --dxDrawRectangle(x -6 - w / 2,y - 15 - h - 12, w + 9, h, tocolor(0, 0, 0, 194), false) --dxDrawText("#FFFFFFPRECISANDO DE #FF0000CURA#FFFFFF!", x - 0 - w / 2,y - 15 - h - 12, w, h, tocolor(255,0,0, math.abs(math.sin(getTickCount()/170))*200), 1, "default-bold", "left", "top", false, false, false, true, false) end end end end end end addEventHandler("onClientRender", root, text) function convertTime(ms) local min = math.floor ( ms/60000 ) local sec = math.floor( (ms/1000)%60 ) return min, sec end function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function contador() local timer = interpolateBetween(deadTime, 0, 0, 0, 0, 0, (getTickCount()-tick)/deadTime, "Linear") local minutes, seconds = convertTime(timer) dxDrawText("Tempo de vida restante: "..minutes..":"..seconds, (screenW * 0.3801) + 1, (screenH * 0.9089) + 1, (screenW * 0.7059) + 1, (screenH * 1.0299) + 1, tocolor(0, 0, 0, 132), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawText("Tempo de vida restante: #FF0000"..minutes.."#FFFFFF:#FF0000"..seconds, screenW * 0.3801, screenH * 0.9089, screenW * 0.7059, screenH * 1.0299, tocolor(255, 255, 255, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) end function createShader() oldFilmShader, oldFilmTec = dxCreateShader("shaders/old_film.fx") end function updateShader() upDateScreenSource() if (oldFilmShader) then local flickering = math.random(100 - flickerStrength, 100)/100 dxSetShaderValue(oldFilmShader, "ScreenSource", myScreenSource); dxSetShaderValue(oldFilmShader, "Flickering", flickering); dxDrawImage(0, 0, screenWidth, screenHeight, oldFilmShader) end end function upDateScreenSource() dxUpdateScreenSource(myScreenSource) end function render() if not isEventHandlerAdded("onClientRender", root, contador) then tick = getTickCount() createShader() addEventHandler("onClientRender", root, contador) addEventHandler("onClientPreRender", root, updateShader) end end addEvent("startDeadTime", true) addEventHandler("startDeadTime", root, render) function remove() if isEventHandlerAdded("onClientRender", root, contador) then removeEventHandler("onClientRender", root, contador) removeEventHandler("onClientPreRender", root, updateShader) end end addEvent("stopDeadTime", true) addEventHandler("stopDeadTime", root, remove)
  21. Boa Noite, Preciso de uma ajuda no sistema de expulsar o jogador selecionado do Base (COL) so que to com problema nisso e precisava de uma ajuda segue a baixo o sistema OBS: EU PEGUEI ESSA ULTIMA FUNÇÃO DO SERVER.LUA COMO EXEMPLO DA OUTRA QUE TEM QUANDO KIKA TODOS OS JOGADORES DA BASE (COL), AI QUERO FAZER PARA O JOGADOR SELECIONADO. --- Client.lua ---------------------------------------------------------------- --- PAINEL BasePaneltab1 = guiCreateTab("Jogadores", BasePaneltabpanel) BasePanelGridliste2 = guiCreateGridList(40, 15, 490, 200, false, BasePaneltab1) BasePanelColumn2 = guiGridListAddColumn(BasePanelGridliste2, "Jogador:", 0.9) KikarPlayerBase = guiCreateButton(40, 230, 250, 50,"Kikar Jogador\nSelecionado",false,BasePaneltab1) ClearBase = guiCreateButton(310, 230, 220, 50,"Expulsar todos da Base",false,BasePaneltab1) ---------------------------------------------------- -- Quando clica na Grilist addEventHandler("onClientGUIClick",BasePanelGridliste2,function(thePlayers) playerName = guiGridListGetItemText ( BasePanelGridliste2, guiGridListGetSelectedItem ( BasePanelGridliste2 ), BasePanelColumn2 ) outputChatBox(playerName) if playerName ~= "" then triggerServerEvent("KikaJorgadorBase",getLocalPlayer(),playerName) end elseif source == BaseManangerButton then triggerServerEvent("KikaJorgadorBase",getLocalPlayer()) triggerServerEvent("refreshGatess",getLocalPlayer()) guiSetEnabled(ClearBase,false) guiSetVisible(BaseManagementGUI2,false) triggerServerEvent("refreshPlayerss",getLocalPlayer()) setTimer(function() guiSetEnabled(ClearBase,true) end,10000,1) end) ------------------------------------------------------ --- RECEBE DO SERVER.LUA OS JOGADORES addEvent("refreshPlayers11",true) addEventHandler("refreshPlayers11",getRootElement(),function(thePlayers) row1s,column1s = guiGridListGetSelectedItem(BasePanelGridliste2) guiGridListClear(BasePanelGridliste2) for i, thePlar in ipairs(thePlayers) do local Players = guiGridListAddRow(BasePanelGridliste2) guiGridListSetItemText(BasePanelGridliste2,Players,BasePanelColumn2,tostring(thePlar[1]),false,false) outputChatBox("Jogador "..tostring(thePlar[1]),255,0,0,true) end if row1s and column1s then guiGridListSetSelectedItem(BasePanelGridliste2,row1s,column1s) end end) -- Server.lua -------------------------------------------------------------------- --- RECONHECE OS JOGADORES QUE ESTA NA BASE! addEvent("refreshPlayerss",true) addEventHandler("refreshPlayerss",getRootElement(), function() local thePlayers = {} local ownerAccount = getAccountName(getPlayerAccount(source)) local baseName = getBaseNameFromOwnerAccount(ownerAccount) local colshape = getBaseColshape(baseName) if colshape and isElement(colshape) then local players = getElementsWithinColShape(colshape,"player") for i, player in pairs(players) do local nameCheck = getPlayerName(player) local PlayerP = removeHexCheck(nameCheck, 6) table.insert(thePlayers,{PlayerP}) end end triggerClientEvent(source,"refreshPlayers11",source,thePlayers) end) --------------------------------------------------------------------- --- PARA KIKAR O JOGADOR DA COL VINDO DA GRILIST --OBS: EU PEGUEI ESSA FUNÇÃO COMO EXEMPLO DA OUTRA QUE TEM QUANDO KIKA TODOS OS JOGADORES DA BASE (COL), AI QUERO FAZER PARA O JOGADOR SELECIONADO addEvent("KikaJorgadorBase",true) addEventHandler("KikaJorgadorBase",getRootElement(),function(playerName,player) outputChatBox("TRUE"..playerName,player) local ownerAccount = getAccountName(getPlayerAccount(source)) local baseName = getBaseNameFromOwnerAccount(ownerAccount) local colshape = getBaseColshape(baseName) tpx,tpy,tpz = getElementData(colshape,"tpLoc1"),getElementData(colshape,"tpLoc2"),getElementData(colshape,"tpLoc3") if isElement(colshape) then for i,element in pairs(getElementsWithinColShape(colshape))do if getElementType(element) == "vehicle" then for i,player in pairs(getVehicleOccupants(element))do if playerName ~= player then removePedFromVehicle(player) setVehicleEngineState(element,false) setElementPosition(player,tpx,tpy,tpz) end end elseif getElementType(element) == "player" then if playerName ~= player then setElementPosition(element,tpx,tpy,tpz) end end end alert("Base limpa!",source) else alert("Colshape not added. Please tell the Admin!",source) end end) OBS: EU PEGUEI ESSA ULTIMA FUNÇÃO DO SERVER.LUA COMO EXEMPLO DA OUTRA QUE TEM QUANDO KIKA TODOS OS JOGADORES DA BASE (COL), AI QUERO FAZER PARA O JOGADOR SELECIONADO
  22. Então, eu edito alguns mapas, só que, dessa vez eu apaguei uma construção do próprio gta, e fiz uma base.. Só que, quando me distancio ela some e quando chego bem perto ela aparece. Tem alguma forma de corrigir isso? ou nem. Print a seguir: https://imgur.com/a/7wkGF3z
  23. Bom Dia, Pessoal to com problema num script precisava de uma ajuda, o sistema é quando o jogador pega a arma na mão ela reconhece a função que ela vai fazer e se nao tiver na mão ela nao executa a função. function changeFiringMode () local weapon = getPedWeapon( getLocalPlayer()) --outputChatBox("PLAYER: "..weapon) if weapon == 31 then nameweapon = "AKS-74 Kobra" or "M4A1 CCO" setElementData ( getLocalPlayer(), "userArma", nameweapon ) end if (getElementData(getLocalPlayer(),"userArma") == nameweapon) then if getElementData ( getLocalPlayer(), "usingGrenadeThrower" ) then setElementData ( getLocalPlayer(), "usingGrenadeThrower", false ) unbindKey ( "mouse1", "down", throwGrenade ) toggleControl ( "fire", true ) playSound ("sounds/itm_grenade_up.wav") else local weapon2 = getElementData ( getLocalPlayer(), "selectedWeapon") or "no" if weapon2 and grenadesConfig[weapon2] and ( getElementData ( getLocalPlayer(), grenadesConfig[weapon2].grenadeName ) or 0 ) > 0 then setElementData ( getLocalPlayer(), "usingGrenadeThrower", weapon2 ) bindKey ( "mouse1", "down", throwGrenade ) toggleControl ( "fire", false ) playSound ("sounds/itm_grenade_up.wav") else triggerEvent ("displayClientInfo", getLocalPlayer(),"Inventory","*Você precisa de granada!",255,22,0) end end end end Tentei usar essas função aqui mas não foi como pensei. local weapon = getPedWeapon( getLocalPlayer()) --outputChatBox("PLAYER: "..weapon) if weapon == 31 then nameweapon = "AKS-74 Kobra" or "M4A1 CCO" setElementData ( getLocalPlayer(), "userArma", nameweapon ) end if (getElementData(getLocalPlayer(),"userArma") == nameweapon) then
  24. Привет, мне нужна помощь. Я хочу сделать паспортную систему, мне нужен номер паспорта, который будет случайным
  25. Galera Montei esse script com ajuda de alguns parceiros. Ele cria um Carro privado pela ACL porém gostaria que quando o jogador se deligar do server o veiculo se destruísse. alguém pode me ajudar??? O script esta funcionando perfeitamente, só preciso deste detalhe de destruir quando o jogador se desligar. veh = {} vehCol = {} function veiculodayz (thePlayer) local accountname = getAccountName (getPlayerAccount (thePlayer)) -- accountname recebe o nome da conta do jogador que usou o comando. if isObjectInACLGroup ("user."..accountname, aclGetGroup ("Admin")) then -- Se o nome da conta estiver na ACL Group Admin, então: local x, y, z = getElementPosition (thePlayer) -- x, y, z recebem a posição do jogador que usou o comando. if isElement (veh[thePlayer]) then -- Se já existe o veh[thePlayer] criado, então: spawnVehicle (veh[thePlayer], x+3, y, z) -- Spawna ele perto do jogador, sem criar outro. setElementData (vehCol[thePlayer], "parent", veh[thePlayer]) -- Reseta as datas do colider. setElementData (veh[thePlayer], "parent", vehCol[thePlayer]) setElementData (vehCol[thePlayer], "vehicle", true) setElementData (vehCol[thePlayer], "Tire_inVehicle", 4) setElementData (vehCol[thePlayer], "Engine_inVehicle", 1) setElementData (vehCol[thePlayer], "Parts_inVehicle", 1) setElementData (vehCol[thePlayer], "fuel", 100) else -- Se não existe um veh[thePlayer] criado, então: veh[thePlayer] = createVehicle (411, x+3, y, z) -- Cria o veh[thePlayer]. setVehicleColor (veh[thePlayer], 255, 255, 255) -- escolhe a cor do veiculo if isElement (vehCol[thePlayer]) then -- Se já existe o colider (veículo foi deletado e o colider ficou lá), então: attachElements (vehCol[thePlayer], veh[thePlayer], 0, 0, 0) -- Anexa o colider novamente ao veh[thePlayer]. else -- Se não existe colider nenhum, então: vehCol[thePlayer] = createColSphere (x, y, z, 2.5) -- Cria o colider. attachElements (vehCol[thePlayer], veh[thePlayer], 0, 0, 0) -- Anexa ele ao veh[thePlayer]. setElementData (vehCol[thePlayer], "parent", veh[thePlayer]) -- Seta as datas no veh[thePlayer] e no colider. setElementData (veh[thePlayer], "parent", vehCol[thePlayer]) setElementData (vehCol[thePlayer], "vehicle", true) setElementData (vehCol[thePlayer], "Tire_inVehicle", 4) setElementData (vehCol[thePlayer], "Engine_inVehicle", 1) setElementData (vehCol[thePlayer], "Parts_inVehicle", 1) setElementData (vehCol[thePlayer], "fuel", 100) end end end end addCommandHandler ("carro", veiculodayz)