23.04.2011, 21:10
Sup guys!
I'm wondering a way to check if the player's cellphone number (which would be randomly generated) is already taken. So, when the player register the server randomly generate a number with 5 digits to him. All this part I've said to you, I know how to do. My problem is: I've seen in other scripts that it only check the numbers of the connected players, if the player is offline, and for example, his number is 12345 and the server generates 12345 for a new player, the number, yet could be registred, and then we would have double numbers.
So, a better way would be registering all new numbers in a file, and when the server would generate a new number, check if it is already registered. But, I don't know how would be the structure of this file, I think it would be a .ini file, using Dini (please, no complains about Dini) As I though, it would be like this:
How should I write the number in the file? How to make then "stacked" like that? Which function should I use to search the number in the file?
Can someone help me, please?
I'm wondering a way to check if the player's cellphone number (which would be randomly generated) is already taken. So, when the player register the server randomly generate a number with 5 digits to him. All this part I've said to you, I know how to do. My problem is: I've seen in other scripts that it only check the numbers of the connected players, if the player is offline, and for example, his number is 12345 and the server generates 12345 for a new player, the number, yet could be registred, and then we would have double numbers.
So, a better way would be registering all new numbers in a file, and when the server would generate a new number, check if it is already registered. But, I don't know how would be the structure of this file, I think it would be a .ini file, using Dini (please, no complains about Dini) As I though, it would be like this:
Код:
12345 67890 .......
Can someone help me, please?