SA-MP Forums Archive
Random Money - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Random Money (/showthread.php?tid=649514)



Random Money - tbedy - 10.02.2018

Код:
//------------------------------------------------------------------------------
stock randomEx(min,max) {
	return (min+random(max));
}

stock randomExx(const iMin, const iMax) {
	return random(iMax - iMin) + iMin;
}
Код:
new novac = RandomEx(8000, 40001);
it should be random money between 8000 - 400001 ... but anyway it gives me 270 000 $

What's problem? Any Help


Re: Random Money - CodeStyle175 - 10.02.2018

#define RndEx(%0,%1) %0+random(%1-%0)
PlayerMoney[playerid]+=RndEx(8000,40000);


Re: Random Money - tbedy - 10.02.2018

Код:
#define RndEx(%0,%1) %0+random(%1-%0)
Код:
PljackaNovac[ playerid ] +=RndEx(8000,40000);
and it gives me 7 000 000 $ ...

its really wierd


Re: Random Money - Mugala - 10.02.2018

well, use this
PHP код:
stock randomEx(min,max)
{
    return 
min+random(max-min);




Re: Random Money - Astralis - 11.02.2018

https://sampforum.blast.hk/showthread.php?tid=305136