add a players name to a txt file.

lina

LOMCN Veteran
Veteran
Loyal Member
Jul 28, 2010
283
5
45
Poland
Hi guys, how can i add a players name to a txt file that a command checknamelist can check the guys name?

i was looking for commands such as

addtextlist "Market_Def/licytacja.txt Nike

But this way it wont work.

What im trying to do is input someone's name instead of my own.

What i would like to see in the text file is name of the player Nike only.
 
Last edited:

JoeDunn

LOMCN Veteran
Veteran
Jun 16, 2009
1,042
123
149
addnamelist

checknamelist

!CheckNameList

u dont need to have the Market_Def part just the file name.

should look like this

#IF
CheckNameList thetext.txt
#ACT
break
#ELSEACT
Addnamelist thetext.txt
 
Upvote 0

lina

LOMCN Veteran
Veteran
Loyal Member
Jul 28, 2010
283
5
45
Poland
Yes but thats my problem, i cannot use addnamelist as it will add my name in the txt file instead of someone ellses.

Edit: If there is no one to do that, whats the script for the npc to send a message to only 1 guy? I would like to send him a message and give him an item, through an npc.

it should look something like that but i dont know the acctual script:

#ACT
send messagebox playername
give protectionring
#SAY
You have won a protectionring!
 
Last edited:
Upvote 0

JoeDunn

LOMCN Veteran
Veteran
Jun 16, 2009
1,042
123
149
dont think u can.

maybe have a d menu but u would have to add there names to the .txt file urself tho but it could look something like this.

#if
checknamelist reward.txt
#ACT
give protectionring
#Say
You have won a protectionring!
#ELSAY
Unlucky this time

what determins the winner for the script another npc or from out side the server. as far as i know theres no way to add someone else name to a .txt file from ingame :( this is why we need a stable source code

sorry for spelling and stuff if there is any its nly 6 am and am **** faced lol happy new years eve lol
 
Upvote 0

Cricket1650

Dedicated Member
Dedicated Member
Apr 25, 2008
66
0
52
You could try something like this. It's not as simple as checknamelist but I think it will work. Bear in mind that I cannot test this but feel free to try it and edit it to your liking but there are no guarantees that it will work.

You can use this to save names to the file using an npc.

Code:
[@main]
#SAY
<Add User/@save(1)>\
<Remove User/@save(0)\
<Exit/@exit>

[@save()]
#ACT
Mov A0 %INPUTSTR
Mov D1 %ARG(1)
SaveValue "QuestDiary\Winners.txt" Winner A0 D1
#SAY
Username <$OUTPUT(A0)> saved to file.
<Kay/@exit>

And this one could be in either an npc or in some user login script.

Code:
[@main]
#ACT
LoadValue D0 "QuestDiary\Winners.txt" Winner %USERNAME
Goto @check

[@check]
#IF
Equal D0 1
#ACT
give protectionring
SaveValue "QuestDiary\Winners.txt" Winner %USERNAME 0
#SAY
You have won a protection ring! Congratulations!
<WOOOOOT/@exit>
#ELSESAY
Sorry, you have not won this time.
<Bummer/@exit>

The text file would look like this, not including whatever is after the "\\"
Code:
[Winner]
Nike=1 \\Winner because the value is a 1
JohnDoe=0 \\Previous winner that has already claimed his prize. Losers would not be on the list unless they have already won before.
 
Last edited:
Upvote 0