SA-MP Forums Archive
random - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: random (/showthread.php?tid=151957)



random - Nonameman - 01.06.2010

Hello!

I wanna create random lotto numbers from 1-10. So i created this:

Код:
new Int:RandomLottoNumbers; //line 37
RandomLottoNumbers = random(10)+1;
But now, the compiler writes this:

Код:
\filterscripts\lotto.pwn(37) : warning 213: tag mismatch
What's the problem with this? Please reply

Thanks
Nonameman




Re: random - woot - 01.06.2010

Why Int: ? lol.
new RandomLottonumbers; is all you need.


Re: random - Nonameman - 02.06.2010

Because I want to collate this random value with an integer value.
But then ok, and thanks a lot

Now my compiler write that it's still wrong, cannot collate the 2 values


Re: random - MadeMan - 02.06.2010

What is the error?


Re: random - Nonameman - 02.06.2010

I checked it again, and found the mistake, so now it's perfect


Re: random - Niixie - 02.06.2010

Remember that you can do such thing as
Код:
 RandomLottoNumbers = random(10)+1;
if your not in a callback?


Re: random - Conroy - 02.06.2010

pawn Код:
RandomLottoNumbers = RandomEx(10);
pawn Код:
//Place at the bottom of your script
stock RandomEx(max)
{
return random(max * 100) / 100;
}