ID:264607
 
Code:
mob/verb/Subscriber_List_Update()
var/http = world.Export("http://www.gohangames.webcindario.com/subscribers.txt")
if(!http)
usr << "Failed to connect."
return
var/A = http["CONTENT"]
if(A)
A=html_encode(file2text(A))
var/key=copytext(A,1,findtext(A,"/"))
var/date=copytext(A,findtext(A,"/")+1)
for(var/client/M)
if(findtext(A,M.key))
usr<<"You are Subscribed to Gohan Games"
usr<<"Your sub will expire [date]"


Problem description: When it Says You are Subscribed Blablabla, After That Appears the Other Players Keys

That system will only work with the first value in the file, you're not giving the system a valid way to check a list of values. It'll find the first key and the rest of the file will be read as the date since you're not providing it anywhere to stop.

That is only part of the problem though, like I mentioned above you need to do some kind of recursive search over the file to actually find more than one value in the file.
In response to Nadrew
How i do that?
In response to Gohan Games
Gohan Games wrote:
How i do that?

That totally depends on your Subscribers.txt

lets hope your format is like this
key1/date1
key2/date2

then change the format to
BOF/dateBof
key1/date1
key2/date2
EOF/dateEof


then change here
var/date=copytext(A,findtext(A,"/")+1)

to
var/date=copytext(A,findtext(A,"/")+1,findtext(A,"\n")

Everyline in the end contains a \n representing a newline or a return carriage(when u type it)
then As Nadrew said put a loop and enter the keys and dates in lists. Their index values are corresponding!

means Sub_keys[x] 's expiry date is Sub_dates[x]. Where x can take the value of any +ve integer provided x<=Sub_keys.len

then in the last if the key is EOF terminate the loop so that you dont crash it!

In response to Getenks
my Subscribers.txt is Like This:

BOF/31-12-9999
Gohan Games/01-01-0001
Revolution Naruto/01-01-0001
Getenks/31-12-9999
Falacy/31-12-9999
EOF/01-01-0001

(EDIT) i did what u said now there is another problem: When it Reads the File and im using Revolut, Appears the First Key Expiration Date. But Nothing of the Other Keys. Like if All Players are BOF.


Revolution Naruto has Joined us for the first time
You are Subscribed to Gohan Games With the Key of: BOF
Your sub will expire 31-12-9999 (BOF Expiration Date)

mob/verb/Subscriber_List_Update()
var/http = world.Export("http://www.gohangames.webcindario.com/subscribers.txt")
if(!http)
usr << "Failed to connect."
return
var/A = http["CONTENT"]
if(A)
A=html_encode(file2text(A))
var/key=copytext(A,1,findtext(A,"/"))
var/date=copytext(A,findtext(A,"/")+1,findtext(A,"\n"))
for(var/mob/M in world)
if(findtext(A,M.key))
usr<<"You are Subscribed to Gohan Games With the Key of: [key]"
usr<<"Your sub will expire [date]"

Thats the Current Code.
In response to Gohan Games
I dont know if i figured it Correctly. Here's what i did:

var/SubKey[Keys.len]
var/Sub_dates[Dates.len]

mob/verb/Subscriber_List_Update()
set name = "Update Subscriber List"
set category = "Global"
world<<"<font color = green><b><font face = tahoma>GM: </font></font></b><b><font face = tahoma>Updating Subscriber List"
sleep(30)
var/http = world.Export("http://www.gohangames.webcindario.com/subscribers.txt")
if(!http)
usr << "Failed to connect."
return
var/A = http["CONTENT"]
if(A)
A=html_encode(file2text(A))
var/key=copytext(A,1,findtext(A,"/"))
var/date=copytext(A,findtext(A,"/")+1,findtext(A,"\n"))
world<<"<font color = green><b><font face = tahoma>GM: </font></font></b><b><font face = tahoma>Subscriber List Successfully Updated"
for(var/mob/M in world)
if(findtext(A,M.key))
usr<<"You are Subscribed to Gohan Games With the Key of: [key]"
usr<<"Your sub will expire [date]"
Sub_dates.Add(date)
SubKey.Add(key)


But that sends a error:

loading Dragon Ball Z Ultimate Warriors.dme
loading Skin.dmf
Variables.dm:7:error: Keys.len: undefined var
Variables.dm:8:error: Dates.len: undefined var

Dragon Ball Z Ultimate Warriors.dmb - 2 errors, 0 warnings (double-click on an error to jump to it)


-Gohan
In response to Gohan Games
A DBZ game, a fangame, with subscriptions?
In response to Moonlight Memento
Yes, Not Fan Game, Original Game XD but this code doesnt work, i never used Export this is my first time. That why im asking for help xD.

u can help me? =P

-Gohan
In response to Gohan Games
The definition of a fangame is a game made based on the material of another medium. By default any game based on any show of any kind is a fangame.
In response to Nadrew
o.O!_! Well, Some1 knows how to Make the Code Read all .txt and if the key of the user is in the list it appears with the expiration??



-Gohan
In response to Gohan Games
I don't think someone would want to help you with illegal activities.
In response to Moonlight Memento
Why it is illegal?
In response to Gohan Games
You don't own rights to DBZ yet you're blatantly making money off of it.
In response to Moonlight Memento
So, to make it legal i need use client.CheckPassport Right?
In response to Gohan Games
No, to make it legal you don't do it at all. You don't own DBZ, don't use subscriptions.