PDA

View Full Version : Phone Number


Akcent_Voltaj
05/06/2013, 06:25 PM
I want so the first letters to be 07 and then +8 letters... like 07[33333333] to be in total 10 letters!

new randphone = 1000 + random(8999);//minimum 1000 max 9999
PlayerInfo[playerid][pPnumber] = randphone;

scout322
05/06/2013, 06:34 PM
new randphone = 10000000 + random(89999999);//minimum 1000 max 99999999
PlayerInfo[playerid][pPnumber] = 07randphone;

Try this.

Akcent_Voltaj
05/06/2013, 06:38 PM
did you test it?

fordawinzz
05/06/2013, 06:42 PM
PlayerInfo[playerid][pPnumber] = 700000000 + random(99999999);

and use this to format the number like 07...
format(szString, sizeof szString, "My number is %010d", PlayerInfo[playerid][pPnumber]);

scout322
05/06/2013, 06:42 PM
No. but you can try atlast. if doest work then say so.

Akcent_Voltaj
05/06/2013, 07:08 PM
if( listitem == 0 )
{
//if(PlayerInfo[playerid][pPnumber] != 0)
//{
// SendClientMessage(playerid, COLOR_GREY, " Deja ai un Mobil ! ");
// return 1;
// }
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
if(GetPlayerCash(playerid) <= 5000) return SendClientMessage(playerid, COLOR_RED, "Nu ai destui bani pentru a cumpara de la 24/7!");
new skill = 5000 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 5000 - price;
format(string, sizeof(string), "~r~-%dLei", payout);
GameTextForPlayer(playerid, string, 5000, 1);
GivePlayerCash(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
}
else
{
format(string, sizeof(string), "~r~-%dLei", 5000);
GameTextForPlayer(playerid, string, 5000, 1);
GivePlayerCash(playerid,-5000);
SBizzInfo[9][sbTill] += 5000;
ExtortionSBiz(9, 5000);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pPnumber] = 700000000 + random(99999999);
PlayerInfo[playerid][pPnumber] = randphone;
format(string, sizeof(string), " Ti-ai luat un Mobil nou numarul tau de telefon este %d", randphone);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD5, "You can check this anytime by Typing /stats");
SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now type /help to see your cell phone commands.");
return 1;
}

Vince
05/06/2013, 08:47 PM
new randphone = 10000000 + random(89999999);//minimum 1000 max 99999999
PlayerInfo[playerid][pPnumber] = 07randphone;

Try this.
No. but you can try atlast. if doest work then say so.

Just don't post if you're clueless, okay? A trained eye immediately sees that this won't work at all.

Akcent_Voltaj
05/06/2013, 09:55 PM
Fixed - Thanks to all!