Random phone number - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Random phone number (
/showthread.php?tid=266154)
Random phone number -
lukas567 - 03.07.2011
Hey guys!
I'm creating RolePlay server and i want to make phone number system.
Example: /phone will open GUI and you can select - Add phone number, Contacts List. If I press Add phone number, There will be INPUT style GUI where i can input phone number of other person and add them to contacts list. Is this possible? Input number to INPUT GUI and he will come up to other LIST style GUI? And then i type /phone and select Contacts List and that phone number will be?
If you will help me i will make phone system Filterscript and share with you!
Re: Random phone number -
iPLEOMAX - 03.07.2011
This is possible, only thing is you have to code it yourself. (Unless someone released it)
I already made a similar phone system, but I will add "Phone Numbers" later.
If you are interest in mine, you have to wait for a while, because I'm making it.
Do a search on forum..
Re: Random phone number -
Kitten - 03.07.2011
pawn Код:
new randphonenumer = 700000000 + random(45677823);
the GUI parts and dialog part is on you're own the code on top shows how to get a random number for the phone
Re: Random phone number -
RyDeR` - 03.07.2011
Very simple to generate a random "phone" number:
pawn Код:
stock GenerateRandomNumber(string[], const length = 8)
{
for(new i; i < length; ++i)
{
string[i] = random(10) + '0';
}
return ;
}
Example:
pawn Код:
new
string[12]
;
GenerateRandomNumber(string);
print(string);
Re: Random phone number -
lukas567 - 03.07.2011
I know how to make random number but i want to know is this possible to input text in INPUT GUI and he will appear on LIST GUI? Example: i will input number 12345 and he appear in another LIST GUI. Or it will ask you phone number first (like 12345) and then ask name (like carter) that appear on LIST GUI and then i click that i will call or send text message to that number. Is this possible? And how long i have to wait until you make that system?
Re: Random phone number -
dowster - 03.07.2011
Yes, you have to script an array to hold the numbers the player inputs in the list, like if you want the player to only be able to have 10 numbers your array would be
PlayerContacts[MAX_PLAYERS][10]
and that would store the numbers, then you LIST GUI would read the numbers from that list and display them
Re: Random phone number -
lukas567 - 04.07.2011
So it have to be: new PlayerContact[MAX_PLAYERS][10]? Or it have to be with #Define?