18.04.2017, 20:08
Hey! how can i insert numbers before random numbers? I was trying like this but it is not working
Код:
if(GetPlayerMoney(playerid) < 99) return SCM(playerid, COLOR_LIGHTRED, "You do not have enough money.");
if(PlayerInfo[playerid][pPhone] > 0) return SCM(playerid, COLOR_LIGHTRED, "You already have a cellphone.");
SCM(playerid, COLOR_WHITE, "You have bought a cellphone.");
new str[64];
new randphone = random(9999999) + 1000000; //minimum 150000 - max 500000 - defining the number
strins(randphone, "0670", 0, 4);
PlayerInfo[playerid][pNumber] = randphone; // Define pNumber as that number :)
format(str, sizeof(str), "Your new number is: %d.", randphone);
SendClientMessage(playerid, COLOR_WHITE, str);
PlayerInfo[playerid][pPhone] = 1;
GivePlayerMoney(playerid, -100);
new INI:File2 = INI_Open(UserPath(playerid));
INI_SetTag(File2,"data");
INI_WriteInt(File2, "Number", PlayerInfo[playerid][pNumber]);
INI_Close(File2);
new id = GetPlayerVirtualWorld(playerid);
BusinessInfo[id][bMoney] += 50;
new file4[40];
format(file4, sizeof(file4), BPATH, id);
new INI:File = INI_Open(file4);
INI_SetTag(File,"data");
INI_WriteInt(File,"bMoney", BusinessInfo[id][bMoney]);
INI_Close(File);

