Jump to content

Need mysql master.


Fury

Recommended Posts

$10 for converting + $20 if you want me to modify the script

lol you will just convert two function;

function loadPlayerData ( player, datatype ) 
    if ( not player or not isElement( player ) ) then return false end 
    local playerIP = getPlayerSerial ( player ) 
    if ( playerIP ) then 
        local root = xmlLoadFile ("users.xml") 
        if ( root ) then 
            local usersNode = xmlFindChild ( root, "user", 0 ) 
            if ( usersNode ) then 
                local playerRootNode = xmlFindChild ( usersNode, "SERIAL_" .. getPlayerSerial(player), 0 ) 
                if not ( playerRootNode == false ) then 
                    local playerData = xmlNodeGetAttribute ( playerRootNode, datatype ) 
                    if ( playerData ) then 
                        xmlUnloadFile ( root ) 
                        return playerData 
                    else 
                        xmlNodeSetAttribute ( playerRootNode, datatype, 0 ) 
                        xmlSaveFile ( root ) 
                        xmlUnloadFile ( root ) 
                        return 0 
                    end 
                else 
                    local playerRootNode = xmlCreateChild ( usersNode, "SERIAL_" .. getPlayerSerial(player) ) 
                    xmlNodeSetAttribute ( playerRootNode, datatype, 0 ) 
                    xmlSaveFile ( root ) 
                    xmlUnloadFile ( root ) 
                    return 0 
                end 
            end 
        end 
    end 
end 
  
function savePlayerData ( player, datatype, newvalue ) 
    if ( not player or not isElement( player ) ) then return false end 
    local playerIP = getPlayerSerial (player) 
    if ( playerIP ) then 
        local root = xmlLoadFile ("users.xml") 
        if ( root ) then 
            local usersNode = xmlFindChild ( root, "user", 0 ) 
            if ( usersNode ) then 
                local playerRootNode = xmlFindChild ( usersNode, "SERIAL_" .. getPlayerSerial(player), 0 ) 
                if not ( playerRootNode == false ) then 
                    local newNodeValue = xmlNodeSetAttribute ( playerRootNode, datatype, newvalue ) 
                    xmlSaveFile ( root ) 
                    xmlUnloadFile ( root ) 
                    return newNodeValue 
                else 
                    local playerRootNode = xmlCreateChild ( usersNode, "SERIAL_" .. getPlayerSerial(player) ) 
                    local newNodeValue = xmlNodeSetAttribute ( playerRootNode, datatype, newvalue ) 
                    xmlSaveFile ( root ) 
                    xmlUnloadFile ( root ) 
                    return newNodeValue 
                end 
            end 
        end 
    end 
end 
  

10$ is too much for it!

Edited by Guest
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...