Uhh I need help (Random phone number)..
#1

Hello dear samp forum members.. I'm lost in generating random phone number...

Basically I have problems with generating one and checking if the phone number is free to use.

Umm for generating it I would love to know the best way..

I'm using this

pawn Код:
new randphone = 1000 + random(9999);
and one more question how big string I would need to save it?
Reply
#2

How do you save the player's phone number? That's how you can check if it's existing or not.
Reply
#3

Not like that.. If itš used or not for another play so basically I need to check trough all player data.. If the number is used by another player...
Reply
#4

Right, so what saving system are you using? Like MySQL or .INI files?
Reply
#5

Y_ini system so yeah.. Just that's what needed atm the most.. I just don't understand it how it's possible..
Reply
#6

*BUMP*
Reply
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
new
    phone[ 11 ]
;
format( phone, sizeof( phone ), "072%d%d%d%d%d%d%d", random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ) );
// Replace the 072 with any prefix you want.
About checking for number, use strcmp.
About saving, you just need a string of size 11.
Reply
#8

Oh big thanks mate + rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)