26.11.2011, 15:56
What for do i need help:
- If i write /lotto it automaticly picks the number 0, but it shouldn't! It should say to pick one between 1 and 100!
Here the command
- If i write /lotto it automaticly picks the number 0, but it shouldn't! It should say to pick one between 1 and 100!
Here the command
pawn Код:
CMD:lotto(playerid, params[])
{
if(!strlen(params))
{
SCM(playerid, COLOR_GREEN, "Lotterie:");
SCM(playerid, COLOR_WHITE, "Wдhle eine Nummer zwischen 1 und 100 aus.");
new str[75];
format(str, sizeof(str), "Derzeitiger Jackpot: $%d", Jackpot);
SCM(playerid, COLOR_GREEN, str);
}
new Num = strval(params);
if(Numbers[Num] == 1)
{
new str[75];
format(str, sizeof(str), "Diese Nummer ist bereits vergeben!", Num);
SCM(playerid, COLOR_RED, str);
return 1;
}
if(GetPVarInt(playerid, "LottoNumber") != 0) return SCM(playerid, COLOR_GREY, "Du hast bereits einen Ticket!");
SetPVarInt(playerid, "LottoNumber", Num);
Numbers[Num] = 1;
GeldGeben(playerid, -TICKET_COST);
new str[75];
format(str, sizeof(str), "Ticket gekauft! Du hast die Nummer: %d.", Num);
SCM(playerid, COLOR_GOLD, str);
format(str, sizeof(str), "Eine Ziehung findet jede %d Minuten statt und die Gewinner werden angekьndigt. Derzeitiger Jackpot ist: $%d", LOTTO_DRAW, Jackpot);
Jackpot = Jackpot + LOTTO_JACKPOT;
SCM(playerid, COLOR_LIGHTGREEN, str);
return 1;
}