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 467 results

  1. 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
  2. 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?
  3. 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.
  4. 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)
  5. --[[ ################################################ # # # 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)
  6. 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
  7. 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
  8. felipebaidoloko

    GRANADEIRA

    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
  9. Hiner

    math.random HELP!!!

    Привет, мне нужна помощь. Я хочу сделать паспортную систему, мне нужен номер паспорта, который будет случайным
  10. Actualmente necesito un scripter para un servidor freeroam de Anime, es un servidor con potencial pero necesita ser desarrollado...
  11. Hey, I have a freeroam server and for that I have a "Clan Panel" or "Clan System" script, which have a problem . The problem of the resource is that when I use the respective bind ("H") the clan panel is not showed on the server. I am now in a sad situation , it would be great if someone helps me out. The script : clan_c.lua : Clan = { Button = {}, Window = {}, Gridlist = {}, Edit = {} } Clan.Window[1] = guiCreateWindow(306, 174, 320, 346, "Clan panel", false) guiWindowSetSizable(Clan.Window[1], false) Clan.Window[2] = guiCreateWindow(401, 281, 252, 99, "Set Player Rank", false) guiWindowSetSizable(Clan.Window[2], false) Clan.Window[3] = guiCreateWindow(401, 281, 252, 99, "Set Player Rank", false) guiWindowSetSizable(Clan.Window[3], false) Clan.Gridlist[1] = guiCreateGridList(9, 25, 188, 311, false, Clan.Window[1]) local column = guiGridListAddColumn(Clan.Gridlist[1], "Players", 0.9) if ( column ) then --If the column has been created, fill it with players for _,v in ipairs(getElementsByType("player"))do local row = guiGridListAddRow(Clan.Gridlist[1]) local players = getPlayerName(v) guiGridListSetItemText(Clan.Gridlist[1],row,column,players,false,false) end end Clan.Button[1] = guiCreateButton(204, 51, 106, 38, "Add", false, Clan.Window[1]) Clan.Button[2] = guiCreateButton(204, 96, 106, 38, "Kick", false, Clan.Window[1]) Clan.Button[3] = guiCreateButton(204, 144, 106, 38, "Promote", false, Clan.Window[1]) Clan.Button[4] = guiCreateButton(204, 192, 106, 38, "Demote", false, Clan.Window[1]) Clan.Button[5] = guiCreateButton(204, 288, 106, 38, "Close", false, Clan.Window[1]) Clan.Button[6] = guiCreateButton(13, 62, 87, 23, "Cancel", false, Clan.Window[2]) Clan.Button[7] = guiCreateButton(143, 62, 87, 23, "Set", false, Clan.Window[2]) Clan.Button[8] = guiCreateButton(13, 62, 87, 23, "Cancel", false, Clan.Window[3]) Clan.Button[9] = guiCreateButton(143, 62, 87, 23, "Set", false, Clan.Window[3]) Clan.Edit[1] = guiCreateEdit(13, 29, 227, 28, "", false, Clan.Window[2]) Clan.Edit[2] = guiCreateEdit(13, 29, 227, 28, "", false, Clan.Window[3]) guiSetVisible(Clan.Window[1], false) guiSetVisible(Clan.Window[2], false) guiSetVisible(Clan.Window[3], false) showCursor(false) if getElementData(localPlayer, "clan.rank") == "leader" or getElementData(localPlayer, "player.key") == "Snowwhite" or getElementData(localPlayer, "player.key") == "danksta" or getElementData(localPlayer, "player.key") == "[ET]Snowwhite" or getElementData(localPlayer, "player.key") == "[ET]Danksta" or getElementData(localPlayer, "player.key") == "Danksta" then guiSetEnabled(Clan.Button[3], true) guiSetEnabled(Clan.Button[4], true) else guiSetEnabled(Clan.Button[3], false) guiSetEnabled(Clan.Button[4], false) end function toggleClanControl( source ) if getElementData(localPlayer, "player.key") == "Snowwhite" or getElementData(localPlayer, "player.key") == "[ET]Snowwhite" or getElementData(localPlayer, "player.key") == "danksta" or getElementData(localPlayer, "player.key") == "[ET]Danksta" or getElementData(localPlayer, "player.key") == "Danksta" then if not guiGetVisible( Clan.Window[1] ) then showCursor ( true ) guiSetVisible( Clan.Window[1], true ) guiGridListClear ( Clan.Gridlist[1] ) if ( column ) then guiGridListClear ( Clan.Gridlist[1] ) for _,v in ipairs(getElementsByType("player"))do local row = guiGridListAddRow(Clan.Gridlist[1]) local playerName = getPlayerName(v) guiGridListSetItemText(Clan.Gridlist[1],row,column,playerName,false,false) end end if getElementData(localPlayer, "clan.rank") == "leader" or getElementData(localPlayer, "player.key") == "Snowwhite" or getElementData(localPlayer, "player.key") == "danksta" or getElementData(localPlayer, "player.key") == "[ET]Snowwhite" or getElementData(localPlayer, "player.key") == "Danksta" or getElementData(localPlayer, "player.key") == "[ET]Danksta" then guiSetEnabled(Clan.Button[3], true) guiSetEnabled(Clan.Button[4], true) else guiSetEnabled(Clan.Button[3], false) guiSetEnabled(Clan.Button[4], false) end else showCursor ( false ) guiSetVisible( Clan.Window[1], false ) end end end bindKey( "H", "down", toggleClanControl ) addCommandHandler("clan", toggleClanControl) addEventHandler("onClientGUIClick", guiRoot, function() if source == Clan.Button[1] then local row, column = guiGridListGetSelectedItem(Clan.Gridlist[1]) if row == -1 then return end local playerName = guiGridListGetItemText(Clan.Gridlist[1],row,column) local player = getPlayerFromName(playerName) local team = getPlayerTeam(localPlayer) local teamName = getTeamName(team) if not playerName then guiGridListRemoveRow(row) return end triggerServerEvent("addToTeam", localPlayer,playerName,teamName) end end) addEventHandler("onClientGUIClick", guiRoot, function() if source == Clan.Button[2] then local row, column = guiGridListGetSelectedItem(Clan.Gridlist[1]) if row == -1 then return end local playerName = guiGridListGetItemText(Clan.Gridlist[1],row,column) local player = getPlayerFromName(playerName) local team = getPlayerTeam(localPlayer) local teamName = getTeamName(team) if not playerName then guiGridListRemoveRow(row) return end triggerServerEvent("kickFromTeam", localPlayer,playerName,teamName) end end) function closeClan() if guiGetVisible(Clan.Window[1]) then guiSetVisible(Clan.Window[1],false) showCursor(false) end end addEventHandler ("onClientGUIClick", Clan.Button[5], closeClan, false) function togglePromote( source ) -- Show the panel if not guiGetVisible( Clan.Window[2] ) then showCursor ( true ) guiSetVisible( Clan.Window[2], true ) guiMoveToBack( Clan.Window[1] ) else showCursor ( true ) guiSetVisible( Clan.Window[2], false ) end end addEventHandler ( "onClientGUIClick", Clan.Button[3], togglePromote, false ) addEventHandler("onClientGUIClick",Clan.Button[7], function() local row, column = guiGridListGetSelectedItem(Clan.Gridlist[1]) if row == -1 then return end local playerName = guiGridListGetItemText(Clan.Gridlist[1],row,column) local player = getPlayerFromName(playerName) if not playerName then guiGridListRemoveRow(row) return end triggerServerEvent("promotePlayer",localPlayer,playerName,tostring(guiGetText(Clan.Edit[1])) or "Member") guiSetVisible( Clan.Window[2], false ) showCursor ( true ) end,false) function closeClan() if guiGetVisible(Clan.Window[2]) then guiSetVisible(Clan.Window[2],false) showCursor(true) end end addEventHandler ("onClientGUIClick", Clan.Button[6], closeClan, false) function toggleDemote( source ) -- Show the panel if not guiGetVisible( Clan.Window[2] ) then showCursor ( true ) guiSetVisible( Clan.Window[2], true ) guiMoveToBack( Clan.Window[1] ) else showCursor ( true ) guiSetVisible( Clan.Window[2], false ) end end addEventHandler ( "onClientGUIClick", Clan.Button[4], toggleDemote, false ) addEventHandler("onClientGUIClick",Clan.Button[9], function() local row, column = guiGridListGetSelectedItem(Clan.Gridlist[1]) if row == -1 then return end local playerName = guiGridListGetItemText(Clan.Gridlist[1],row,column) local player = getPlayerFromName(playerName) if not playerName then guiGridListRemoveRow(row) return end triggerServerEvent("DemotePlayer",localPlayer,playerName,tostring(guiGetText(Clan.Edit[2])) or "Member") guiSetVisible( Clan.Window[3], false ) showCursor ( true ) end,false) function closeClan() if guiGetVisible(Clan.Window[3]) then guiSetVisible(Clan.Window[3],false) showCursor(true) end end addEventHandler ("onClientGUIClick", Clan.Button[8], closeClan, false) and the clan_s.lua : function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end local blip = {} addEvent("addToTeam", true) addEventHandler("addToTeam", root, function (playername, teamname) local player = getPlayerFromName(playername or "") local team = getTeamFromName(teamname or "") if player and team then local r, g, b = getTeamColor ( team ) setPlayerTeam(player, team) if not isElement(blip[source]) then blip[source] = createBlipAttachedTo(source) end local theTeam = getPlayerTeam(source) if theTeam then local r, g, b = getTeamColor(theTeam) setPlayerNametagColor(source, r, g, b) setBlipColor(blip[source], r, g, b, 255) setPlayerName(source,getPlayerName(source):gsub('#%x%x%x%x%x%x',RGBToHex(r,g,b))) outputChatBox("You've been added to "..getTeamName(team).."", player, 255, 255, 255, r,g,b,true) end end end) addEvent("kickFromTeam", true) addEventHandler("kickFromTeam", root, function (playername, teamname) local player = getPlayerFromName(playername or "") local team = getTeamFromName(teamname or "") if player and team then local red, green, blue = math.random (50, 255), math.random (50, 255), math.random (50, 255) setPlayerTeam(player, nil) setPlayerNametagColor(player, red, green, blue) outputChatBox("You've been kicked from #FFFFFF"..getTeamName(team).."#FF0000.", player, 255, 0, 0, true) end end) addEvent("promotePlayer",true) addEventHandler("promotePlayer",root, function(playername, rank) local player = getPlayerFromName(playername or "") if player then if rank then setElementData(player, "clan.rank", rank) outputChatBox("You Have Been promoted To A #FFFFFF"..tostring(rank), player, 255, 0, 0, true) end end end) addEvent("DemotePlayer",true) addEventHandler("DemotePlayer",root, function(playername, rank) local player = getPlayerFromName(playername or "") if player then if rank then setElementData(player, "clan.rank", rank) outputChatBox("You Have Been Demoted To A #FFFFFF"..tostring(rank), player, 255, 0, 0, true) end end end) function loopFix( thePlayer, _, who, lossp ) if getElementData(thePlayer, "player.key") == "Snowwhite" then if ( who ) then local LossC = tonumber (lossp) or 0 local ThePlayer = getPlayerFromParticalName ( who ) if ( ThePlayer ) then setElementData( ThePlayer,"EXP",LossC ) end end end end addCommandHandler ( "fixbug", loopFix) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end addEventHandler("onPlayerQuit", root, function() if isElement(blip[source]) then destroyElement(blip[source]) end end ) It would be great if someone finds what is the problem and help me to fix it our
  12. 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)
  13. Boa noite meus querido, alguns dias atrás, me cadastrei no fórum a procura de conhecimento.. estava com muita dificuldade para modificar um script simples e vim procurar ajuda no forum. Assim, várias pessoas me ajudaram, até o moderador do fórum português ❤️. Muito obrigado pela ajuda para solucionar este script.. vou mostrar o script antes e depois da modificação que me ajudaram a solucionar. Primeiro código antes da modificação! function DAR_XP_AIRNEWSCR ( source, cmd, pname, Quantidade ) if pname and tonumber(Quantidade) then local cliente = getPlayerFromPartialName(pname) if isElement(cliente) then if getElementData ( source, "Console_AirNewSCR" ) == "Sim" then setElementData ( cliente, "Level", Quantidade ) exports.Scripts_Dxmessages:outputDx(source, "Você Setou o Level do(a) Jogador(a) "..getPlayerName(cliente).."#ffffff para "..Quantidade.." com Sucesso!", "success") exports.Scripts_Dxmessages:outputDx(cliente, "O(A) Admin "..getPlayerName(source).."#ffffff Setou seu Level para "..Quantidade.." com Sucesso!", "success") end else exports.Scripts_Dxmessages:outputDx(source, "O Jogador Não Foi Encontrado", "error") end end end addCommandHandler ( "level", DAR_XP_AIRNEWSCR ) Código modificado ficou assim usando o comando /level "nomeDoPlayer" "level" function DAR_XP_AIRNEWSCR ( source, cmd, pname, Quantidade ) if pname and tonumber(Quantidade) and (isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(source)), aclGetGroup("Console"))) then local cliente = getPlayerFromPartialName(pname) if isElement(cliente) then setElementData ( cliente, "Level", tonumber(Quantidade) ) exports.Scripts_Dxmessages:outputDx(source, "Você Setou o Level do(a) Jogador(a) "..getPlayerName(cliente).."#ffffff para "..Quantidade.." com Sucesso!", "success") exports.Scripts_Dxmessages:outputDx(cliente, "O(A) Admin "..getPlayerName(source).."#ffffff Setou seu Level para "..Quantidade.." com Sucesso!", "success") else exports.Scripts_Dxmessages:outputDx(source, "O Jogador Não Foi Encontrado", "error") end end end addCommandHandler ( "level", DAR_XP_AIRNEWSCR ) Agora estou com com um novo Script usando o mesmo data "Console_AirNewSCR" e quero saber se tem como eu modificar ele para dar vip usando o comando /ativar "nomeDoPlayer" "tipodovip""dinheiro" e quantos dias irá durar o vip. estou contando com a ajuda desse fórum que tem ótimos scripts que tem um conhecimento um mais avançado que eu . Meu muito obrigado dês de já! 🔝 Comando_VIP = "ativar" Grupo = "Console" -- Grupo no Painel P ( Manage ACL ) function getPlayerFromPartialName ( name ) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end function Dar_VIP_AirNewSCR ( source, cmd, player, VIP, Dinheiro ) if getElementData ( source, "Console_AirNewSCR" ) == "Sim" then if player and VIP then local Jogador = getPlayerFromPartialName ( player ) if Jogador then if not isGuestAccount ( getPlayerAccount ( Jogador ) ) then local Conta = getAccountName ( getPlayerAccount ( Jogador ) ) if VIP == "Alpha" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Alpha" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Alpha", source, 255, 255, 255, true ) end elseif VIP == "Epsylon" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Epsylon" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Epsylon", source, 255, 255, 255, true ) end elseif VIP == "Sigma" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Sigma" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Sigma", source, 255, 255, 255, true ) end elseif VIP == "Omega" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Omega" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Omega", source, 255, 255, 255, true ) end end if VIP == "Alpha" or VIP == "Epsylon" or VIP == "Sigma" or VIP == "Omega" then --return outputChatBox ( "* Erro: Esse VIP não existe!", source, 255, 255, 255, true ) --end aclGroupAddObject ( aclGetGroup( VIP ), "user."..Conta ) Musica_Selecionada = math.random ( 1, 3 ) triggerClientEvent ( root, "AirNewSCR_Ativar_VIP", root, Musica_Selecionada, VIP ) if Musica_Selecionada == 1 then --outputChatBox ( "Arquivos/Rae_Sremmurd_Black_Beatles_ft_Gucci_Mane.mp3", source ) Musica_Tocando = "Rae Sremmurd - Black Beatles ft. Gucci Mane" Bonus = 0 elseif Musica_Selecionada == 2 then --outputChatBox ( "Arquivos/Post_Malone_Congratulations_ft_Quavo.mp3", source ) Musica_Tocando = "Post Malone - Congratulations ft. Quavo" Bonus = 50 elseif Musica_Selecionada == 3 then --outputChatBox ( "XXXTENTACION_Look_At_Me.mp3", source ) Musica_Tocando = "XXXTENTACION - Look At Me!" Bonus = 100 end setElementData ( root, "Ultimo_Ativador", getPlayerName(Jogador) ) setElementData ( root, "VIP_do_Ultimo_Ativador", VIP ) outputChatBox ( " ", root ) outputChatBox ( " ", root ) outputChatBox ( "=======================================================", root, 255, 255, 255, true ) outputChatBox ( "* O(A) Jogador(a) "..getPlayerName(Jogador).." #ffffffAtivou um Plano VIP "..VIP, root, 255, 255, 255, true ) if Bonus == 0 then outputChatBox ( "* Seu Bonus de Ativação foi de "..Bonus.."%, Não foi dessa vez!", root, 255, 255, 255, true ) outputChatBox ( "* O(A) Jogador(a) Recebeu 1kk pela Ativação do VIP", root, 255, 255, 255, true ) if Dinheiro ~= false then givePlayerMoney ( Jogador, 1000000 ) givePlayerMoney ( Jogador, 0 ) end elseif Bonus == 50 then outputChatBox ( "* Seu Bonus de Ativação foi de "..Bonus.."%, +50% de 1kk (1kk500k)", root, 255, 255, 255, true ) outputChatBox ( "* O(A) Jogador(a) Recebeu 1kk pela Ativação do VIP (+500k Bonus)", root, 255, 255, 255, true ) if Dinheiro ~= false then givePlayerMoney ( Jogador, 1000000 ) givePlayerMoney ( Jogador, 500000 ) end elseif Bonus == 100 then outputChatBox ( "* Seu Bonus de Ativação foi de "..Bonus.."%, +100% de 1kk (2kk)", root, 255, 255, 255, true ) outputChatBox ( "* O(A) Jogador(a) Recebeu 1kk pela Ativação do VIP (+1kk Bonus)", root, 255, 255, 255, true ) if Dinheiro ~= false then givePlayerMoney ( Jogador, 1000000 ) givePlayerMoney ( Jogador, 1000000 ) end end outputChatBox ( "* Musica Tocando: "..Musica_Tocando, root, 255, 255, 255, true ) outputChatBox ( "=======================================================", root, 255, 255, 255, true ) outputChatBox ( " ", root ) outputChatBox ( " ", root ) outputDebugString ( "[ Ativação ] - O(A) Admin "..getPlayerName(source).." Ativou um VIP para o(a) Jogador(a) "..getPlayerName(Jogador).."!" ) outputDebugString ( "[ Ativação ] - Bonus do VIP Gerado: "..Bonus.."%" ) setTimer ( function() restartResource ( getThisResource ( ) ) -- Reinicia o Mod Automaticamente! outputDebugString ( "[ AirNewSCR ] - Resource 'Scripts_AtivarVIP' Reiniciado Automaticamente! " ) end, 15000, 1 ) end end else outputChatBox ( "* Erro: Jogador não encontrado!", source, 255, 255, 255, true ) end end end end addCommandHandler ( Comando_VIP, Dar_VIP_AirNewSCR ) function Verificar_Emprego_Atual ( ) for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if acc and not isGuestAccount(acc) then local accName = getAccountName (acc) if isObjectInACLGroup ("user."..accName, aclGetGroup ( Grupo ) ) then setElementData ( player, "Console_AirNewSCR", "Sim" ) else setElementData ( player, "Console_AirNewSCR", "Não" ) end end end end setTimer ( Verificar_Emprego_Atual, 1500, 0 ) -- By AirNewSCR
  14. Olá meus amigos, estou precisando editar meu Gamemode para quando um player morrer ele perca todas as armas. Alguém pode me ajudar?
  15. felipebaidoloko

    DANO COLETE E HELEMT

    Boa Noite, Pessoal preciso de uma ajuda que um tempo eu to com esse aviso, quando eu to na agua e começo a levar dano "afogado" ele perde dano mas a função do damage do colete e helmet fica dando esse aviso AVISO === attemp to perform aritmedic on a nil value OBS: damageRoupa é o dano que vai ate o colete e helmet if weapon == 0 then damage = 2000 damageRoupa = 2000 / 100 else damage = getWeaponDamage(weapon,attacker) damageRoupa = getWeaponDamage(weapon,attacker) / 100 end
  16. Alguém poderia me ajudar em fazer um script de fumaça colorida?
  17. benii23

    Létszives segítsetek

    Sziasztok! Szeretnék elkezdeni luát tanulni csak nem tudom hogy hol/honnan kéne elkezdeni és ebben szeretném kérni a segítségeteket hogy írjatok tippeket esetleg olyan videókat amiben részletesen elmondják magát a lua nyelvet. Válaszokat előre is köszi
  18. felipebaidoloko

    KILL ZOMBIE

    Boa Noite, não queria vim pedir ajuda no forum mas fui forçado a pedir ajuda eu to com problema de aviso numa linha do script que tava criando no Client.lua.. a função é quando da dano no ped (zombie) na linha eu coloco o Blood do zombie > 0 só que quando da numo menor que 0 ele da aviso. AVISO === attempt to compare with number boolean if getElementData(source,"bloodZumbie") > 0 then -- aviso aqui if weapon == 0 then damage = 2500 else damage = getWeaponDamage(weapon,attacker) end if bodypart == 9 then damage = damage * 9.5 headshot = true end setElementData(source, "bloodZumbie", getElementData(source, "bloodZumbie") - math.random(damage * 0.75, damage * 1.25)) outputChatBox("DANO ZUMBIE: "..damage.." / "..getElementData(source,"bloodZumbie")) if getElementData(source,"bloodZumbie") <= 0 and not getElementData(source,"isDeadZumbie") then triggerServerEvent("onZombieGetsKilled", source, attacker, headshot, getWeaponNameFromID(weapon)) setElementData ( source, "isDeadZumbie", true ) outputChatBox("MATOU") end end
  19. +Sommer

    Podem Me Ajudar?

    Sou um scripter iniciante, ja abri vários scripts de concessionaria e não entendi como funciona muito bem, teria como alguém me ensinar ou me explicar como faz para fazer aquelas tabelas para o player comprar o carro, deixar o carro girando, salvar o carro quando o player sair do servidor ou se o servidor para, por favor ficaria muito grato a quem me ajudasse. OBS: Fiz a parte do painel quando o player passa por cima de um marker, fiz um ped já tbm
  20. biscoitoimproprio

    Ajuda em um script de anim

    Pessoal, estou querendo criar um script com a animação de cruzar os braços, que seria time, tentei fazer ai abaixo mas não pega, acho que fiz algo errado, me ajudem. (Esse e meu primeiro script)
  21. MonSteRDM

    dxDrawMaterialLine3D

    Buenas, Queria saber quien me podria ayudar u orientar para poner una imagen debajo de un vehiculo. tipo sombra pero con una imagen, e visto que algunos manejan el dxDrawMaterialLine3D o con un shader, De ante mano gracias.
  22. CLIENT: function cancelTazerDamage(attacker, weapon, bodypart, loss) if (weapon==24) then -- deagle local mode = getElementData(attacker, "handTaser") if (mode==true) then cancelEvent() end end end addEventHandler("onClientPlayerDamage", localPlayer, cancelTazerDamage) local cFunc = {} local cSetting = {} cSetting["shots"] = {} cSetting["shot_calcs"] = {} local last_shot = 1 cFunc["draw_shot"] = function(x1, y1, z1, x2, y2, z2) table.insert(cSetting["shots"], last_shot, {x1, y1, z1, x2, y2, z2}) local lastx, lasty, lastz = x1, y1, z1 local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) cSetting["shot_calcs"][last_shot] = {} last_shot = last_shot+1 end cFunc["wait_shot"] = function() toggleControl("fire", false) setTimer(function() toggleControl("fire", true) end, 15000, 1) end cFunc["shot_check"] = function(wp, _, _, hitX, hitY, hitZ, element, startX, startY, startZ) if(wp == 24) and (getElementData(localPlayer,"handTaser"))then cFunc["shot_weapon"](hitX, hitY, hitZ, startX, startY, startZ) cancelEvent() if(source == localPlayer) then cFunc["wait_shot"]() end end end cFunc["anim_check"] = function(attacker, wep, bodypart,loss) if(wep == 24) and (getElementData(localPlayer,"handTaser"))then local playerX,playerY,playerZ = getElementPosition(localPlayer) local targetX,targetY,targetZ = getElementPosition(source) if getDistanceBetweenPoints3D(playerX,playerY,playerZ,targetX,targetY,targetZ) <= 12 then triggerServerEvent("tazerFired", getRootElement(), source) end end end addEventHandler("onClientPlayerWeaponFire", getRootElement(), cFunc["shot_check"]) addEventHandler("onClientPedDamage", getRootElement(),cFunc["anim_check"]) addEventHandler("onClientPlayerDamage", getRootElement(),cFunc["anim_check"]) addEventHandler("onClientResourceStart",resourceRoot,function() setElementData(localPlayer, "tazed",0) end) addEventHandler("onClientRender",getRootElement(),function() if getElementData(localPlayer, "tazed") == 1 then toggleAllControls(false, false, false) toggleControl("fire", false) toggleControl("sprint", false) toggleControl("crouch", false) toggleControl("jump", false) toggleControl('next_weapon',false) toggleControl('previous_weapon',false) toggleControl('aim_weapon',false) end end) SERVER: local cFunc = {} local cSetting = {} function tazerFired(target) if (isElement(target) and getElementType(target)=="player") then fadeCamera ( target, false, 1.0, 255, 255, 255 ) setElementData(target, "tazed", 1) toggleAllControls(target, false, false, false) setPedAnimation(target, "ped", "FLOOR_hit_f", -1, false, false, true) setTimer(removeAnimation, 30000, 1, target) end end addEvent("tazerFired", true ) addEventHandler("tazerFired", getRootElement(), tazerFired) function removeAnimation(thePlayer) if (isElement(thePlayer) and getElementType(thePlayer)=="player") then fadeCamera(thePlayer, true, 0.5) if getElementData(thePlayer,"isAnim") then setElementFrozen(thePlayer,true) setPedAnimation(thePlayer,"sweet","sweet_injuredloop",-1,false,false,false) else setPedAnimation(thePlayer,nil,nil) toggleAllControls(thePlayer, true, true, true) end setElementData(thePlayer, "tazed", 0) end end I do not get any errors/warnings in debugscript 3, just simply does not working the script.. What wrong in this codes? :s
  23. Testei isso: Quero desativar os sons de fundo de tiro do gta, alguma solução?
  24. doctor

    Use more LUA files (require)

    Hello there! I just started to develop some fun scripts to the MTA SA (1.5.6) Im not a professional LUA programmer but as good i see on forums (stack overflow etc.) there is a way to import or use functions from other lua files with "require" My problem is that the "require" isnt working for me and i cant import functions from other lua file.I will not paste code because i tried every possible combinations of using the "require" Is there some way to use functions from other file? can i use "require" or there is a alternative for it? Thank you for your answrs 😊
  25. Sevik

    Roleplay serverside

    ERROR: account-system/s_account_system_sapphire.lua:677: attempt to c [ oncatenate local 'safepassword' (a nil value) ERROR: Client (discord?) triggered serverside event itemResourceStart [ ed, but event is not added serverside DIAGNOSTIC: discord? #1003 CLIENT SCRIPT ERROR: saveplayer-system\c_s [ aveplayer_system.lua is invalid. Please re-compile at http://luac.mtasa.com/ I have this roleplay server and I'm not going to register, but the localhost works (mention the server is hosted)