Jump to content

SirniNamaz

Members
  • Posts

    138
  • Joined

  • Last visited

Posts posted by SirniNamaz

  1. how to:

    1. disable 'logout' and 'login' and 'register' command

    2. disable chatbox

    3. how to disable chatbox output that gets outputed when you login (or logout), something like this: login: you have successfully logged in and logout: you have successfully logged out

  2. Client:

    function eventFiveSec() 
        if (guiGetVisible(guiEventManager) == true) then 
            local xmlElements = xmlLoadFile("elements.xml") 
            guiGridListClear(grdElementsList) 
            for i=0,149 do 
                local xmlOldChild = xmlFindChild(xmlElements,"element",i) 
                outputChatBox(xmlOldChild) 
                local attrs = xmlNodeGetAttributes(xmlOldChild) 
                outputChatBox(i) 
                if (attrs == false) then 
                    return 
                else 
                    local newRow = guiGridListAddRow(grdElementsList) 
                    for name,value in pairs(attrs) do 
                        outputChatBox(name .. " = " .. value) 
                    end 
                end 
            end 
            xmlUnloadFile(xmlElements) 
        end 
    end 
    

    XML:

        "6447187" type="weapon" item="4" x="2474.0759277344" y="-1653.5537109375" z="13.46875" left="1">
        "5859401" type="weapon" item="4" x="0" y="0" z="0" left="0">
        "1829493" type="weapon" item="4" x="2477.142578125" y="-1662.857421875" z="13.336080551147" left="1">
    
      
    

    Problem: xmlOldChild is always returned as false

  3. function eventFiveSec() 
        if (guiGetVisible(guiEventManager) == true) then 
            local xmlElements = xmlLoadFile("elements.xml") 
            for i=0,149 do 
                local xmlOldChild = xmlFindChild(xmlElements,"element",i) 
                local attrs = xmlNodeGetAttributes(xmlOldChild) 
                if (attrs == false) then 
                    return 
                else 
                    guiGridListClear(grdElementsList) 
                    local newRow = guiGridListAddRow(grdElementsList) 
                    for name,value in pairs(attrs) do 
                        outputChatBox(name .. " = " .. value) 
                        if (name == "item") then 
                            if (tonumber(value) == 4) then 
                                guiGridListSetItemText(grdElementsList,newRow,colElement2,"Knife",false,false) 
                            end 
                        end 
                        if (name == "x") then 
                            guiGridListSetItemText(grdElementsList,newRow,colElement2X,value,false,false) 
                        end 
                        if (name == "y") then 
                            guiGridListSetItemText(grdElementsList,newRow,colElement2Y,value,false,false) 
                        end 
                        if (name == "z") then 
                            guiGridListSetItemText(grdElementsList,newRow,colElement2Z,value,false,false) 
                        end 
                        if (name == "left") then 
                            guiGridListSetItemText(grdElementsList,newRow,colElement2Left,value,false,false) 
                        end 
                    end 
                end 
            end 
        end 
    end 
    

    It now only returns one line of error, but it doesn't get exported to gridlist.

  4. there is one element, but it doesn't get returned in gridlist (i am currently ignoring the 149 errors or xmlFindChild command, but i get 150 of them, it cant even load the first one into gridlist)

  5. client

        if (guiGetVisible(guiEventManager) == true) then 
            local xmlElements = xmlLoadFile("elements.xml") 
            for i=0,149 do 
                local xmlOldChild = xmlFindChild(xmlElements,"element",i) 
                local attrs = xmlNodeGetAttributes(xmlOldChild) 
                if not (attrs == false) then 
                    guiGridListClear(grdElementsList) 
                    local newRow = guiGridListAddRow(grdElementsList) 
                    for name,value in pairs(attrs) do 
                        outputChatBox(name .. " = " .. value) 
                        if (name == "item") then 
                            if (tonumber(value) == 4) then 
                                guiGridListSetItemText(grdElementsList,newRow,colElement2,"Knife",false,false) 
                            end 
                        end 
                        if (name == "x") then 
                            guiGridListSetItemText(grdElementsList,newRow,colElement2X,value,false,false) 
                        end 
                        if (name == "y") then 
                            guiGridListSetItemText(grdElementsList,newRow,colElement2Y,value,false,false) 
                        end 
                        if (name == "z") then 
                            guiGridListSetItemText(grdElementsList,newRow,colElement2Z,value,false,false) 
                        end 
                        if (name == "left") then 
                            guiGridListSetItemText(grdElementsList,newRow,colElement2Left,value,false,false) 
                        end 
                    end 
                end 
            end 
        end 
    

    xml

        "8066072" type="weapon" item="4" x="2486.3376464844" y="-1663.841796875" z="13.335947036743" left="1">
        "7858149" type="weapon" item="4" x="2469.3784179688" y="-1667.8182373047" z="13.302844047546" left="1">
    
      
    

    the error is : Bad argument @ 'xmlNodeGetAttributes'

  6.             local NodeID = getElementData(source,"314613.NodeID") 
                for i=0,150 do 
                    local xmlElements = xmlLoadFile("elements.xml") 
                    local xmlOldChild = xmlFindChild(xmlElements,"element",i) 
                    if (xmlNodeGetAttribute(xmlElements,"id") == tonumber(NodeID)) then 
                        xmlDestroyNode(xmlOldChild) 
                        xmlSaveFile(xmlElements) 
                        return 
                    end 
                end 
    

    no debugscript.. the problem is that it doesnt delete the node

  7.     local xmlElements = xmlLoadFile("elements.xml") 
        local xmlNewChild = xmlCreateChild(xmlLoadFile,"element") 
        xmlNodeSetAttribute(xmlNewChild,"type",varNodeValue1) 
        xmlNodeSetAttribute(xmlNewChild,"id",varNodeValue2) 
        xmlNodeSetAttribute(xmlNewChild,"x",varNodeValue3) 
        xmlNodeSetAttribute(xmlNewChild,"y",varNodeValue4) 
        xmlNodeSetAttribute(xmlNewChild,"z",varNodeValue5) 
        xmlNodeSetAttribute(xmlNewChild,"left",varNodeValue6) 
        xmlSaveFile(xmlElements) 
    

    in debugscript it says that there is error with xmlNodeSetAttribute

    i want the xml to look something like this:

        type="weapon" id="4" x="0" y="0" z="0" left="0" /> 
    
      
    

×
×
  • Create New...