Jump to content

Aruna

Members
  • Posts

    72
  • Joined

  • Last visited

Posts posted by Aruna

  1. Hola a todos quisiera saber si alguien sabe que string tengo que hacerle para que no me salga ese tal error

    1199xys.png

    attached_ped = {} 
    attached_bone = {} 
    attached_x = {} 
    attached_y = {} 
    attached_z = {} 
    attached_rx = {} 
    attached_ry = {} 
    attached_rz = {} 
      
    function attachElementToBone(element,ped,bone,x,y,z,rx,ry,rz) 
        if not (isElement(element) and isElement(ped)) then return false end 
        if getElementType(ped) ~= "ped" and getElementType(ped) ~= "player" then return false end 
        bone = tonumber(bone) 
        if not bone or bone < 1 or bone > 20 then return false end 
        x,y,z,rx,ry,rz = tonumber(x) or 0,tonumber(y) or 0,tonumber(z) or 0,tonumber(rx) or 0,tonumber(ry) or 0,tonumber(rz) or 0 
        attached_ped[element] = ped 
        attached_bone[element] = bone 
        attached_x[element] = x 
        attached_y[element] = y 
        attached_z[element] = z 
        attached_rx[element] = rx 
        attached_ry[element] = ry 
        attached_rz[element] = rz 
        if setElementCollisionsEnabled then 
            setElementCollisionsEnabled(element,false) 
        end 
        if script_serverside then 
            triggerClientEvent("boneAttach_attach",root,element,ped,bone,x,y,z,rx,ry,rz) 
        end 
        return true 
    end 
      
    function detachElementFromBone(element) 
        if not element then return false end 
        if not attached_ped[element] then return false end 
        clearAttachmentData(element) 
        if setElementCollisionsEnabled then 
            setElementCollisionsEnabled(element,true) 
        end 
        if script_serverside then 
            triggerClientEvent("boneAttach_detach",root,element) 
        end 
        return true 
    end 
      
    function isElementAttachedToBone(element) 
        if not element then return false end 
        return isElement(attached_ped[element]) 
    end 
      
    function getElementBoneAttachmentDetails(element) 
        if not isElementAttachedToBone(element) then return false end 
        return attached_ped[element],attached_bone[element], 
            attached_x[element],attached_y[element],attached_z[element], 
            attached_rx[element],attached_ry[element],attached_rz[element] 
    end 
      
    function setElementBonePositionOffset(element,x,y,z) 
        local ped,bone,ox,oy,oz,rx,ry,rz = getElementBoneAttachmentDetails(element) 
        if not ped then return false end 
        return attachElementToBone(element,ped,bone,x,y,z,rx,ry,rz) 
    end 
      
    function setElementBoneRotationOffset(element,rx,ry,rz) 
        local ped,bone,x,y,z,ox,oy,oz = getElementBoneAttachmentDetails(element) 
        if not ped then return false end 
        return attachElementToBone(element,ped,bone,x,y,z,rx,ry,rz) 
    end 
      
    if not script_serverside then 
        function getBonePositionAndRotation(ped,bone) 
            bone = tonumber(bone) 
            if not bone or bone < 1 or bone > 20 then return false end 
            if not isElement(ped) then return false end 
            if getElementType(ped) ~= "player" and getElementType(ped) ~= "ped" then return false end 
            if not isElementStreamedIn(ped) then return false end 
            local x,y,z = getPedBonePosition(ped,bone_0[bone]) 
            local rx,ry,rz = getEulerAnglesFromMatrix(getBoneMatrix(ped,bone)) 
            return x,y,z,rx,ry,rz 
        end 
    end 
      
    ------------------------------------ 
      
    function clearAttachmentData(element) 
        attached_ped[element] = nil 
        attached_bone[element] = nil 
        attached_x[element] = nil 
        attached_y[element] = nil 
        attached_z[element] = nil 
        attached_rx[element] = nil 
        attached_ry[element] = nil 
        attached_rz[element] = nil 
    end 
      
    function forgetDestroyedElements() 
        if not attached_ped[source] then return end 
        clearAttachmentData(source) 
    end 
    addEventHandler(script_serverside and "onElementDestroy" or "onClientElementDestroy",root,forgetDestroyedElements) 
      
    function forgetNonExistingPeds() 
        local checkedcount = 0 
        while true do 
            for element,ped in pairs(attached_ped) do 
                if not isElement(ped) then clearAttachmentData(element) end 
                checkedcount = checkedcount+1 
                if checkedcount >= 1000 then 
                    coroutine.yield() 
                    checkedcount = 0 
                end 
            end 
            coroutine.yield() 
        end 
    end 
    clearing_nonexisting_peds = coroutine.create(forgetNonExistingPeds) 
    setTimer(function() coroutine.resume(clearing_nonexisting_peds) end,1000,0) 
      
    

  2. Hola he intentado colocar una restriccion por lvl al sistema de shop, es decir Si un usuario quiere comprar tal cosa el shop este personalizado EJ

    Chaleco requiere ser lvl 5 y tener un cash de $500

    Como podria hacerlo?

    aqui le dejo el lua

    function BuyWeaponOnServer(skins_name,data,value) 
        player_money = getPlayerMoney(source) 
      
            if(skins_name == "Skin_Ghillie") then 
                if ( player_money >= 500) then 
                    setElementData(source, "Traje de Ghillie Desierto",getElementData(source,"Traje de Ghillie Desierto") + 1) 
                    takePlayerMoney(source, 50) 
                    outputChatBox("#FF0000[sHOP] #FFFFFFTraje de Ghillie Desierto Articulo Comprado", source, 255, 255, 255 , true) 
                else 
                    outputChatBox("#FF0000[sHOP] #FFFFFF Usted no tiene suficiente dinero.  [Compra más cash contactandote un Administrador]. ", source, 255, 255, 255 , true) 
    end 
    end 
            if(skins_name == "Skin_Civilian") then 
                  if ( player_money >= 50) then 
                    setElementData(source, "Traje de Payday",getElementData(source,"Traje de Payday") + 1) 
                    takePlayerMoney(source, 50) 
                    outputChatBox("#FF0000[sHOP] #FFFFFFTraje de Payday Articulo Comprado", source, 255, 255, 255 , true) 
                else 
                    outputChatBox("#FF0000[sHOP] #FFFFFF Usted no tiene suficiente dinero.  [Compra más cash contactandote un Administrador]. ", source, 255, 255, 255 , true) 
                end 
        end 
                if(skins_name == "Skin_Camouflage") then 
                  if ( player_money >= 50) then 
                    setElementData(source, "Traje de Militar",getElementData(source,"Traje de Militar") + 1) 
                    takePlayerMoney(source, 50) 
                    outputChatBox("#FF0000[sHOP] #FFFFFFTraje de Militar Articulo Comprado", source, 255, 255, 255 , true) 
                else 
                    outputChatBox("#FF0000[sHOP] #FFFFFF Usted no tiene suficiente dinero.  [Compra más cash contactandote un Administrador]. ", source, 255, 255, 255 , true) 
                end 
        end 
                if(skins_name == "Skin_Survivor") then 
                  if ( player_money >= 50) then 
                    setElementData(source, "Traje de Ghillie Suit",getElementData(source,"Traje de Ghillie Suit") + 1) 
                    takePlayerMoney(source, 50) 
                    outputChatBox("#FF0000[sHOP] #FFFFFFTraje de Ghillie Suit Articulo Comprado", source, 255, 255, 255 , true) 
                else 
                    outputChatBox("#FF0000[sHOP] #FFFFFF Usted no tiene suficiente dinero.  [Compra más cash contactandote un Administrador]. ", source, 255, 255, 255 , true) 
                end 
        end 
    end 
    addEvent("onClientBuySkin", true) 
    addEventHandler("onClientBuySkin", getRootElement(), BuyWeaponOnServer) 
    

  3. Algo así sería, luego puedes usar un condicional (if) y si tiene warnC == 3 realizar un kick, etc.
      
    function getPlayerFromNamePart(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 warnPlayer_CMD(thePlayer, theCMD, theTarget, ...) 
     local accN = getAccountName ( getPlayerAccount (thePlayer) ) 
    local groupName = "Admin" or "Moderator" or "SuperModerator" or "Console" -- you can add more 
    if groupName then 
        if theTarget ~= nil and isObjectInACLGroup ("user."..accN,aclGetGroup (groupName) ) -- missing bracket 
            
            then 
      
            local theTargetElement = getPlayerFromNamePart(theTarget) 
      
            if(getElementType(theTargetElement) == "player") then 
      
                local allArgs = {...} 
                local data = getElementData(theTargetElement,"warnC")or 0 
                local theReason = table.concat(allArgs, " ") 
                 
                setElementData(theTargetElement,"warnC", data + 1) 
                outputChatBox("#ff0000[ADVERTENCIA]: "..getPlayerName(thePlayer).."#FFFFFF advertio a "..getPlayerName(theTargetElement).." ("..tostring(data).."/3)", getRootElement(), 255, 0, 0, true) 
                outputChatBox("#ff0000[ADVERTENCIA]: #ffffffRazon: #FFFFFF("..tostring(theReason)..")", getRootElement(), 255, 0, 0, true) 
      
            else 
      
                outputChatBox("#ff0000[ADVERTENCIA]: #ffffffInvalid target! Syntax: /warn [player] [reason]", thePlayer, 255, 0, 0, true) 
                  end 
            end 
      
        end 
      
    end 
      
    addCommandHandler("warn", warnPlayer_CMD, false) 
    

    Gracias :D

  4. Hola me podrían ayudar a realizar lo siguiente, con el siguiente Scripts un Administrador puede Advertir a un usuario, pero yo quiero que las Advertencia queden acumuladas osea guardadas, es decir que Si yo Advierto a "X" usuario el usuario tenga 1/3 y en la siguiente advertencia se le sume 2/3 y asi sucesivamente.

      
    function getPlayerFromNamePart(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 warnPlayer_CMD(thePlayer, theCMD, theTarget, ...) 
     local accN = getAccountName ( getPlayerAccount (thePlayer) ) 
    local groupName = "Admin" or "Moderator" or "SuperModerator" or "Console" -- you can add more 
    if groupName then 
        if theTarget ~= nil and isObjectInACLGroup ("user."..accN,aclGetGroup (groupName) ) -- missing bracket  
             
            then 
      
            local theTargetElement = getPlayerFromNamePart(theTarget) 
      
            if(getElementType(theTargetElement) == "player") then 
      
                local allArgs = {...} 
      
                local theReason = table.concat(allArgs, " ") 
      
                outputChatBox("#ff0000[ADVERTENCIA]: "..getPlayerName(thePlayer).."#FFFFFF advertio a "..getPlayerName(theTargetElement).."", getRootElement(), 255, 0, 0, true) 
      
                outputChatBox("#ff0000[ADVERTENCIA]: #ffffffRazon: #FFFFFF("..tostring(theReason)..")", getRootElement(), 255, 0, 0, true) 
      
            else 
      
                outputChatBox("#ff0000[ADVERTENCIA]: #ffffffInvalid target! Syntax: /warn [player] [reason]", thePlayer, 255, 0, 0, true) 
                  end 
            end 
      
        end 
      
    end 
      
    addCommandHandler("warn", warnPlayer_CMD, false) 
      
    

  5. Alguien me da una mano :c

            local nivel = exports.exp_system:getPlayerLevel ( thePlayer ) 
            local message = messagePrefix .. colorCodes.colorcode2 .. string.gsub ( ( getPlayerName ( playersource ) .. " : " ), '#%x%x%x%x%x%x', '' ) ..tostring ("[Lvl:"..nivel.."]") .. colorCodes.colorcode3 .. msg --precreate the message string 
            local message = string.sub ( message, 1, outputLimit ) --since the chatbox won't display messages with more than 128 characters we just drop the ones at the end 
            local r, g, b = getColorFromString ( colorCodes.colorcode1 )         
            outputChatBox ( message, root, r, g, b, true ) 
             
            playerTickTable[playersource] = getTickCount ( )  
        end 
            end 
    addCommandHandler ( "Globalchat", playeGlobalChat ) 
    

  6.         local nivel = getPlayerLevel (thePlayer) 
      
            local message = messagePrefix .. colorCodes.colorcode2 .. string.gsub ( ( getPlayerName ( playersource ) .. " : " ), '#%x%x%x%x%x%x', '' ) ..tostring ("[Lvl:"..nivel.."]") .. colorCodes.colorcode3 .. msg --precreate the message string 
            local message = string.sub ( message, 1, outputLimit ) --since the chatbox won't display messages with more than 128 characters we just drop the ones at the end 
            local r, g, b = getColorFromString ( colorCodes.colorcode1 )         
            outputChatBox ( message, root, r, g, b, true ) 
             
            playerTickTable[playersource] = getTickCount ( )  
        end 
            end 
    addCommandHandler ( "Globalchat", playeGlobalChat ) 
    

    Estaba tratando de conectar el nivel del jugador al mensaje Global cada vez que escribe.

  7. Hola quiero hacer una variable y me dice lo siguiente

    attemp to call global 'getPlayerLevel' (a nil value)

    Este es lo que hice

            local level = getPlayerLevel 
    

  8. Hola una pregunta he intentado agregar una fila de FPS pero me tira error he buscado por la Wiki de MTA y no he encontrado nada alguien me puede ayudar. EJ la del Ping o Money es facil porque usamos

    getPlayerMoney y getPlayerPing pero en el FPS no hay nada :S

    yA = 0 
    local screenWidth, screenHeight = guiGetScreenSize() 
    local sw, sh = guiGetScreenSize() 
      
    scoreboardColumns = { 
        { name = "Nombre", width = 180, data = function (element) return getPlayerName ( element ) end }, 
        { name = "Asesinato", width = 80, data = function (element) return ( getElementData ( element, "murders" ) or 0 ) end }, 
        { name = "Z Asesinados", width = 80, data = function (element) return ( getElementData ( element, "zombieskilled" ) or 0 ) end }, 
        { name = "Supervivencia", width = 80, data = function (element) return formatTimeFromMinutes(getElementData ( element, "alivetime" ) or 1 ) end }, 
        { name = "Clan", width = 100, data = function (element) return getElementData ( element, "gang" ) or "None" end }, 
        { name = "Ping", width = 60, data = function (element) return getPlayerPing ( element, "ping" ) end }, 
    } 
      
    local serverName = "ScoreBoard                                                                            Argentina-America " -- название сервера 
    local topsize = 60 -- величина шляпы 
    local playersize = topsize-30 -- высота одной строки 
    local panelsize = playersize*10 -- величина панели 
      
    function calculateWidth() 
        local width = 0 
        for key, value in ipairs( scoreboardColumns ) do 
            width = width + value.width 
        end 
        return width + 60 
    end  
      
    local max_players = 0 
    local ploff = 0 
    local width = calculateWidth() 
    local baseX = sw/2-width/2 
    local baseY = sh/2-(panelsize+topsize)/2 
      
    addEventHandler( "onClientRender", root, 
        function() 
            if getKeyState( "tab" ) == false then ploff = 0; return end 
            if getElementData(getLocalPlayer(),"logedin") then 
                dxDrawRectangle ( baseX, baseY, width, topsize, tocolor(32,32,32) ) 
                dxDrawText ( serverName, baseX+20, baseY+10, baseX+width, baseY+topsize, tocolor(231,119,0), 0.9, "default-bold" ) 
                 
                dxDrawRectangle ( baseX, baseY+topsize, width, panelsize, tocolor(0,0,0,150) ) 
                 
                dxDrawLine ( baseX, baseY+30, baseX+width, baseY+30, tocolor(100,100,100),0.8 ) 
                dxDrawLine ( baseX, baseY+30, baseX, baseY+panelsize+topsize, tocolor(100,100,100),0.8 ) 
                dxDrawLine ( baseX, baseY+panelsize+topsize, baseX+width, baseY+panelsize+topsize, tocolor(100,100,100),0.8 ) 
                 
                dxDrawLine ( baseX+40, baseY+30, baseX+40, baseY+panelsize+topsize, tocolor(100,100,100),0.8 ) 
                dxDrawText ( "№", baseX, baseY+60, baseX+40, baseY+topsize-30, tocolor(0,186,255), 1, "default-bold", "center", "center" ) 
                local xoff = 60 
                for i, v in ipairs ( scoreboardColumns ) do 
                    dxDrawLine ( baseX+xoff+v.width, baseY+30, baseX+xoff+v.width, baseY+panelsize+topsize, tocolor(100,100,100),0.8 ) 
                    dxDrawText ( v.name, baseX+xoff, baseY+60, baseX+xoff+v.width, baseY+topsize-30, tocolor(255,255,255), 1, "default-bold", "center", "center" ) 
                    xoff = xoff+v.width 
                end 
                local playersTable = getElementsByType ( "player" ) 
                --local playersTable = { localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer } 
             
                dxDrawText ( "Jugadores: "..tostring(#playersTable), baseX+20, baseY+10, baseX+width-20, baseY+topsize, tocolor(0,186,255), 0.9, "default-bold", "right" ) 
      
                local maxNum = #playersTable 
                if maxNum > 10 then 
                    maxNum = 10 
                end 
                for i = 1, maxNum do 
                    dxDrawLine ( baseX, baseY+topsize+playersize*i, baseX+width, baseY+topsize+playersize*i, tocolor(100,100,100),0.8 ) 
                    dxDrawText ( i+ploff, baseX, baseY+topsize+playersize*(i-1), baseX+40, baseY+topsize+playersize*i, tocolor(255,255,255), 1, "default-bold", "center", "center" ) 
                    if playersTable[i+ploff] == localPlayer then 
                        dxDrawRectangle ( baseX, baseY+topsize+playersize*(i-1), width, playersize, tocolor(112,112,112,100) ) 
                    end 
                    local xoff = 60 
                    for c, d in ipairs ( scoreboardColumns ) do 
                        local data = d.data(playersTable[i+ploff]) 
                        local r,g,b = 43,250,86 
                        if d.name == "Clan" and data == "None" then 
                            r,g,b = 255,0,0 
                            data = "Sin Clan" 
                        end 
                        dxDrawText ( data, baseX+xoff, baseY+topsize+playersize*(i-1), baseX+xoff+d.width, baseY+topsize+playersize*i, tocolor(r,g,b), 1, "default-bold", "center", "center" ) 
                        xoff = xoff+d.width 
                    end 
                end 
            end 
        end 
    ) 
    

  9.   
    addCommandHandler("removeFromID",  
        function ( player, _, 476 ) 
            temp = 0 
            for _, vehicles in ipairs ( getElementsByType ( "vehicle" ) ) do 
                if getElementModel ( vehicles ) == tonumber ( 476 ) then 
                    destroyElement ( vehicles ) 
                    temp = temp + 1 
                end 
            outputChatBox("Se han borrado: " .. tostring ( temp ) .. " " .. getVehicleNameFromModel ( tonumber ( 476 ) ) .. temp > 1 and "s" or "", player, 0, 255, 0) 
            end 
        end 
    end 
    ) 
      
    

    en donde dice "ID" remplazo la id del vehiculo a eliminar?

  10. Hola

    Como puedo hacer un script o alguien que lo tenga lo podría compartir.

    Ej: al ejecutar el script y usar un comando elimine todo los vehiculos de una ID dicha en el script, osea quiero decir

    que si quiero destruir todos los Rustler del mapa, colocar la id de ese vehiculo en el script y iniciar el comando para destruir todo los rustler del servidor.

    No se si me explico

    Gracias :D

  11. Hola tengo un problema con este script de registro, cuando hago desde el Cliente con un panel no me deja registrarme

    Ustedes ven alguna falla en el script SERVER?

    local root = getRootElement() 
    tryToLoginPlayer = function(username, password) 
      local account = getAccount(username, password) 
      if account then 
        local accountName = getAccountName(account) 
        logIn(source, account, password) 
        triggerClientEvent(source, "onPlayerDoneLogin", source, accountName, password) 
        triggerEvent("onPlayerDayZLogin", getRootElement(), username, pass, source) 
      else 
        outputChatBox("[Login]#FF9900 Contraseña o Cuenta Incorrecta", source, 255, 255, 255, true) 
      end 
    end 
    addEvent("onClientSendLoginDataToServer", true) 
    addEventHandler("onClientSendLoginDataToServer", root, tryToLoginPlayer) 
      
    tryToRegsiterPlayer = function(username, pass) 
      if not getAccount(username) then 
        theAccount = addAccount(username, pass) 
        if theAccount then 
          logIn(source, theAccount, pass) 
          outputChatBox("Registraste la cuenta" .. username .. "' Jugador '" .. getPlayerName(source) .. "'#FFFFFF su contraseña '" .. pass .. "'!", source, 255, 255, 255, true) 
          triggerClientEvent(source, "onPlayerDoneLogin", source, username, pass) 
          triggerEvent("onPlayerDayZRegister", getRootElement(), username, pass, source) 
        else 
          reason = "Error Desconocido, Preciona F8 y usa: (Register  !" 
          outputChatBox("[Login]#FF9900 " .. reason, source, 255, 255, 255, true) 
        end 
      else 
        reason = "Ya existe esa cuenta" 
        outputChatBox("[Login]#FF9900 " .. reason, source, 255, 255, 255, true) 
      end 
    end 
      
    addEvent("onClientSendRegisterDataToServer", true) 
    addEventHandler("onClientSendRegisterDataToServer", getRootElement(), tryToRegsiterPlayer) 
    

  12. Hola quisiera hacer una pregunta como puedo hacer un log de esto

    osea quiero que se me cree un documento de texto o archivo .xml en la carpeta "logs" y se agregue los siguientes datos

    function build_loginWin() 
        guiSetInputMode("no_binds_when_editing") 
        showCursor(true) 
        confFile = xmlLoadFile("preferencesL.xml") 
        if (confFile) then 
            infoTable["account"] = xmlNodeGetAttribute(confFile,"username") 
            infoTable["pass"] = xmlNodeGetAttribute(confFile,"pass") 
        else 
            confFile = xmlCreateFile("preferencesL.xml","user") 
            xmlNodeSetAttribute(confFile,"username","") 
            xmlNodeSetAttribute(confFile,"pass","") 
             
            infoTable["account"] = getPlayerName(localPlayer) 
            infoTable["pass"] = "" 
        end 
        xmlSaveFile(confFile) 
        confFile = xmlLoadFile("preferences.xml") 
        if (confFile) then 
            xmlNodeSetAttribute(confFile,"username","") 
            xmlNodeSetAttribute(confFile,"pass","") 
        end 
    

  13. Hola quisiera hacer una pregunta si es posible realizar lo siguiente.

    Digamos que un Administrador al realizar un comando ej /duty y al colocar ese comando salga un mensaje en root diciendo

    Tal administrador esta en servicio. Hasta acá se que es posible, pero al estar en servicio, salir con un blips o punto de color en el Radar. osea Marcando la posicion del Administrador a todo los usuarios.

    queria saber si eso era posible

    Muchas Gracias

  14. Hola una pregunta quisiera saber como podria hacer un Script en la cual se pueda darle dinero a un usuario estando Offline

    osea sabiendo solamente su account (su cuenta) agregarle dinero

    Ej mi cuenta es aruna y otro admin coloca /moneygive aruna 5000.

    y ese dinero sea acreditado mientras el usuario esta Offline

    Gracias

  15. esto sirve?

    function sendChatMessage(ply) 
        outputDebugString("sendChatMessage: " .. tostring(ply)) 
        if chat[ply] and isElement(chat[ply].wnd) then 
            local newText = guiGetText(chat[ply].edit) 
            if newText and string.len(newText) > 0 then 
                local oldText = guiGetText(chat[ply].memo) 
                if not oldText then oldText = "" end 
                oldText = oldText .. getPlayerName(g_LocalPlayer) .. ": " .. newText .. "\n" 
                guiSetText(chat[ply].memo, oldText) 
                guiSetText(chat[ply].edit, "") 
                guiMemoSetCaretIndex(chat[ply].memo, string.len(oldText)) 
      
                triggerServerEvent("onGUIPrivateMessage", g_LocalPlayer, ply,newText)  
            end  
        end 
    end 
    function recieveChatMessage(ply, msg) 
        outputDebugString("recieveChatMessage: " .. msg) 
        if not chat[ply] then 
            buildChatWindow(ply) 
        end 
         
        newmsg.show = true 
        newmsg.tick = getTickCount() 
         
        ---guiSetText(newmsg.lbl, getPlayerName(ply) .. ": " .. msg .. "\n") 
    guiSetText(newmsg.lbl, "Tiene UN Mensage " .. getPlayerName(ply) .. "\n") 
        anims.nmfadein:play() 
        anims.nmtextin:play() 
        --anims.nmslidein:play() 
      
        local oldText = guiGetText(chat[ply].memo) 
        if not oldText then oldText = "" end 
        oldText = oldText .. getPlayerName(ply) .. ": " .. msg .. "\n" 
        guiSetText(chat[ply].memo, oldText) 
        guiMemoSetCaretIndex(chat[ply].memo, string.len(oldText)) 
    end 
    

  16. Porque me sale Este error tan seguido??

    fdbnf4.png

    local checkframes=0 
    local ShowPanel 
    local mapname 
      
    fps=99 
    ping=0 
    hours=0 
    minutes=0 
    frames,lastsec=0,0,0 
    localPlayer = getLocalPlayer() 
    font = {} 
    font[1] = guiCreateFont( "font.ttf", 12 ) 
      
    function checkInfo () 
        --FRAME 
        local frameticks=getTickCount() 
        frames=frames+1 
        if frameticks-1000>lastsec then 
            local prog=(frameticks-lastsec) 
            lastsec=frameticks 
            fps=frames/(prog/1000) 
            frames=fps*((prog-1000)/1000) 
            guiSetText (FPSlabel, "FPS: " .. fps) 
        end 
        --PING 
        ping = getPlayerPing(getLocalPlayer()) 
        guiSetText (Pinglabel, "| Ping: " .. ping .. " | ") 
         
        --[[TIME 
        rtime = getRealTime() 
        hours = rtime.hour 
        minutes = rtime.minute 
        guiSetText (Timelabel, hours  .. ":" .. minutes .. " | ") 
        ]] 
        
         
    end 
      
      
      
    function InfoOff () 
    guiSetVisible(OnOf, false) 
    guiSetVisible(allINone, false) 
    guiSetVisible(FBlabel, false) 
    end 
    addCommandHandler ( "fpoff", InfoOff) 
      
    function InfoOn () 
    guiSetVisible(OnOf, true) 
    guiSetVisible(allINone, true) 
    guiSetVisible(FBlabel, true) 
    end 
    addCommandHandler ( "fpon", InfoOn) 
      
    addEventHandler('onClientResourceStart', resourceRoot,  
    function() 
      
        sWidth, sHeight = guiGetScreenSize()  
        OFpos = math.floor(sWidth - 180) 
        OFFpos = math.floor(sWidth - 370) 
      
         
         
        --Timelabel = guiCreateLabel(3, 3, 70, 23,"  |  " .. hours .. ":" .. minutes, false) 
        FPSlabel = guiCreateLabel(49, 3, 42 , 23,"FPS:" .. fps, false) 
        Pinglabel = guiCreateLabel(95, 3, 70, 23,"PING: " .. ping .. " | ", false) 
         
         
        --allINone = guiCreateLabel(508, 5, 800, 290, "Loading informations...", false)       
        -- allINone = guiCreateLabel(600, 3, 1000, 290,"Loading informations...", false) 
        -- guiLabelSetColor(allINone,58, 190, 87) 
        -- guiSetFont(allINone,font[1]) 
    end 
    ) 
      
    function WriteToLine () 
    guiSetText(allINone, "FPS: " .. string.gsub(fps,"%.%d*","") .. " | " .. "PING: " .. ping .."") 
      
    end 
      
      
    addEventHandler ( "onClientRender", root, checkInfo) 
    addEventHandler ( "onClientRender", root, WriteToLine) 
    addEventHandler ("onClientMapStarting", root ,checkmapname) 
    

  17. Hola como puedo hacer que cuando un usuario este registrado en la ACL osea "user." este script le de 2doble de dinero al matar un zombie, si no esta agregado en el ACL directamente le di un valor menor con el ACLgroup Everyone

    addEventHandler( "onZombieGetsKilled", getRootElement(), 
        function( killer ) 
        givePlayerMoney( killer, 5 ); 
    end 
    ) 
    

  18. Para hacerlo por ACL podes usar esto:
    isObjectInACLGroup  
    

    Y no te sabría decir el metodo para el Group System de castillo porque nunca lo utilizé.

    Si si, eso ya esta echo en ACL el script completo, solamente quiero saber como hacer que el mensaje del

    outputChatBox salga para los adm nada mas

  19. Hola Gente, quisiera saber si es posible realizar esto

    Yo no quiero que este mensaje cuando salga en el Mensaje Global (getRootElement) ni en local de thePlayer

    se podria editar para que le salga de alguna forma a los Admin por algun tipo de chat ACL o Group system de castillo??

    esto seria para ver los ADM que se givean los vip y si abusan.

    esto vendria siendo el codigo

    function VidaeColete() 
        name = getPlayerName ( source ) 
        setElementData(source,"CZ 550 Mag",getElementData(source,"CZ 550 Mag") + 15) 
            outputChatBox("#FFFF00[VIP-#ff0000"..name.."#FFff00] #FFFFFF Ha sacado 15 balas de CZ 550", getRootElement(), 255, 255, 255 , true) 
    end 
    addEvent("CZMAG", true) 
    addEventHandler("CZMAG", getRootElement(), VidaeColete) 
    

  20. Server-Side
      
    function revisar() 
                 outputChatBox("El jugador: "..getPlayerName(source).." fue expulsado por tener archivos modificados.",getRootElement(),255,0,0,true) 
                 kickPlayer ( source, "Tenes un Archivo en tu GTA Modificado." ) 
    end 
    addEventHandler ( "onPlayerModInfo", root, revisar ) 
      
    

    Nota: Va a expulsar cualquier jugador con algún tipo de modificación a su GTA.

    Tenes que agregar el resource como minimo al grupo ACL "SuperModerator"

    La otra alternativa es activar la detección especial: 20 en el archivo mtaserver.conf

    Saludos.

    me funciono ciber gracias :D

×
×
  • Create New...