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
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • community.mtasa.com
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash
  • 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


Gang


Location


Occupation


Interests

Found 483 results

  1. Thisdp's DirectX Graphical User Interface System ( MTASA 2D+3D DxLIB ) This dxlib provide dx gui functions and events to make it easier to use and alternative to change the style more flexibly. Warning: Old function name like dgsDxGUI*/dgsDx* are no longer supported after 3.4, please change your functions and events name 'dgsDxGUI*'/'dgsDx*' have been changed to 'dgs*' Current Version: 3.37 Final Version: 3.99 Features: 1. Update Check(DGS will notice you if there is a higher version, and you can choose to ignore it or disable it in the config file) Update Command: "updatedgs" 2. Dx GUI Types: Window Edit Box Button Grid List Image Scroll Bar Scroll Pane Text Label Tab Panel Ellipse Detect Area (EDA) Detect Area Radio Button Combo Box Check Box Memo 3D Interface Media Browser Browser 3. Edit Selection Fixed 4. dgs-dxeda is used to check whether your mouse is in the target ellipse area. 5. Debug Mode , Command: "debugdgs" 6. You can apply shader to the dxgui 7. Include CMD, Command: "cmd" ( For more help, please input "help" in the CMD ) 8. Memo rewritten. 9. OOP Class Notice:Do not close your server or stop the script when it is updating. Wiki: https://wiki.multitheftauto.com/wiki/Dgs ( Still Working In Process ) Auto Completion For N++ (Thanks To Ahmed Ly): http://www.mediafire.com/file/m6dm7815d5dihax/lua.zip Discord Server: https://discord.gg/QEs8q6W Download DGS : https://github.com/thisdp/dgs Notice: Need acl rights to call fetchRemote. To Contact Me , Skype: thisdpzjl My server is based on DGS , if you want to see the exact effect of dgs ( not best, my design is bad ). Please have a look. IP: angel.mtaip.cn:10010 If you want to sell your script which involves DGS, please exclude DGS from your price. HurtWorld Backpack Panel(Example) DGS Network Monitor(Built-in)
  2. ERROR404

    [Sell]Quest Diamonds

    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 !
  3. 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.)
  4. 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?
  5. Ciastuuś

    [RELEASE] SNOW PROJECT

    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:
  6. Andres99907

    My code doesn't work :(

    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
  7. Tokio

    [HELP] How to fix this bug?

    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
  8. biscoitoimproprio

    Ajuda em um script de gerar key

    function dardinheiro ( player ) bool addCommandHandler ( string gerarkey, function dardinheiro [, bool restricted = false, bool caseSensitive = true ] )
  9. I was looking for a script that could run videos on my server on some screen, I found this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11851 However, since I wanted to take the video to another place, I used the modifications that my friend suggested here: https://forum.mtasa.com/topic/81334-cinema-problem-xyz/?tab=comments#comment-744381 But on my server nothing worked, it keeps playing music but the video does not appear on Drive-in. I was wondering how to put the command to open the video panel just for admin. Here is the script: local cWindow = guiCreateWindow(337, 177, 816, 762, "CINEMA", false) local browser = guiCreateBrowser(0, 0, 800, 600, false, false, false, cWindow) local theBrowser = guiGetBrowser(browser) addEventHandler("onClientBrowserCreated", theBrowser, function() loadBrowserURL(source, "http://www.youtube.com") end ) CINEMA = { button = {}, window = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() guiWindowSetSizable(cWindow, false) guiSetProperty(cWindow, "CaptionColour", "FF0309FB") guiSetVisible(cWindow,false) CINEMA.button[1] = guiCreateButton(9, 608, 388, 35, "GET URL", false, cWindow) guiSetFont(CINEMA.button[1], "default-bold-small") guiSetProperty(CINEMA.button[1], "NormalTextColour", "FFFF0000") CINEMA.button[2] = guiCreateButton(427, 608, 381, 35, "PUT VIDEO IN CINEMA", false, cWindow) guiSetFont(CINEMA.button[2], "default-bold-small") guiSetProperty(CINEMA.button[2], "NormalTextColour", "FFFF0000") CINEMA.button[3] = guiCreateButton(10, 653, 388, 35, "CLOSE", false, cWindow) guiSetFont(CINEMA.button[3], "default-bold-small") guiSetProperty(CINEMA.button[3], "NormalTextColour", "FFFF0000") CINEMA.button[4] = guiCreateButton(425, 654, 383, 34, "VIEW VIDEO IN FULL SCREEN MODE", false, cWindow) guiSetFont(CINEMA.button[4], "default-bold-small") guiSetProperty(CINEMA.button[4], "NormalTextColour", "FFFF0000") CINEMA.edit[1] = guiCreateEdit(11, 700, 796, 52, "", false, cWindow) guiEditSetReadOnly(CINEMA.edit[1], true) end ) function geturl() if source == CINEMA.button[1] then guiSetText(CINEMA.edit[1],getBrowserURL(theBrowser)) end end addEventHandler("onClientGUIClick",root,geturl) function dxDrawImage3D(x,y,z,w,h,m,c,r,...) local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, m, h, c , ...) end local screenWidth, screenHeight = guiGetScreenSize() local webBrowser = createBrowser(screenWidth, screenHeight, false, false) function getPositionFromElementOffset(element, offX, offY, offZ) local m = getElementMatrix(element) local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z end function webBrowserRender() -- This will fetch the top middle point of the drive-in screen (Remember to replace the INSERTSCREENELEMENTHERE variable with your object pointer) local screenPosX, screenPosY, screenPosZ = getPositionFromElementOffset(INSERTSCREENELEMENTHERE, 0, 0.04, 10.6) dxDrawMaterialLine3D(screenPosX, screenPosY, screenPosZ, screenPosX, screenPosY, screenPosZ-8.5, webBrowser, 18, tocolor(255, 255, 255, 255), screenPosX, screenPosY+1, screenPosZ) end function fullscreen() local URLs = string.sub(guiGetText(CINEMA.edit[1]),"33") if source == CINEMA.button[4] then loadBrowserURL(webBrowser, "https://www.youtube.com/embed/"..URLs.."?autoplay=1&iv_load_policy=3&enablejsapi=1&fs=0&theme=light") end end addEventHandler("onClientGUIClick",root,fullscreen) function brow() if source == CINEMA.button[2] then loadBrowserURL(webBrowser, guiGetText(CINEMA.edit[1])) addEventHandler("onClientPreRender", root, webBrowserRender) end end addEventHandler("onClientBrowserCreated", webBrowser, brow) addEventHandler("onClientGUIClick",root,brow) function url() guiSetVisible(cWindow,true) showCursor( true ) guiSetInputEnabled( true ) end addCommandHandler("cinema",url) function closeman() if source == CINEMA.button[3] then guiSetVisible(cWindow,false) showCursor( false ) guiSetInputEnabled( false ) end end addEventHandler("onClientGUIClick",root,closeman) UP
  10. 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.
  11. 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?
  12. Actualmente necesito un scripter para un servidor freeroam de Anime, es un servidor con potencial pero necesita ser desarrollado...
  13. é 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
  14. Hansu42

    [Help] Tankdamage script

    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>
  15. Marek [HUN]

    [Segítség] Buszsofőr munka

    Sziasztok! Először is elmondanám azt, hogy nem vagyok profi scripter, sőt, egészen kis mértékben értek ehhez a dologhoz, viszont szeretném megcsinálni ezt a scriptet, hogy tudjak belőle tanulni, viszont problémába ütköztem, és nem tudom, hogy mi miatt van. A script itt van: Szerver oldal, Kliens oldal. Hozzá kell tennem, hogy még egyáltalán nincsen kész, viszont ahhoz, hogy be tudjam fejezni, ezt a problémát is meg kéne oldanom valahogy. A probléma az volna, hogy amikor belesétálok a markerbe, akkor megkapom a buszt, majd elindulok, ha odaérek az első megállóba, és befejeződik a folyamat, akkor azt szeretném elérni, hogy egyből dobja be a következő megálló 'CP'-jét, viszont ez nem történik meg. Esetleg valaki tudja, hogy miért lehet ez? A választ előre is köszönöm. A munka alapja nem általam készült, hanem Worthless Cynomys által, így ez csak egy úgymond 'editelt' változat, melybe én nagyon kis részét raktam csak hozzá.
  16. se alguem souber que me ajude a encontra o script dessa mira
  17. 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
  18. Can someone help me? what script used in this lock on fire hydra missiles
  19. falconthunder

    Need Marker Timer Script

    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.
  20. KingSCR

    Help: Convert Float to Integer

    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)
  21. 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
  22. 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?
  23. 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)
  24. --[[ ################################################ # # # 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)
  25. felipebaidoloko

    Kikar Jogador da COL

    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