Jump to content

LucasBaker

Members
  • Posts

    134
  • Joined

  • Last visited

Posts posted by LucasBaker

  1. Just think about it. If you first set it visible to one player and then false for root. That player is children of root so it will not show. Set it first false to root then true for player. Same for blip
       setElementVisibleTo ( lixo1, playerTeam, true ) 
        setElementVisibleTo ( blip, playerTeam, true ) 
        setElementVisibleTo ( lixo1, root, false ) 
        setElementVisibleTo ( blip, root, false ) 
    

    like this ?

  2. Hello , I would like the marker to appear only for the team but who is this giving an error that I am unable to resolve the following code :

    lixo1 = createMarker(1516.41675, -1847.13733, 13.54688, 'cylinder', 2, 255, 0, 0, 150) 
      
    function aLixeiro (source) 
        outputChatBox("Você pegou o lixo na casa!", source, 255, 0, 0) 
        givePlayerMoney ( source, 50 ) 
        setElementPosition( lixo1, 0, 0, 0 ) 
        setTimer(function() 
            setElementPosition( lixo1, 1516.41675, -1847.13733, 13.54688 ) 
        end,2000,1) 
    end 
    addEventHandler( "onMarkerHit", lixo1, aLixeiro )  
      
    function onStart(source) 
    if getTeamName(getPlayerTeam(source)) == "Lixeiros" then 
            local playerTeam = getPlayerTeam ( source ) 
        local blip = createBlipAttachedTo( lixo1, 51, 2, 255, 0, 0, 255, 255, 255 ) 
        setElementVisibleTo ( lixo1, playerTeam, true ) 
        setElementVisibleTo ( blip, playerTeam, true ) 
        setElementVisibleTo ( lixo1, root, false ) 
        setElementVisibleTo ( blip, root, false ) 
       end 
    end 
    addEventHandler( "onMarkerHit", getRootElement(), onStart ) 
    

  3. O erro está na função createVehicle, primeiramente é o ID do veículo - que não confere com o do script (571), o outro erro está nas posições para criar o veículo.

    Código:

      
    function kart(M, _, T) 
        local x1, y1 = getElementPosition(M) 
        for _,Pl in ipairs(getElementsByType("player")) do 
            local x2, y2, z = getElementPosition(Pl) 
            local Distance = getDistanceBetweenPoints2D(x1, y1, x2, y2) 
            if (Distance <= 30) then 
                outputChatBox("#00FFFF[EVENTO] Você ganhou um Kart [571] ", Pl, 0, 255, 0, true) 
                createVehicle( 571, x2, y2, z + 10 ) 
            end 
        end 
    end 
    addCommandHandler("darkart", kart) 
    

    ah e uma dúvida tem como eu colocar para na hora de digitar /darveiculo [id] ? ( só para quem ta perto )

    Tente isto:

      
    addCommandHandler( "darveiculo", 
        function (playerSource, cmdName, ID) 
            local px, py = getElementPosition(playerSource) 
            local vehName = getVehicleNameFromModel(ID) 
            if ID and type(vehName) ~= "string" then 
                return outputChatBox("O ID do veículo é inválido", playerSource, 225, 0, 0) 
            elseif not ID then 
                return outputChatBox("Sintaxe: /darveiculo ID", playerSource, 225, 0, 0) 
            end 
            for _,Pl in ipairs(getElementsByType("player")) do 
                local x, y, z = getElementPosition(Pl) 
                local Distance = getDistanceBetweenPoints2D(px, py, x, y) 
                if (Distance <= 30) then 
                    outputChatBox("Você ganhou o veículo "..vehName, Pl, 0, 255, 0) 
                    createVehicle( ID, x, y, z + 6 ) 
                end 
            end 
        end 
    ) 
      
    

    o veículo cai em cima dele eahuyeagyusad como q faz pra ele ja entrar no carro ?

  4. local x, y, z = 1516.41675, -1847.13733, 13.54688 
    local lixo1 = createMarker(x, y, z, 'cylinder', 2.0, 255, 0, 0, 150) 
      
    function aLixeiro (source) 
        if getPlayerTeam (source, Lixeiros) then 
            outputChatBox("Você pegou o lixo na casa!", source, 255, 0, 0) 
            givePlayerMoney ( source, 50 ) 
            destroyElement(lixo1) 
            setTimer(function() 
                lixo1 = createMarker(x, y, z, 'cylinder', 2.0, 255, 0, 0, 150) 
            end, 2000, 1) 
        else 
            outputChatBox("Você não é lixeiro!", source, 255, 0, 0) 
        end 
    end 
    addEventHandler( "onMarkerHit", lixo1, aLixeiro ) 
    

    marker appears again after the function is not repeated

  5. exports.scoreboard:addScoreboardColumn("id", root, 1) 
      
    addEventHandler("onResourceStart", root, 
        function() 
            for id,player in ipairs(getElementsByType("player")) do 
                setElementData(player , "id", id) 
            end 
        end 
    ) 
      
    function getIDFromPlayer(player) 
            return getElementData(player , "id") 
    end 
      
    function getPlayerFromID(theID) 
        if theID then 
            local players = getElementsByType("player") 
            for i,p in ipairs(players) do 
                local id = getElementData(p, "id") 
                if theID == id then 
                    return p 
                end 
            end 
        end 
        return false 
    end 
    

    Not to create another topic How does the marker back to dps than 2 seconds ? I thought about using SetTimer but I do not do the slightest idea of how to use could help me ?

    lixo1 = createMarker(1516.41675, -1847.13733, 13.54688, 'cylinder', 2.0, 255, 0, 0, 150) 
    function aLixeiro (source) 
    if getPlayerTeam (source, Lixeiros) then 
    outputChatBox("Você pegou o lixo na casa!", source, 255, 0, 0) 
    givePlayerMoney ( source, 50 ) 
    destroyElement(lixo1) 
    else 
    outputChatBox("Você não é lixeiro!", source, 255, 0, 0) 
    end 
    end 
    addEventHandler( "onMarkerHit", lixo1, aLixeiro ) 
    

  6.   
    exports.scoreboard:addScoreboardColumn("id",getRootElement(),1) 
    function getIDFromPlayer(player) 
        if player then 
            local theid 
            players = getElementsByType("player") 
            for id,p in ipairs(players) do 
                if player == p then 
                    theid = i 
                end 
            end 
            return theid 
        else return false end 
    end 
      
    function getPlayerFromID(theID) 
        if theID then 
            theID = tonumber(theID) 
            local theplayer 
            players = getElementsByType("player") 
            for id,p in ipairs(players) do 
                if theID == id then 
                    theplayer = p 
                end 
            end 
            return theplayer 
        else return false end 
    end 
    

    why not appear on the scoreboard id?

  7. function kart(M, _, T) 
            local x1, y1 = getElementPosition(M) 
            for _,Pl in ipairs(getElementsByType("player")) do 
                local x2, y2 = getElementPosition(Pl) 
                local Distance = getDistanceBetweenPoints2D(x1, y1, x2, y2) 
                if (Distance <= 30) then 
                outputChatBox("#00FFFF[EVENTO] Você ganhou um Kart [571] ", Pl, 0, 255, 0, true)  
                createVehicle ( 432, Pl + 10 ) 
                end 
       end 
            end 
    addCommandHandler("darkart", kart) 
    

    o que ta errado? -_-

    ah e uma dúvida tem como eu colocar para na hora de digitar /darveiculo [id] ? ( só para quem ta perto )

  8. http://translate.google.com/translate_tts?tl=linguagem&q=texto

    É isso que você quer dizer?

    Ou se é mesmo a API, você já deve saber que é paga, certo?

    E se não conseguir encontrar gratuitamente, você pode usar uma avaliação gratuita.

    eu to tentando criar um script de tradutor.. no java a gente usava a api do google mas como ela não ta + disponivel creio eu, achei q alguem tinha aki mas vou tentar usar isso ae. eu terei q usar acesso a alguma coisa tem algum elemento q faz isso ?

    no caso seria a api em php ( pra lua )

  9. The error is here:
    if ( not isObjectInACLGroup ( "user.".. getPlayerAccount(Pl), aclGetGroup ( "Admin" ) ) ) then 
    

    You aren't obtaining his account name, just the account userdata, you have to use getAccountName:

    if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( Pl ) ), aclGetGroup ( "Admin" ) ) ) then 
    

    thx

  10. function freezar(M, _, T) 
            local x1, y1 = getElementPosition(M) 
            for _,Pl in ipairs(getElementsByType("player")) do 
                local x2, y2 = getElementPosition(Pl) 
                local Distance = getDistanceBetweenPoints2D(x1, y1, x2, y2) 
                if (Distance <= 30) then 
                if not ( isObjectInACLGroup ( "user.".. getPlayerAccount(Pl), aclGetGroup ( "Admin" ) ) ) then -- pra não congela os adm 
                   toggleAllControls ( Pl, false ) 
                   setElementFrozen ( Pl, true ) 
                    outputChatBox("#00FFFF[EVENTO] Você foi congelado", Pl, 0, 255, 0, true)  
                end 
            end 
        end 
        end 
    addCommandHandler("congelar", freezar) 
      
    

    What I want the function to work for All Less admins but the error value

  11. function darVida(M, _, T) 
        if T == "1" then 
            local x1, y1 = getElementPosition(M) 
            for _,Pl in ipairs(getElementsByType("player")) do 
                local x2, y2 = getElementPosition(Pl) 
                local Distance = getDistanceBetweenPoints2D(x1, y1, x2, y2) 
                if (Distance <= 10) then 
                    setElementHealth(100, Pl) 
                    outputChatBox("Você recebeu vida", Pl) 
                end 
            end 
        end 
    end 
    addCommandHandler("darvida", darVida) 
    

    did not work

  12. function darVida (M, T) 
    if T == 1 then 
    local PlayersP = getElementByType("player")) 
    for _,Pl in ipairs(PlayersP) do 
    local x,y,z = getElementPosition(Pl) 
    local x2,y2,z2 = getElementPosition(source) 
    local Distance = getDistanceBetweenPoints2D ( x,y, x2,y2 ) 
    if (Distance <= 10) then 
    setElementHealth(100, Pl) 
    outputChatBox ( "Você recebeu vida", Pl ) 
    end 
    end 
    end 
    end 
    addCommandHandler ( "darvida", darVida ) 
    

    the script would be to give life to those who have a distance of 10 but nothing happens, what error?

  13. Bad argument in line 15 to add the player in acl GV M does not appear the message to him

    function giveGroove (playerSource, commandName, accountName)  
        if accountName then  
            aclGroupAddObject (aclGetGroup("GV M"), "user."..accountName)  
            outputChatBox ("[sERVER] Player '"..accountName.."' adicionado com sucesso na Gangue Groove Street", playerSource) 
            outputChatBox ("[sERVER] Você foi adicionado a Gangue Groove Street.", accountName) 
        else  
            outputChatBox ("[sERVER] Conta não especificada.", playerSource) 
            outputChatBox ("Correct syntax: /convidargv [accountName]", playerSource) 
        end 
    end 
      
    addCommandHandler ("convidargv", giveGroove) 
    

    could someone help me?

  14. basepfs = createMarker(238.62816, 140.98083, 1003.02344, 'cylinder', 1.0, 255, 0, 0, 150) 
      
    function sairBasePF(player) 
    setElementDimension (basepfs, 0) 
    setElementInterior (basepfs, 3) 
    isElementWithinMarker(player, basepfs) 
    outputChatBox("[sERVER] Você saiu da HQ da Polícia Federal", player, 0, 255, 0) 
    setElementPosition (player, x, y, z) 
    setElementInterior (player, 0) 
    end 
    addEventHandler( "onMarkerHit", basepfs, sairBasePF ) 
    

    3 debugscript not appear in an error and will not appear on the marker position

  15. título.. não achei o argumento na wiki

    basepfs = createMarker(238.66330, 140.54947, 1003.02344, 'cylinder', 1.0, 255, 0, 0, 150)

    Você tem que usar:

    createMarker

    setElementInterior

    basepfs = createMarker(238.66330, 140.54947, 1003.02344, 'cylinder', 1.0, 255, 0, 0, 150) 
      
    function sairBasePF(player) 
    setElementInterior ( basepfs, 3 ) 
    if isElementWithinMarker(player, basepfs) then 
    outputChatBox("[sERVER] Você saiu da HQ da Polícia Federal", player, 0, 255, 0) 
    setElementPosition (player, 238.65007, 140.62941, 1003.02344) 
    setElementInterior (player, 0) 
    else 
    outputChatBox("[ERRO] Você não está no marker", player, 250, 128, 114) 
    end 
    end 
    addEventHandler( "onMarkerHit", basepfs, sairBasePF ) 
    

    o marker não aparece no interior

  16. dutymarker = createMarker(334.50107, -1510.39063, 35.86719, 'cylinder', 2.0, 255, 0, 0, 150) 
      
    function duty(player) 
     if isElementWithinMarker(player, dutymarker) and getTeamName(getPlayerTeam(player)) == "Policia Federal" then 
       outputChatBox("Você é da Polícia Federal", player, 255, 0, 0)   
     else 
        outputChatBox("Você não é da Polícia Federal", player, 255, 0, 0) 
     end 
    end 
    addCommandHandler("npm", duty) 
    

    and if I want to get a message to appear on the marker?

    viewtopic.php?f=91&t=41210

    but in chat

  17. dutymarker = createMarker(334.50107, -1510.39063, 35.86719, 'cylinder', 2.0, 255, 0, 0, 150) 
      
    function duty(player) 
     if isElementWithinMarker(player, dutymarker) and getTeamName(getPlayerTeam(player)) == "Policia Federal" then 
       outputChatBox("Você é da Polícia Federal", player, 255, 0, 0)   
     else 
        outputChatBox("Você não é da Polícia Federal", player, 255, 0, 0) 
     end 
    end 
    addCommandHandler("npm", duty) 
    

    and if I want to get a message to appear on the marker?

  18.   
    dutymarker = createMarker(334.50107, -1510.39063, 35.86719, 'cylinder', 2.0, 255, 0, 0, 150) 
    verificar =  getplayerTeam (source, Policia Federal) 
      
    function duty(source) 
     if isElementWithinMarker(source, dutymarker, verificar) then 
       outputChatBox("Você é da Polícia Federal", source, 255, 0, 0)   
     else 
        outputChatBox("Você não é da Polícia Federal", source, 255, 0, 0) 
     end 
    end 
    addCommandHandler("npm", duty) 
    

    It Does not Work?

    the getplayerteam was to check if the player 's team to enter / npm

  19.   
      
    setTimer ( function(source) 
      
        setPedAnimation( source, false) 
      
        outputChatBox("[sERVER] Efeito das drogas passou", source) 
      
        end, 2000, 1 ,source ) 
      
    

    worked

    ...

×
×
  • Create New...