Phone system help!
#1

case 0:
{
new rand = random(100000),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);
}
So this is what happens when a player buys a phone form the shop,now,it works perfectly but i do have some things that i want to add and i have no ideea how.
First: I want the phone numbers to be generated from 10,000 to 100,000 because this,new rand = random(100000),this generates then numbers from 0 to 100,000 or from 1 i don't know for sure.


And second,if a number is already asociated to a player,like if a player buys a phone and he gets a random phone number
i want that number to not be given to another player ever again.
I do hope you can understand what i want to do and i hope you can help me.
Thanks in advance
Reply


Messages In This Thread
Phone system help! - by bosmania - 24.02.2019, 12:40
Re: Phone system help! - by PepsiCola23 - 24.02.2019, 12:57
Re: Phone system help! - by AdamsLT - 24.02.2019, 13:05
Re: Phone system help! - by bosmania - 24.02.2019, 13:06
Re: Phone system help! - by bosmania - 24.02.2019, 13:14
Re: Phone system help! - by AdamsLT - 24.02.2019, 13:25

Forum Jump:


Users browsing this thread: 1 Guest(s)