25.05.2015, 17:28
Saving system? If you use MySQL, create a new table to link a phone number to a player and set the number to be the primary key and auto increment. That way it's guaranteed to be unique.
You could also append the current Unix timestamp (returned by gettime()), although that may make the number too long. It also won't be unique if two or more players are assigned a number at the same second.
A third way, that also relies on SQL's auto increment, is to append the players' unique identifier, along with some random numbers.
You could also append the current Unix timestamp (returned by gettime()), although that may make the number too long. It also won't be unique if two or more players are assigned a number at the same second.
A third way, that also relies on SQL's auto increment, is to append the players' unique identifier, along with some random numbers.