[FilterScript] [FS] Zinglish's Lotto Draw (source only)
#1

[FS] Zinglish's Lotto Draw (source only)
My new name is Zinglish btw
Source: Pastebin
What is it: A filterscript for RPG scripts (Also RPF scripts, like the one I'm working on). Creates a lotto draw, the numbers are randomly generated, and so is the cash prize
How do I use it: Open it up in pawno, and edit it to your liking.

Give credit where credit is needed if you're using this, and if you have edited it.

Features:
  • dcmd command /lotto [number] for players to play the lotto
  • Admin command /drawlotto to draw the lotto
  • No two player's chosen numbers can be the same
  • Random cash outs
  • Zinglish's GivePlayerCash and TakePlayerCash stocks
Known bugs:
cashStocks: When the player receives cash, the cash draw does not disappear, but still changes.
Reply
#2

Hey I like your script, but i have a problem
When i put /lotto a number, it says "Number has already been chosen"
That's all the other part works fine.
Reply
#3

How can all other parts work if you can't choose a number ...
Reply
#4

i mean the admin command to run the lotto works perfect but no the /lotto command to buy a number that's all.
Sorry I didn't express my self in good meaner.
Reply
#5

Sorry guys, when I wrote it, I wrote it then tested it, then added more code, then released it, checked now...There is a bug, working on it now...

EDIT: Fixed the bug (Just had to add one more check, didn't even have to add another line of code lol)
Reply
#6

Thanks I will try it out

Edit: Works Perfect on my gm thanks again Zinglish
Reply
#7

niiice
Reply
#8

HElp

new ValidNumber = 1;
new params[128];
dcmd(lotto,5,cmdtext);
dcmd_lotto(playerid, params[128])
{
if(sscanf(params,"i", chosenLottoNumber[playerid]))
{
SendClientMessage(playerid, COLOR_RED, "Usage: /lotto [number 1-50]");
SendClientMessage(playerid, COLOR_RED, "The lotto costs $200");
}
else if(chosenLottoNumber[playerid] < 1 || chosenLottoNumber[playerid] > 50)
{
SendClientMessage(playerid, COLOR_RED, "Number must be between 1 and 50");
}
else if(hasPlayedLotto[playerid] == 0)
{
if(GetPlayerMoney(playerid) < 200)
{
SendClientMessage(playerid, COLOR_RED, "You do not have the $200 to pay for the lotto ticket");
}
if(GetPlayerMoney(playerid) > 200)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(pLottoNumber[playerid] == pLottoNumber[i] && pLottoNumber[playerid] != pLottoNumber[playerid])
{
ValidNumber = 0;
}
}
if(ValidNumber == 1)
{

format(string, sizeof(string), "You have played the lotto with number %i on you ticket", chosenLottoNumber[playerid]);
SendClientMessage(playerid, COLOR_YELLOW, string);
TakePlayerCash(playerid, 200);
hasPlayedLotto[playerid] = 1;
pLottoNumber[playerid] = chosenLottoNumber[playerid];
}
if(ValidNumber == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "Number has already been chosen");
}
}
}
else if(hasPlayedLotto[playerid] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "You have already played the lotto");
}
return 1;
}


what is wrong
C:\Documents and Settings\onecorp\Рабочий стол\Архив WinRAR\lost13.pwn(1551) : error 017: undefined symbol "dcmd_lotto"
C:\Documents and Settings\onecorp\Рабочий стол\Архив WinRAR\lost13.pwn(1552) : error 017: undefined symbol "dcmd_lotto"
Reply
#9

how do i make it auto start lotto and auto drawlotto
Reply
#10

Great system! Thank you very much!
Reply
#11

This looks bugged? lol
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)