bug with random weitht output
#9

Yes, because the function uses only one parameter.
pawn Код:
native random(max);
Use this:
pawn Код:
if(Level >= 0   && Level < 50)  { Caught = random((20 -  7 + 1)) + 7; }
else if(Level >= 50  && Level < 100) { Caught = random((50 - 20 + 1)) + 20; }
else if(Level >= 100 && Level < 200) { Caught = random((100 - 50 + 1)) + 50; }
else if(Level >= 200 && Level < 400) { Caught = random((140 - 60 + 1)) + 60; }
else if(Level >= 400 && Level < 500) { Caught = random((170 - 60 + 1)) + 60; }
min. value: +7
max. value: +170

or this:
pawn Код:
if(Level >= 0   && Level < 50)  { Caught = random((20 -  7 + 1)) - 7; }
else if(Level >= 50  && Level < 100) { Caught = random((50 - 20 + 1)) - 20; }
else if(Level >= 100 && Level < 200) { Caught = random((100 - 50 + 1)) - 50; }
else if(Level >= 200 && Level < 400) { Caught = random((140 - 60 + 1)) - 60; }
else if(Level >= 400 && Level < 500) { Caught = random((170 - 60 + 1)) - 60; }
Reply


Messages In This Thread
bug with random weitht output - by MayaEU - 20.07.2016, 21:29
Re: bug with random weitht output - by Codeah - 20.07.2016, 22:14
Re: bug with random weitht output - by MayaEU - 20.07.2016, 22:29
Re: bug with random weitht output - by Nero_3D - 20.07.2016, 23:16
Re: bug with random weitht output - by MayaEU - 20.07.2016, 23:44
Re: bug with random weitht output - by Nero_3D - 20.07.2016, 23:52
Re: bug with random weitht output - by MayaEU - 20.07.2016, 23:58
Re: bug with random weitht output - by MayaEU - 21.07.2016, 00:04
Re: bug with random weitht output - by VVWVV - 21.07.2016, 01:25
Re: bug with random weitht output - by Nero_3D - 21.07.2016, 19:27

Forum Jump:


Users browsing this thread: 1 Guest(s)