[POMOC] FS

Započeo MosT_WanteD, Februar 09, 2011, 18:01:25 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

E ljudi nekako sam sredio fs lotoo i kako sad da ja u ovo ubacim da mi prije na 3 minute pise loto pocinje za 3 minute ak zelis uzeti listic kucaj /buyticket
#include <a_samp>

#define FILTERSCRIPT
#if defined FILTERSCRIPT

#define yellow 0xFFFF00AA
#define red 0xFF0000AA
#define green 0x33FF33AA
#pragma tabsize 0
new HaveTicket[MAX_PLAYERS];
new PlayerNumber[6][MAX_PLAYERS];
new Number[6];

forward TicketDraw();

public OnFilterScriptInit()
{
SetTimer("TicketDraw",300000, 1);
return 1;
}

#endif

public OnPlayerConnect(playerid)
{
HaveTicket[playerid] = 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/BuyTicket", cmdtext, true) == 0)
{
if(HaveTicket[playerid] == 1) return SendClientMessage(playerid, red, "Vec si kupio loto");
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, red, "Loto kosta 250$");

GivePlayerMoney(playerid, -250);
HaveTicket[playerid] = 1;
MakePlayerNumber(playerid);

new string[256];
format(string, sizeof(string), "Tvoji loto 6/49 brojevi su: %d, %d, %d, %d, %d, %d", PlayerNumber[0][playerid], PlayerNumber[1][playerid], PlayerNumber[2][playerid], PlayerNumber[3][playerid], PlayerNumber[4][playerid], PlayerNumber[5][playerid]);
SendClientMessage(playerid, yellow, string);
return 1;
}
if (strcmp("/MyTicket", cmdtext, true) == 0)
{
if(HaveTicket[playerid] == 0) return SendClientMessage(playerid, red, "Nemas loto");

new string[256];
format(string, sizeof(string), "Your Lotto 6/49 numbers are: %d, %d, %d, %d, %d, %d", PlayerNumber[0][playerid], PlayerNumber[1][playerid], PlayerNumber[2][playerid], PlayerNumber[3][playerid], PlayerNumber[4][playerid], PlayerNumber[5][playerid]);
SendClientMessage(playerid, yellow, string);
return 1;
}
if (strcmp("/LottoTest", cmdtext, true) == 0)
{
if(IsPlayerAdmin(playerid) == 0) return 0;

TicketDraw();
return 1;
}
return 0;
}

public TicketDraw()
{
MakeNumber();
new Winning[MAX_PLAYERS];

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(HaveTicket[i] == 1)
{
for(new n = 0; n < 6; n++)
{
if(PlayerNumber[0][i] == Number[n])
{
Winning[i]++;
}
if(PlayerNumber[1][i] == Number[n])
{
Winning[i]++;
}
if(PlayerNumber[2][i] == Number[n])
{
Winning[i]++;
}
if(PlayerNumber[3][i] == Number[n])
{
Winning[i]++;
}
if(PlayerNumber[4][i] == Number[n])
{
Winning[i]++;
}
if(PlayerNumber[5][i] == Number[n])
{
Winning[i]++;
}
}
new string[256];

SendClientMessage(i, green, "=== Lotto 6/47 ===");

format(string, sizeof(string), "Tvoji Lotto 6/49 brojevi: %d, %d, %d, %d, %d, %d", PlayerNumber[0][i], PlayerNumber[1][i], PlayerNumber[2][i], PlayerNumber[3][i], PlayerNumber[4][i], PlayerNumber[5][i]);
SendClientMessage(i, green, string);

format(string, sizeof(string), "Pobjednicki brojevi lota su: %d, %d, %d, %d, %d, %d", Number[0], Number[1], Number[2], Number[3], Number[4], Number[5]);
SendClientMessage(i, green, string);

if(Winning[i] == 0)
{
SendClientMessage(i, green, "You got 0 correct");
SendClientMessage(i, green, "Earnings: $0");
}
if(Winning[i] == 1)
{
SendClientMessage(i, green, "You got 1 correct");
SendClientMessage(i, green, "Earnings: $500");
GivePlayerMoney(i, 500);
}
if(Winning[i] == 2)
{
SendClientMessage(i, green, "You got 2 correct");
SendClientMessage(i, green, "Earnings: $2500");
GivePlayerMoney(i, 2500);
}
if(Winning[i] == 3)
{
SendClientMessage(i, green, "You got 3 correct");
SendClientMessage(i, green, "Earnings: $10000");
GivePlayerMoney(i, 10000);
}
if(Winning[i] == 4)
{
SendClientMessage(i, green, "You got 4 correct");
SendClientMessage(i, green, "Earnings: $100000");
GivePlayerMoney(i, 100000);
}
if(Winning[i] == 5)
{
SendClientMessage(i, green, "You got 5 correct");
SendClientMessage(i, green, "Earnings: $1000000");
GivePlayerMoney(i, 1000000);
}
if(Winning[i] == 6)
{
SendClientMessage(i, green, "You got 6 correct");
SendClientMessage(i, green, "Earnings: $50,000,000");
GivePlayerMoney(i, 50000000);
}
HaveTicket[i] = 0;
}
}
}

MakeNumber()
{
Number[0] = random(99);
Number[1] = random(99);
Number[2] = random(99);
Number[3] = random(99);
Number[4] = random(99);
Number[5] = random(99);
}

MakePlayerNumber(playerid)
{
PlayerNumber[0][playerid] = random(99);
PlayerNumber[1][playerid] = random(99);
PlayerNumber[2][playerid] = random(99);
PlayerNumber[3][playerid] = random(99);
PlayerNumber[4][playerid] = random(99);
PlayerNumber[5][playerid] = random(99);
}
Poslednja Izmena: Februar 09, 2011, 18:37:23 POSLE PODNE od gonss.pwn
LOL

Nemoze se napraviti to u FS mislim moze ali sa enum treba ti i tak ili PVarovi