HELP about Random Money and Time :)
#1

I need 2 help on my Business Rob script, here is the problem

Problem 1

How to make the script bellow will be warned like "You have already robbed a business in this week" ? Because the /robbus cmd can be used again in the next day, i wont that happen. I want make player can only rob a business for every 7 days or 1 weeks ? Please help
Code:
new year, month, day;
getdate(year, month, day);
if (month < 10) year *= 10;
if (day < 10) month *= 10;
format(tmp, 9, "%d%d%d", year, month, day);
new temp1 = strval(tmp);
if (temp1 == dini_Int(AddDirFile(dir_userfiles, playername), "robbedbus")) return SendClientMessage2(playerid, COLOR_RED, "Your have already robbed a business today.");
Problem 2

What is that meaning of random money setting ? i dont know as well what is the minimum or maximun of money will player got. Please help

Code:
temp1 = MRandom(35001)+5000;
GivePlayerMoney(playerid, temp1);
Thanks
Reply
#2

#define RandomEx(%1,%2) (random(%2-%1)+%1)

RandomEx(5000,9999999999);
Reply
#3

what is that mean ?
Reply
#4

is min <===> max value random
Reply
#5

can u explain with any number ?
Reply
#6

1.Add this code at the beginning of the mode:
#define RandomEx(%1,%2) (random(%2-%1)+%1)

2. Add where you need
new rand = RandomEx(5000,10000);
GivePlayerMoney(playerid, rand);
rand = 0;
Reply
#7

ok thx a lot, i will try it

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)