Jump to content

same name


Castillo

Recommended Posts

Posted

hi there, i've got a problem with my character system, i can create characters etc but the problem is that i can create with same names and thats a big problem, i've tryed to fix it and no luck. maybe someone of you can help me out, here is a piece of my code,

function create_character (nametext,age,skin,red,green,blue)
local root = getResourceConfig("character/playerdb.xml")
local index = getUserIndex (getAccountName(getPlayerAccount(source)),root)
for i , v in ipairs ( xmlNodeGetChildren ( root ) ) do
local accName = xmlNodeGetAttribute ( v , "name" )
if ( accName == tostring ( nametext ) ) then
outputChatBox ( "A character with that name already exists." , source , 255 , 0 , 0 )
return false
end
end

Thanks in advance.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Can someone help me out? :oops:

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Hey, theres few (two?) active topics. No need to bump. And when you reply to yourself, on topics list you get 1 in "reples" colums = less chance that somebody will open your topic than when it´s zero. Its better to wait a bit.

About your problem:

Post your xml example too.

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

<playerdb>
   <user account="Snake">
       <character name="Optimus-Prime" age="15" skin="29" x="-1225.029296875" y="-126.671875" z="14.1484375" cash="3743800" redcolor="94" w0="0" a0="0" w1="0" a1="0" w2="24" a2="9980" w3="27" a3="9993" w4="29" a4="9896" w5="31" a5="9999" w6="34" a6="9998" w7="0" a7="0" w8="16" a8="9980" w9="43" a9="9999" w10="0" a10="0" w11="44" a11="0" w12="0" a12="0" wl="2" bank="99800484" int="0" dim="0" car1="511" car2="No car" car3="415" car4="422" rotation="167.59075927734" greencolor="242" bluecolor="191" />
   </user>
</playerdb>

this?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

That script is checking if the node has a "name" attribute, you'll have to get the child node of the child node of the file.

Retired

Posted
That script is checking if the node has a "name" attribute, you'll have to get the child node of the child node of the file.

ok my friend and me fixed it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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