Unique phone numbers
#1

I scripted a phone number system but how do i make a number unique like if a player has a phone number,for example,Bob's phone number is 22345,no one can recive the number(22345)again.

I kind of know what i have to do,but im new into scripting and i don't really know how to do it

This is the part where the numbers are generated:

case 0:
{
new rand = 10000 + random(89999),string[64];
if(PlayerInfo[playerid][pCellphone] == 1) return SendClientMessage(playerid, COLOR_GREY, "You already have a phone");
PlayerInfo[playerid][pNumber] = rand;
PlayerInfo[playerid][pCellphone] += 1;
format(string,sizeof(string), "Your new phone number is now %d",PlayerInfo[playerid][pNumber]);
SendClientMessage(playerid, COLOR_WHITE, string);
UpdateVariable(playerid, pNumberx);
UpdateVariable(playerid, pCellphonex);
}
Reply


Messages In This Thread
Unique phone numbers - by bosmania - 02.03.2019, 13:14
Re: Unique phone numbers - by benjaminjones - 02.03.2019, 19:22
Re: Unique phone numbers - by bosmania - 02.03.2019, 21:04
Re: Unique phone numbers - by Pottus - 03.03.2019, 00:26
Re: Unique phone numbers - by bosmania - 03.03.2019, 08:42
Re: Unique phone numbers - by benjaminjones - 03.03.2019, 09:17
Re: Unique phone numbers - by Dignity - 03.03.2019, 09:56
Re: Unique phone numbers - by m3shys - 03.03.2019, 10:15

Forum Jump:


Users browsing this thread: 1 Guest(s)