Jump to content

Search the Community

Showing results for tags 'script'.

  • 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
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. I want to create a random supply drop script that moves a certain object from a position in the air to the ground position vertically. -- SERVERSIDE local object = {id = 1271, x = 1000, y = 1000, z = 200} function moveSupply(source, command) local box = createObject(object.id, object.x, object.y, object.z, 0, 0, 0) -- here it should be something that calculates 'ground' as the z coordonate of the ground object point moveObject(box, 10000, object.x, object.y, ground) -- etc end addCommandHandler("supply", moveSupply) . The problem is that there is no support for getting the specific ground position in serverside, only in clientside. Waiting an idea or any other method that can work.
  2. Alguém poderia tira essa duvida de mim? Existe algum script ou algum bloqueador que quando a pessoa baixa a .txd. Deleta aquela automaticamente para ela não roubar. Pois é meio chato você fazer texturas e algumas pessoas meio que roubam.
  3. function outputChatBoxRemote ( playerName, message, type, serverport ) outputChatBox ( "From " .. playerName .. " on " .. serverport .. ": " .. message ) return "hello sailor" end function finishedCallback( responseData, errno ) responseData = tostring(responseData) if responseData == "ERROR" then outputDebugString( "callRemote: ERROR #" .. errno ) elseif responseData ~= "hello sailor" then outputDebugString( "callRemote: Unexpected reply: " .. responseData ) else end end function playerChat ( message, type ) callRemote ( "87.229.77.40:22030", getResourceName(getThisResource()), "outputChatBoxRemote", finishedCallback, getPlayerName(source), message, type, getServerPort() ) end addEventHandler ( "onPlayerChat", getRootElement(), playerChat ) This is the code, but does not working.. what wrong?
  4. precuro o script para que as mensagens de mods/informaçoes apareçam no topo da tela nao no chat pois quando aparecem no chat atrapalham os players ALGUEM SABE ME AJUDAR!!PLS
  5. I want make a script, which plays sound from youtube.. But.. there is no one converter which would work.. How to use a converter as sound player? Anyone can help?? Sorry for my bad english..
  6. Hi everyone im new in scripting and i wanna script a level system All i want is when player plays in server +5 hours make the player ranked up exp: +5 hourse lvl 1 +10hourse lvl2 15hourse lvl3 And how can i show this levels in scoreboard Sorry for my TERRIBLE english
  7. function getPlayerFromID(id) return call(getResourceFromName("game_id2"), "getPlayerFromID", tonumber(id)) end function getPlayerID(player) return getElementData(player,"id") end function criarGang ( source, commandName, ... ) local getaMoney = getPlayerMoney (source) local teamName = table.concat({...}, " ") if teamName then if getaMoney <300000 then outputChatBox("#7d26cd[SERVER] #FF0000Você não tem dinheiro suficiente para criar uma gang valor 5000$",source,255,255,255,true) else if ( getPlayerTeam(source) ~= false ) and ( countPlayersInTeam(getPlayerTeam(source)) == 1 ) then destroyElement(getPlayerTeam(source)) outputChatBox("#F4A460[SERVER]#F08080 Sua gang antiga foi deletada e foi criada uma nova!",source,255,255,255,true) end local newTeam = createTeam ( teamName) if newTeam then takePlayerMoney (source,300 ) local getGang = getTeamName ( newTeam ) setTeamColor (newTeam,math.random(0,255), math.random(0,255), math.random(0,255)) setPlayerTeam ( source, newTeam ) local playerTeam = getPlayerTeam( source ) outputChatBox("#43CD80[GANG] #FFFFFFGang criada com sucesso!",source, 255, 255, 255, true) end end else outputChatBox("#43CD80[GANG] #FFFFFFUso correto: /gangcriar [nome]",source,255,255,255,true) end end addCommandHandler("gangcriar",criarGang) addEventHandler("onPlayerLogin",root,function() local team = getAccountData (getPlayerAccount(source), "team") if (team==getTeamName(getTeamFromName(team))) then setPlayerTeam(source, getTeamFromName(team)) end end) function save() local team = getPlayerTeam(source) local account = getPlayerAccount(source) if not isGuestAccount(account) then if(team)then setAccountData(account, "team", getTeamName(team)) end end end addEventHandler("onPlayerLogout", root, save) addEventHandler("onPlayerQuit", root, save) function sairDaGang(source) local playerTeam = getPlayerTeam (source) if (playerTeam) then setPlayerTeam (source, nil) outputChatBox("#43CD80[GANG] #FFFFFFVocê saiu da gang",source,255,255,255,true) else outputChatBox("#43CD80[GANG] #ffffffVocê não tem gang",source,255,255,255,true) end end addCommandHandler("gangsair", sairDaGang) function desfazerGang (source) local playerVeri = getPlayerTeam (source) if (playerVeri) then destroyElement (playerVeri) outputChatBox("#43CD80[GANG] #FFFFFFVocê deletou sua gang",source,255,255,255,true) else outputChatBox("#43CD80[GANG] #FFFFFFVocê não tem gang",source,255,255,255,true) end end addCommandHandler("gangdeletar", desfazerGang) function enviarGang(source,cmd,targetPlayer) local target = getPlayerFromID (targetPlayer) local geta = getPlayerFromID (target) gang = getPlayerTeam (source) local getName = getTeamFromName(source) lala = getTeamName(source) local convidado = true setElementData(target, "gangConvite", gang, false) if gang == getName then outputChatBox("#43CD80[GANG] #FFFFFFVocê não pertence a nenhuma gang",source, 255, 255, 255, true) else outputChatBox("#43CD80[GANG] #FFFFFFConvite de recrutamento enviado para o Jogador " ..getPlayerName(target).. " ID: "..targetPlayer,source, 255, 255, 255, true) outputChatBox("#43CD80[GANG] #FFFFFFVocê foi convidado para a gang #43CD80" ..getTeamName(gang).. " #FFFFFFuse #43CD80/gangaceitar #FFFFFFpara entrar na Gang: #ffffff "..getTeamName(gang),target, 255, 255, 255, true) end end addCommandHandler("gangconvidar", enviarGang) function Recrutamento(source) local gangConvite = getElementData(source, "gangConvite") if isElement(gangConvite) then outputChatBox("#43CD80[GANG] #FFFFFFVocê entrou na gang "..getTeamName(gang),source, 255, 255, 255, true) setPlayerTeam (source, gangConvite) else outputChatBox("#43CD80[GANG] #FFFFFFVocê não foi convidado para nenhuma gang",source, 255, 255, 255, true) end end addCommandHandler("gangaceitar",Recrutamento) function gangCommands(thePlayer) outputChatBox ( "#7d26cd[GANG] #ffffffUse /gangcriar | /gangcor CODE RGB | /gangtag | /gangconvidar ID/Nome | /gangabandonar | /gangsair | /gangdeletar", thePlayer, 255, 255, 255, true ) end addCommandHandler ( "gang", gangCommands ) function gangName ( player, commandName, newName ) local theTeam = getPlayerTeam ( player ) setTeamName ( theTeam, newName ) outputChatBox("A Gangue "..getTeamName(theTeam).." alterou o nome ["..newName.."]", root, 255, 0, 0) end addCommandHandler("gangnome", gangName ) function gangFarbe ( player, commandName, r, g, b ) local team = getPlayerTeam ( player ) setTeamColor ( team, r, g, b ) outputChatBox("[INFO] A gangue "..getTeamName(team).." alterou a cor da Gangue", source, 255, 255, 255, tonumber(r), tonumber(g), tonumber(b)) end addCommandHandler("gangcor", gangFarbe ) addCommandHandler( "gangtag", function ( source, cmdname, tag ) if tag and ( tag:len() > 3 or tag:len() == 0 ) then return outputChatBox("A tag deve ter no máximo 3 caracteres.", source, 230, 0, 0) end if getPlayerTeam(source) and tag then setPlayerName(source, "["..tag.."]"..getPlayerName(source)) elseif not tag then outputChatBox("Sintaxe: /gangtag <tag da gangue>", source, 230, 0, 0) end end ) 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 Este script apenas funciona o /gangcriar "aparece o nome da gang no scoreboard", /gangnome "muda o nome antigo da gang", /gangdeletar e também da pra fazer /gangcriar "com a gang criada ele apaga a antiga e muda nome" mas não funciona tag, não da pra convidar ninguém para gang, só funciona os comandos os quais eu citei agora! Obrigado a quem conseguir me ajudar desde já! Lembrando só que eu uso um sistema de tags para por exemplo dono, sub dono... etc... E meu chat não utiliza ID, apenas nome...
  8. Hola a todos, mi nombre es Lautaro Rojas, tuve 3 servidores, y la verdad ya no me motiva "demasiado" seguir haciéndolos, por lo tanto, me ofrezco a ayudar a los que en serio quieran llegar lejos con su proyecto. Obviamente, esto no es gratis, pero los precios son MUY accesibles. Mi servicio: -NO voy a hacer servidores desde 0, aclaro esto porque hay gente que me lo ha pedido, y no. -Atención 24/7, puesto que estoy de vacaciones hasta marzo. -Conmigo no tendrás ningún tipo de problema, tengo experiencia hace años en scripting. Por motivos de privacidad y seguridad, no dejaré métodos de comunicación aquí, si estas interesado, responde a este topic, y me pondré en contacto contigo, muchas gracias por el espacio.
  9. There's a shader and a simple float4x4 array in it. I just want to set the array's values with dxSetShaderValue. How should I do this? float4x4 thisBoneMatrix[6] = { float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) };
  10. Eu tenho esse script de gangues que achei o melhor pois já joguei em servidores que possuía ele mas eu utilizo um sistema de tags por exemplo de níveis, começa lá em baixo com everyone e sobe para vip, Bope, ajudante, moderador... até console, mas quando dou /gangtag "nome da tag" o script simplesmente não faz nada, pelo que notei ele funciona normal pra criar a gang mas a tag não... Aqui o script de gang: https://community.multitheftauto.com/index.php?p=resources&s=details&id=12014 e meu sistema de tags é esse http://mods-mta-online.blogspot.com.br/2014/09/tags-admin.html Obrigado a todos que ajudarem eu agradeço de coração :3. É para meu servidor novo :3 (já montado mas sem gangs kk)
  11. Olá, gostaria de mudar esse sistema para que o jogador dominar a área através do marker e não pela colisão da área. Ai o marker ia fazer a função do ColCuboid esperou que tenha entendido .. ------------------------------------------------------ -- Scripting By Sasu -- Copyright © 2013-2015 - All rights reserved. ------------------------------------------------------ local turfPos = { { 2133.1950683594, 633.66455078125, 0, 197.5, 92, 90 }, } local turfElement = {} local turfTimer = {} local checkComplete = false local messages = { [1] = "Sistema de Territorio by:Sasuke * foi iniciado corretamente!", [2] = "Esse território já pertence a %s", [3] = "Você entrou em %s's do território. Aguarde 2 minutos para dominar!", [4] = "Este território não pertence a ninguém. Aguarde 2 minutos para dominar!", [5] = "Parabéns. Você consquistou o território!", [6] = "Se você não voltar dentro de 20s, você não vai dominar o território", [7] = "Você não conseguiu consquisou o território devido à ausência" } -- Nadie = None | Just a translation addEventHandler("onResourceStart", resourceRoot, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS Turf_System ( Turfs TEXT, GangOwner TEXT, r INT, g INT, b INT)") -- local check = executeSQLQuery("SELECT * FROM Turf_System" ) if #check == 0 then for i=1,#turfPos do executeSQLQuery("INSERT INTO Turf_System(Turfs,GangOwner,r,g,b) VALUES(?,?,?,?,?)", "Turf["..tostring(i).."]", "Nadie", 0, 255, 0) end elseif #check > 1 then for i = #check, #turfPos do executeSQLQuery("INSERT INTO Turf_System(Turfs,GangOwner,r,g,b) VALUES(?,?,?,?,?)", "Turf["..tostring(i).."]", "Nadie", 0, 255, 0) end end for i,v in ipairs(turfPos) do local sqlData = executeSQLQuery("SELECT * FROM Turf_System WHERE Turfs=?", "Turf["..tostring(i).."]") local turfCol = createColCuboid(unpack(v)) setElementData(turfCol, "getTurfGang", sqlData[1].GangOwner) local turfArea = createRadarArea(v[1], v[2], v[4], v[5], sqlData[1].r, sqlData[1].g, sqlData[1].b, 175) turfElement[turfCol] = {turfCol, turfArea, i} turfTimer[turfCol] = {} end outputDebugString( messages[1] ) end ) addEventHandler ( "onColShapeHit", root, function ( player ) if turfElement[source] and source == turfElement[source][1] then local turf,area,id = unpack( turfElement[source] ) local playerGang = getElementData ( player, "gang" ) local turfGang = executeSQLQuery("SELECT GangOwner FROM Turf_System WHERE Turfs=?", "Turf["..tostring(id).."]" ) if ( turfGang[1].GangOwner == playerGang ) then outputChatBox( messages[2]:format( turfGang[1].GangOwner or "None" ), player, 0, 255, 0, false ) else local playerGang = getElementData ( player, "gang" ) setElementData( source, "warTurf", playerGang ) if ( isTimer ( turfTimer[source][1] ) ) then if isTimer( turfTimer[source][2] ) then killTimer( turfTimer[source][2] ) end return end if ( playerGang ) then local r, g, b = unpack ( getGangColor ( playerGang ) ) -- local r, g, b = 255, 255, 255 setRadarAreaFlashing ( area, true ) if turfGang[1].GangOwner ~= "Nadie" then outputChatBox( messages[3]:format( turfGang[1].GangOwner ), player, 0, 255, 0, false ) else outputChatBox( messages[4], player, 0, 255, 0, false ) end turfTimer[source][1] = setTimer ( function ( ) local players = getGangPlayersInTurf ( turf, playerGang ) setRadarAreaColor ( area, tonumber(r), tonumber(g), tonumber(b), 175 ) for _, player in ipairs ( players ) do outputChatBox( messages[5], player, 0, 255, 0, false ) triggerClientEvent(player, "onTakeTurf", player) givePlayerMoney ( player, 4000 ) executeSQLQuery("UPDATE Turf_System SET GangOwner=?,r=?,g=?,b=? WHERE Turfs=?", playerGang, tonumber(r), tonumber(g), tonumber(b), "Turf["..tostring(id).."]" ) -- setElementData ( turf, "getTurfGang", playerGang ) end setRadarAreaFlashing ( area, false ) end ,120000, 1) end end end end ) addEventHandler ( "onColShapeLeave", root, function( player ) if turfElement[source] and source == turfElement[source][1] then if isTimer( turfTimer[source][1] ) then local aGang = getElementData( source, "warTurf" ) local ps = getGangPlayersInTurf( source, aGang ) if #ps == 0 then outputChatBox( messages[6], player, 255, 0, 0 ) turfTimer[source][2] = setTimer( function(source, aGang) if isTimer(turfTimer[source][1]) then killTimer(turfTimer[source][1]) end setRadarAreaFlashing(turfElement[source][2], false) for _, v in ipairs( getElementsByType("player") ) do if getElementData(v, "gang") == aGang then outputChatBox(messages[7], v, 255, 0, 0) end end end , 20000, 1, source, aGang) end end end end ) function getGangPlayersInTurf( turf, gang ) -- element, string if turf and gang then local players = getElementsWithinColShape ( turf, "player" ) local gPla = {} for _, v in ipairs( players ) do if getElementData(v, "gang") == gang then table.insert(gPla, v) end end return gPla end end function getGangColor(gangName) return exports[ "gang_system" ]:getGangData ( gangName, "color" ) end
  12. Eu sou novo no fórum, recentemente abri um servidor, e gostaria de uma ajuda, eu tenho um script que ele tranca veículos para um determinado grupo como Console, mas eu não sei fazer o spawn dele, pois o único que tenho faz com que o player já fique dentro do veículo, sendo que o veiculo está por exemplo privado apenas quando o player tenta abrir a porta com F ou G, e ali no caso o jogador cai dentro do carro e pode utilizar ele, eu gostaria de saber se alguém poderia me doar um script de privar veículos e com isso utilizar um comando para o jogador cair dentro do veiculo, mas caso o jogador não seja de determinado grupo aparece um aviso no chat que somente X grupo "ex uma gang, uma corp ou um jogador solo" pode pegar o veículo, obrigado a todos que puderem ajudar, eu ainda não sei fazer script e nem sei onde se aprende, eu apenas sei editar basicamente (um pouco de gambiarra junto kkk).
  13. function auto ( ) if getElementData ( source, "carLicense" ) then outputChatBox ( "#FF0000-Auto Escola-#FFFF00Você já passou No Teste!", source, 200, 0, 0, true ) else vedro = createVehicle ( 479, 1615.8929443359,-1135.5010986328,23.90625,0,0,0 ) setElementInterior (source,0) setElementDimension (source,0) acc = getPlayerAccount ( source ) setAccountData ( acc, "carLicense", "1" ) setElementData ( source, "carLicense", true) warpPedIntoVehicle ( source, vedro ) outputChatBox ( "#FF0000-Auto Escola-#FFFF00Você começou O Teste.", source, 255, 0, 0, true ) outputChatBox ( "#FF0000-Auto Escola-#FFFF00Siga os Marcadores Vermelhos Para completar O Teste.", source, 255, 0, 0, true ) outputChatBox ( "#FF0000-Auto Escola-#FFFF00Boa Sorte No Teste ", source, 255, 0, 0, true ) function killt(thePlayer) theVehicle = getPedOccupiedVehicle ( thePlayer ) id = getElementModel ( theVehicle ) if id == 479 then account = getPlayerAccount ( thePlayer ) setAccountData ( acc, "carLicense", "0" ) setElementData ( thePlayer, "carLicense", false) outputChatBox ( "#FF0000-Auto Escola-#FFFF00Voce nao passou no teste.", thePlayer, 255, 0, 0, true ) veh = getPedOccupiedVehicle ( thePlayer ) destroyElement (veh) setElementPosition(source,2442.2177734375, -1969.490234375, 13.546875) end end addEventHandler ( "onVehicleStartExit", getRootElement(), killt ) triggerClientEvent ( source, "startExaming", source ) end end addEventHandler( "markers", getRootElement(), auto ) Me ajudem quero fazer com que quando o jogador sair do veiculo ele seja levado para o local de onde saiu, irá teleporta para onde começou o teste. E os marcadores seja deletado Help me, I want to make sure that when the player leaves the vehicle he is taken to where he left, he will teleport where he started the test. And the markers are deleted function killt(thePlayer) theVehicle = getPedOccupiedVehicle ( thePlayer ) id = getElementModel ( theVehicle ) if id == 479 then account = getPlayerAccount ( thePlayer ) setAccountData ( acc, "carLicense", "0" ) setElementData ( thePlayer, "carLicense", false) outputChatBox ( "#FF0000-Auto Escola-#FFFF00Voce nao passou no teste.", thePlayer, 255, 0, 0, true ) veh = getPedOccupiedVehicle ( thePlayer ) destroyElement (veh) setElementPosition(source,2442.2177734375, -1969.490234375, 13.546875) Oque eu fiz de errado aqui? What did I do wrong here?
  14. agroupTitles = {} aperTitles = {} con = dbConnect("sqlite", ":/registry.db") function isPlayerManager(plr) if getElementData(plr,"admin.number") > 2 then return true end return false end function loadgTitles() dbExec(con, "CREATE TABLE IF NOT EXISTS groupTitles ('group', 'text')") dbExec(con, "CREATE TABLE IF NOT EXISTS perTitles ('account', 'text')") dbQuery(makeTitles, {}, con, "SELECT * FROM groupTitles") dbQuery(makpeTitles, {}, con, "SELECT * FROM perTitles") end addEventHandler("onResourceStart", resourceRoot, loadgTitles) function makeTitles(titleQuery) groupTitles = dbPoll(titleQuery, 222222) for i, titleData in ipairs(groupTitles) do if (titleData) then local num = #groupTitles + 1 groupTitles[num] = { titleData["group"], titleData["text"] } outputDebugString("1") end end end function makpeTitles(perQuery) perTitles = dbPoll(perQuery, 222222) for i, perData in ipairs(perTitles) do if (perData) then local num = #perTitles + 1 perTitles[num] = { perData["account"], perData["text"] } outputDebugString("2") end end end function specials () local bool = exports.CIGcrimboss:isPlayerBoss(client) triggerClientEvent("CIGCustomTitles.unlockBoss",client,bool) end addEvent("CIGCustomTitles.getData", true) addEventHandler("CIGCustomTitles.getData", root, specials) function save () local ct = getElementData(source,"ct") setAccountData(getPlayerAccount(source),"ctitle",ct) local r = getElementData(source,"r2") setAccountData(getPlayerAccount(source),"rrgb",r) local g = getElementData(source,"g2") setAccountData(getPlayerAccount(source),"grgb",g) local b = getElementData(source,"b2") setAccountData(getPlayerAccount(source),"brgb",b) end addEventHandler("onPlayerQuit",root,save) addEventHandler("onPlayerLogout",root,save) function save2 (_,acc) local ct = tostring(getAccountData(acc,"ctitle")) setElementData(source,"ct",ct) local rr = tostring(getAccountData(acc,"rrgb")) setElementData(source,"r2",rr) local bb = tostring(getAccountData(acc,"brgb")) setElementData(source,"b2",bb) local gg = tostring(getAccountData(acc,"grgb")) setElementData(source,"g2",gg) local name = getAccountName(acc) triggerClientEvent(source,"CIGcustomTitles.addTitles",source,name) end addEventHandler("onPlayerLogin",root,save2) function onplayerlo () local acc = getAccountName(getPlayerAccount(client)) for i, col in ipairs(agroupTitles) do local thename = col[1] if thename == getElementData(client,"g") then triggerClientEvent(client,"CIGcustomTitles.addATitle",client,col[2]) outputDebugString("4") end end end addEvent("CIGcustomTitles.checkGroup",true) addEventHandler("CIGcustomTitles.checkGroup",root,onplayerlo) function onplayerl () local acc = getAccountName(getPlayerAccount(client)) for i, col in ipairs(aperTitles) do local thename = col[1] if thename == acc then triggerClientEvent(client,"CIGcustomTitles.addATitle",client,col[2]) outputDebugString("5") end end end addEvent("CIGcustomTitles.checkTitle",true) addEventHandler("CIGcustomTitles.checkTitle",root,onplayerl)
  15. I want create a sound requester script, but how to convert yt link to mp3 with script? Sorry for my very bad english.
  16. Hello, I'm new in MTA scripting. I just checked zombies script by Slothman and I see server triggers punch in client and my question starts. What happens if client edits the script, someone gonna comment all punch action code lines than mean zombies don't attack him... Is it possible? It must be possible, the server doesn't calculate health... I didn't see any set element health code in server... Waiting for answers thanks.
  17. Hello guys! I'm having a little problem, I'm a beginner in scripting, and I made this function because I'm creating a "police work" system, but when the event is executed, nothing happens that was written on the server, nor any error in the debug. (Sorry for English, I use a translator.) Server-side: function tornarPM(thePlayer) if not (isElement(thePlayer)) then return end local accountName = getAccountName(getPlayerAccount(thePlayer)) if accountName then aclGroupAddObject(aclGetGroup("PMESP"), "user."..accountName) exports.dxmessages:outputDx(thePlayer, "Seja bem vindo a PMESP! Vá até a garagem para aprender como funciona o trabalho!", "success") end end addEvent("ingressar",true) addEventHandler("ingressar", root, tornarPM) Client-side: function tornarPM(_,state) if isEventHandlerAdded("onClientRender", root, menu) then if state == "down" then if isCursorOnElement(screenW * 0.4066, screenH * 0.5117, screenW * 0.1574, screenH * 0.0651) then triggerServerEvent("ingressar", localPlayer) removeEventHandler("onClientRender", root, menu) showChat(true) showCursor(false) playSound("sfx/hit.mp3", false) if l_0_1 then l_0_1 = false end end end end end addEventHandler("onClientClick", root, tornarPM) Screenshot: https://i.imgur.com/ZYroOks.jpg
  18. Hi everybody, We need medium-level scripter. Firstly we want to turf system/terrority system. If you help to us, we will pay it. Send me message for detail...
  19. I want create this effect: Effect with a dx image. But i don't know, how to make this possible.. Anyone can help?
  20. How to get mute remaining time? For example i write /getmute, and then output "Mute remaining time: 5 mins", or "You are not muted". Sorry for my bad english.
  21. I have a problem, I tried to make a local blip for each player, that is, if you are a business owner on the server (in my case), then only you have a note of where your business is. Errors in the console are not any no, it's completely clean. ----------------------------------------------------- this is server.lua function dbCreateBusinessesCallback(queryHandle) local sql = dbPoll(queryHandle, 0) if sql and #sql > 0 then for index, sqlRow in ipairs(sql) do local pos = split(sqlRow["bPos"], ",") local bMarker = createMarker(pos[1], pos[2], pos[3], "corona", 1.5, settings["business.markerColor"][1], settings["business.markerColor"][2], settings["business.markerColor"][3], settings["business.markerColor"][4]) setElementInterior(bMarker, pos[4]) setElementDimension(bMarker, pos[5]) local timer = setTimer(businessPayout, sqlRow["bPayoutCurTime"] , 1, bMarker) setElementData(bMarker, "bData", {sqlRow["bID"], sqlRow["bName"], sqlRow["bOwner"], sqlRow["bCost"], sqlRow["bPayout"], sqlRow["bPayoutTime"], sqlRow["bPayoutOTime"], sqlRow["bPayoutUnit"], sqlRow["bBank"], timer}) local bData = getElementData(bMarker, "bData") local id, name, owner, cost, payout, payoutTime, payoutOTime, payoutUnit, bank, timer = unpack(bData) if settings["business.blip"] ~= false then if sqlRow["bOwner"] == "For Sale" then addEventHandler( 'onPlayerLogin', root, function(getPlayerAccount) setElementData( source, 'account', getAccountName(getPlayerAccount(player))); triggerClientEvent(source,"createBizBlips", source) end); end end addEventHandler("onMarkerHit", bMarker, onBusinessMarkerHit) addEventHandler("onMarkerLeave", bMarker, onBusinessMarkerLeave) local timer = setTimer(businessPayout, sqlRow["bPayoutCurTime"] , 1, bMarker) setElementData(bMarker, "bData", {sqlRow["bID"], sqlRow["bName"], sqlRow["bOwner"], sqlRow["bCost"], sqlRow["bPayout"], sqlRow["bPayoutTime"], sqlRow["bPayoutOTime"], sqlRow["bPayoutUnit"], sqlRow["bBank"], timer}) end end end ---------------------------------------------------- this is client.lua ---------------this is bind bindKey( 'i', 'both', function( key, keyState ) if keyState == 'down' then for k, v in ipairs ( getElementsByType( 'marker', getResourceRootElement() ) ) do if getElementData( v, 'bOwner' ) and getElementData( v, 'bOwner' )[7] then if getElementData( v, 'bOwner' )[7] ~= '' then else createBlipAttachedTo( v, 52 ); end; end; end; else for k, v in ipairs( getElementsByType( 'marker', getResourceRootElement() ) ) do if getElementData( v, 'bOwner' ) then for k, elem in ipairs( getAttachedElements( v ) ) do if getElementType( elem ) == 'bBlip' then destroyElement( elem ); end; end; end; end; createBlips() end; end ); ------------------------ And this is the second part function getPlayerByAccountName( name ) for i, v in ipairs( getElementsByType( 'player' ) ) do if getElementData( v, 'account' ) == name then return v; end; end; return false; end; function creatbBlips() local account = getAccount(owner) for k, v in ipairs ( getElementsByType( 'marker', getResourceRootElement() ) ) do if getElementData( v, 'bOwner' ) and getElementData( v, 'bOwner' )[7] then if getElementData( v, 'bOwner' )[7] == getElementData( localPlayer, account) then createBlipAttachedTo( v, 52 ); end; end; end; end addEvent("createBizBlips",true) addEventHandler("createBizBlips",root,createBlips) createBlips() help me pleas :3 so, then I'm a terrible perplexity
  22. I want to drive cars from the server, mean cars are moving without non-player control.. Is it possible? I mean cars are spawned and drive automatically from the server.. Thanks
  23. For example, when i have 1.000.000$ convert to: 1M$, or if i have 2.400.000$ convert to: 2.44M$. How to make this possible?
  24. I want make a script, which make shorten the dx text. For example: if the dx text is "This is the dxtext", show instead of "This is the dxtext" -> "This is th...". How to make this? Sorry for my very bad english.
  25. Hi guys, as you see in many games especially in fps , when you hurt your screen turn red. Can you make me one?
×
×
  • Create New...