[Tutorial] [TUT]Lotto script
#41

Nice I may wanna use this
Reply
#42

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

simple and nice tut!!!
Reply
#44

Thanks man,nice tutorial.
Reply
#45

Great script!
Reply
#46

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.
Reply
#47

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.
Reply
#48

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
Reply
#49

Man you're a killer, nice one !
Reply
#50

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

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...
Reply
#52

anyone?
Reply
#53

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
Reply
#54

It's only a tutorial, edit it yourself.
Reply
#55

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)