[HELP] Phone number -
n00el - 22.12.2013
Hello!
I need a random phone numer.. Like this 0620
4563649. Only the red numer random, 0620 is fix.
But i dont know how i this.
pInfo[playerid][pNumber] = ??
I try a lot of idea, but none of them work. Please help.
Thank you!
Re: [HELP] Phone number -
newbie scripter - 22.12.2013
pawn Код:
new rand = random(7777777) + 1000000;
pInfo[playerid][pNumber] = rand + 06200000000
Idk whether it works.
Re: [HELP] Phone number -
n00el - 22.12.2013
Uhhm, its generate "1907366494" phone number:\ its not good.
Re: [HELP] Phone number -
newbie scripter - 22.12.2013
If u didn't add ';' then try this
pawn Код:
new rand = random(7777777) + 1000000;
pInfo[playerid][pNumber] = rand + 06200000000;
Re: [HELP] Phone number -
n00el - 22.12.2013
The mode didnt strart when i forget ";", so i write this. and then generate the number.
(Sorry for my bad english
)
Re: [HELP] Phone number -
newbie scripter - 22.12.2013
did it work?? if not give me ur code i will ty to fix it..
Re: [HELP] Phone number -
n00el - 22.12.2013
not working..
Код:
if(listitem == 3)
{
if(pInfo[playerid][pMobile] == 1)
{
if(pInfo[playerid][pMoney] >= 200)
{
new rand = random(7777777) + 1000000;
pInfo[playerid][pNumber] = rand + 06200000000;
pInfo[playerid][pMoney] -= 200;
format(S, sizeof(S), "Szerződйst kцtцttйl a telefon szolgбltatуval! Telefonszбmod: %d", pInfo[playerid][pNumber]);
SendClientMessage(playerid, NARANCS, S);
cmd_me(playerid, "szerződйst kцtцtt a telefon szolgбltatуval.");
}
else
{
SendClientMessage(playerid, PIROS, "Nincs elйg pйnzed! ($200)");
}
}
else
{
SendClientMessage(playerid, PIROS, "Nem kцthetsz szerződйst amнg nincs telefonod!");
}
Re: [HELP] Phone number -
Konstantinos - 22.12.2013
Assuming that pInfo[playerid][pNumber] should be a string:
pawn Код:
format(pInfo[playerid][pNumber], 12, "0620%d%d%d%d%d%d%d", random(10), random(10), random(10), random(10), random(10), random(10), random(10));
The last 7 digits will be totally random numbers (0-9).
Re: [HELP] Phone number -
RajatPawar - 22.12.2013
Even random could return similar values (though the chance is 1 in 10000000) so make sure you check against a stored table of phone numbers. Or you could use a random telephone number generator from the web using HTTP. Unnecessary, though!