SA-MP Forums Archive
[Tutorial] [TUT]Lotto script - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] [TUT]Lotto script (/showthread.php?tid=160025)

Pages: 1 2 3


Re: [TUT]Lotto script - [Cali]ChrOnic_T - 03.03.2012

Nice I may wanna use this


Re: [TUT]Lotto script - Ukko - 28.06.2012

Your tutorials rock, I'm using your object,mapicon,checkpoint streamer and this lottery script.
Soon your housesystem too =)


Re: [TUT]Lotto script - $$inSane - 29.06.2012

simple and nice tut!!!


Re: [TUT]Lotto script - Lordzy - 29.06.2012

Thanks man,nice tutorial.


Re: [TUT]Lotto script - HighPitchedVoice - 29.06.2012

Great script!


Re: [TUT]Lotto script - Sufrdude099 - 27.10.2012

Awesome script. Just one question though. How can I set the maximum lotto. Like say the lotto goes up from 15 million. How can I set a limit so that the lotto doesn't increase past, let's say 17 million.

And also, a problem I have having is that the current jackpot isn't shown unless I type /lotto. Plus if type /lotto without entering a number, I automatically buy lotto ticket 0.


FIXED - Sufrdude099 - 27.10.2012

OK guys. I figured it out. If you copy this script exactly, you will be able to use number 0 and you won't be able to use number 100. This is because PAWN thinks that when you state there are 100 numbers up for grabs, it thinks you mean for 0-99. I don't know if you can do anything but what I did was give 101 numbers instead of 100. Like so:

Код:
new Numbers[101]
Then to fix the problem where you can use 0 as a ticket number, I did this:

All this comes under dcmd_lotto(playerid, params[]).
Код:
if(Num == 0)
	{
		SendClientMessage(playerid,0xE21F1FFF, "You cannot use 0 or any other number over 100."); //This appears as a rule then
		return 1;
	}
Then you must the winning number settings. You must change the way it is chosen. Not exactly. You must simply add 1 if you have a 100 numbers.

Код:
new Lnum = random(101) + 1;
See? If you have 100 numbers. You just have to add one. But to watch out for certain problems like getting number 101 or 102, you"ll have to do this.

Код:
    new Lnum = random(101) + 1; //Picks a random number
    if(Lnum == 102) return Lnum = 102 - random(101);
    if(Lnum == 101) return Lnum = 102 - random(101);
    if(Lnum == 0) return Lnum = random(101)
There is a simpler way, but I'm too tired to write that tiny piece now so I'll write it in the morning.

EDIT: Ok, to continue with this, you don't need to add one at all.

Код:
new Lnum = random(100) + 1; //Picks a random number
That code above ^^^ is much cleaner. That never really needs editing. I was just so tired that I couldn't think right.


Re: [TUT]Lotto script - Dawood - 16.05.2015

Guys I Anyone Now i want AN script Script name When Cops Enter the checkpoint they will receive free cop refill like this 1 Vehicle 2 Armour 3 Haelth 4 Weapons can someone please give me the script with no error i reall finding this i need help please show me or give me


Re: [TUT]Lotto script - FernandoLight - 16.05.2015

Man you're a killer, nice one !


Re: [TUT]Lotto script - Konverse - 16.05.2015

I liked it but the server I've played have this kind of scripting in the server. But nice tutorial though


Re: [TUT]Lotto script - J0sh... - 16.05.2015

Quote:
Originally Posted by Konverse
View Post
I liked it but the server I've played have this kind of scripting in the server. But nice tutorial though
You made no sense. It's a 2010 tutorial...


Re: [TUT]Lotto script - Dawood - 17.05.2015

anyone?


Re: [TUT]Lotto script - Dawood - 18.05.2015

Quote:
Originally Posted by Luis-
View Post
You do realise your post has absolutely NOTHING to do with this thread?
Nope I Wanna Say To Him If he Want Please Edit His Script And make it more awesome and give some updates on it thats it


Re: [TUT]Lotto script - Luis- - 18.05.2015

It's only a tutorial, edit it yourself.


Re: [TUT]Lotto script - jamesbond007 - 18.05.2015

hahahha this thread is from 5 years ago... nice bump. i even posted on the first page

i dont think anyone even uses dcmd anymore?