15.10.2013, 23:00
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:
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;
}