27.11.2010, 08:52
Good morning, or afternoon / evening,
I'm a little bit stuck, not a big problem but I need to know the right solution to learn from. I explain:
I'm making the phone system for my roleplay. All piece of cake, but then buying the cellphone.. I want to write in a file which numbers are used. Simple to. But how to check if a certain number is in a file? For example:
I have pressed to buy a cellphone. In the script happens: 'new ph = random(10000);'. This would return a number from 0-10000. Lets say it has returned 7800.
Now, how to check if '7800' is not already bought? If it is, it has already been written in a file.
Now the main question: how to check if 7800 is already written in a file?
Hope you have understood it.
Regards, Jochem
I'm a little bit stuck, not a big problem but I need to know the right solution to learn from. I explain:
I'm making the phone system for my roleplay. All piece of cake, but then buying the cellphone.. I want to write in a file which numbers are used. Simple to. But how to check if a certain number is in a file? For example:
I have pressed to buy a cellphone. In the script happens: 'new ph = random(10000);'. This would return a number from 0-10000. Lets say it has returned 7800.
Now, how to check if '7800' is not already bought? If it is, it has already been written in a file.
Now the main question: how to check if 7800 is already written in a file?
Hope you have understood it.
Regards, Jochem