Jump to content

Xml data set to 0


freudo

Recommended Posts

Posted

hi

I Want change all clan points set to 0 with command

Exp: /cpremove

     
     
    "Number One" tag="~¨~" r="102" g="102" b="102" color="#666666" Points="4" 
    "SR" tag="[sR]" r="102" g="102" b="102" color="#666666" Points="5" 
  

  

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted
function cpremoveCmd(plr, cmd, clan)  
    xml = xmlLoadFile ("clans.xml") 
    for index, childNode in pairs ( xmlNodeGetChildren (xml) ) do  
        local name  = xmlNodeGetAttribute  (childNode, "isim" ) 
        if name == clan  then 
            mlNodeSetAttribute(childNode, "Points", 0) 
            break; 
        end 
    end 
    xmlUnloadFile(xml) 
end 
addCommandHandler("cpremove", cpremoveCmd) 

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

Not working

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted

post all the code please

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

İ want set 0 value for all clans

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted
İ want set 0 value for all clans

try this one

function cpremoveCmd(plr, cmd) 
    xml = xmlLoadFile ("clans.xml") 
    for index, childNode in pairs ( xmlNodeGetChildren (xml) ) do 
            xmlNodeSetAttribute(childNode, "Points", 0) 
            outputChatBox("Done",plr,0,255,0) 
            break; 
        end 
    xmlUnloadFile(xml) 
end 
addCommandHandler("cpremove", cpremoveCmd) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted (edited)
İ want set 0 value for all clans

try this one

function cpremoveCmd(plr, cmd) 
    xml = xmlLoadFile ("clans.xml") 
    for index, childNode in pairs ( xmlNodeGetChildren (xml) ) do 
            xmlNodeSetAttribute(childNode, "Points", 0) 
            outputChatBox("Done",plr,0,255,0) 
            break; 
        end 
    xmlSaveFile(xml) 
    xmlUnloadFile(xml) 
end 
addCommandHandler("cpremove", cpremoveCmd) 

OMG puting the break here wil exsit the loop and only the first one will be done

so @Barikat try this code

  
function cpremoveCmd(plr, cmd) 
    xml = xmlLoadFile ("clans.xml") 
    for index, childNode in pairs ( xmlNodeGetChildren (xml) ) do 
            xmlNodeSetAttribute(childNode, "Points", 0) 
        end 
      xmlSaveFile(xml) 
    xmlUnloadFile(xml) 
end 
addCommandHandler("cpremove", cpremoveCmd) 
  

Edited by Guest

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

i forget that i always forget to save anyway thx alwa7sh :)

  
function cpremoveCmd(plr, cmd) 
    xml = xmlLoadFile ("clans.xml") 
    for index, childNode in pairs ( xmlNodeGetChildren (xml) ) do 
            xmlNodeSetAttribute(childNode, "Points", 0) 
        end 
     xmlSaveFile(xml) 
    xmlUnloadFile(xml) 
end 
addCommandHandler("cpremove", cpremoveCmd) 
  

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

Thx. İts working

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted
Thx. İts working

Nope you are welcome :D

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

I have one more question :)

How to I change my clan color change?

Client:

function renkDegstr(btn) 
    if btn == "left" then 
       local color = guiGetText(renkedit) 
       local r,g,b = getColorFromString(color) 
       triggerServerEvent("updateColor",localPlayer,{renk=color,r=r,g=g,b=b}) 
    end 
end 

Sever: Dont work

addEvent("updateColor",true) 
addEventHandler("updateColor",root, 
function(color) 
    local myClan = getAccountData(getPlayerAccount(source),"clan") 
    if myClan then 
        local xml = xmlLoadFile("clans.xml") 
        if xml then 
            for k,v in ipairs(xmlNodeGetChildren(xml)) do 
                if xmlNodeGetAttribute(v, "tag") == myClan then 
                xmlNodeSetAttribute(v,"r",color.r) 
                xmlNodeSetAttribute(v,"g",color.g) 
                xmlNodeSetAttribute(v,"b",color.b) 
                xmlNodeSetAttribute(v,"color",color.renk) 
                break 
                end 
            end 
        end 
    end 
end 
) 

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted
addEvent("updateColor",true) 
addEventHandler("updateColor",root, 
function(color) 
    local myClan = getAccountData(getPlayerAccount(source),"clan") 
    if myClan then 
        local xml = xmlLoadFile("clans.xml") 
        if xml then 
            for k,v in ipairs(xmlNodeGetChildren(xml)) do 
                if xmlNodeGetAttribute(v, "tag") == myClan then 
                xmlNodeSetAttribute(v,"r",color.r) 
                xmlNodeSetAttribute(v,"g",color.g) 
                xmlNodeSetAttribute(v,"b",color.b) 
                xmlNodeSetAttribute(v,"color",color.renk) 
                break 
                end 
            end 
        xmlSaveFile(xml) 
        xmlUnloadFile(xml) 
        end 
    end 
end 
) 

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...