[HELP] Random money?
#1

IS there a way to create like a PayDay system that give you a random amount between $1000 and $2000 every hour?
Reply
#2

Just add this in a timer:
pawn Code:
GivePlayerMoney(playerid, random(2000 - 1000) + 1000);
Reply
#3

Should be working with GivePlayerMoney(playerid, random(1000) + 1000); right ?
Reply
#4

I'll try in a minute.
Reply
#5

Check this out:
pawn Code:
forward RandomMoney();   // at the top of your script
// ...
SetTimer("RandomMoney",3600000,true); // at OnGameModeInit
// ...
public RandomMoney()   // somewhere else
{
    new random_money = 1000+random(1001);  // 1000-2000
    for(new i=GetMaxPlayers()-1; i >=0; i--)
    {
        if(!IsPlayerConnected(i))    continue;
        GivePlayerMoney(i,random_money);
    }
    return 1;
}
Reply
#6

Now, if I have
pawn Code:
GivePlayerMoney(i, random(1000) + 1000);
under my PayDay system, how can I turn the money that it go into
pawn Code:
PlayerInfo[playerid[pPayCheck]
instead of going into my pocket?
Reply
#7

PlayerInfo[playerid][pPayCheck] +=random(1000)+1001;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)