Random money problem
#1

Hello guys i made a robbery dialog and when i rob something
i get alot of money for the reason that i puted random money
so the player gets a random amount of money
but it gives to much can you guys help me make it like the minimum is 5000 and the maximum is 1000
so i wont get a large amount of money here is my code that i am using:

pawn Код:
@Robbing(playerid);
@Robbing(playerid)
{
    new mrand =random(GetPlayerMoney(playerid));
    new string[120];
    new Time = GetPVarInt(playerid, "Robbing24/7Shop");
    if(!IsPlayerConnected(playerid))
        return 0;

    if(Time < 1)
    {
      SetPVarInt(playerid, "Robbing24/7Shop", 0);
      SetTimer("ShopRobAgain", 360000, 0);
      GivePlayerMoney(playerid,mrand);
      IncreaseScore(playerid,1);
      format(string,sizeof(string),"You have succesfully robbed $%d",mrand,playerid);
      return SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
    }

    new str[30];
    format(str, sizeof(str), "Robbery time left: %d", Time);
    GameTextForPlayer(playerid, str, 2500, 3);

    SetPVarInt(playerid, "Robbing24/7Shop", Time - 1);
    SetTimerEx("@Robbing", 1000, false, "i", playerid);
    return 1;
}
Reply


Messages In This Thread
Random money problem - by DarkLored - 15.10.2013, 23:00
Re: Random money problem - by ***Niko*** - 15.10.2013, 23:15
Re: Random money problem - by DarkLored - 15.10.2013, 23:23
Re: Random money problem - by JohnRazer - 15.10.2013, 23:27
Re: Random money problem - by DarkLored - 15.10.2013, 23:28
Re: Random money problem - by JohnRazer - 15.10.2013, 23:31
Re: Random money problem - by DarkLored - 16.10.2013, 00:27
Re: Random money problem - by EiresJason - 16.10.2013, 00:32
Re: Random money problem - by DarkLored - 16.10.2013, 00:42
Re: Random money problem - by ***Niko*** - 16.10.2013, 00:47

Forum Jump:


Users browsing this thread: 2 Guest(s)