Ich moechte , dass man nur bei bestimmten Punkt Lottolose kaufne kann.Klappt aber ned
if(strcmp(cmd, "/lotto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(3.0, playerid, 822.0106,2.1108,1004.17979) || PlayerToPoint(3.0, playerid, 830.7314,-0.2550,1004.1797) || PlayerToPoint(3.0, playerid, 833.4749,3.1363,1004.17970))
{
SendClientMessage(playerid, COLOR_GREY, "Du bist nicht im Wettbüro / Du bist an keine Lotto Automaten !");
return 1;
}
if(PlayerInfo[playerid][pLottoNr] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " You already have a Lottery Ticket !");
return 1;
}
if(GetPlayerMoney(playerid) < 1500)
{
SendClientMessage(playerid, COLOR_GREY, " You need $1500 for a Lottery Ticket !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE,"BENUTZE: /lotto [number]");
return 1;
}
new lottonr = strval(tmp);
if(lottonr < 1 || lottonr > 80) { SendClientMessage(playerid, COLOR_GREY, " Lottery Number not below 1 or above 80 !"); return 1; }
format(string, sizeof(string), "* You bought a Lottery Ticket with number: %d.", lottonr);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - 1500);
PlayerInfo[playerid][pLottoNr] = lottonr;
}
return 1;
}
-
-
jemand ne Lösung?
-
Wenn die Koordinaten im PlayerToPoint die des Wettbüros sind, sollte es so gehen
if(strcmp(cmd, "/lotto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(3.0, playerid, 822.0106,2.1108,1004.17979) || PlayerToPoint(3.0, playerid, 830.7314,-0.2550,1004.1797) || PlayerToPoint(3.0, playerid, 833.4749,3.1363,1004.17970))
{
if(PlayerInfo[playerid][pLottoNr] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " You already have a Lottery Ticket !");
return 1;
}
if(GetPlayerMoney(playerid) < 1500)
{
SendClientMessage(playerid, COLOR_GREY, " You need $1500 for a Lottery Ticket !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(tmp[0] == 0)
{
SendClientMessage(playerid, COLOR_WHITE,"BENUTZE: /lotto [number]");
return 1;
}
new lottonr = strval(tmp);
if(lottonr < 1 || lottonr > 80) { SendClientMessage(playerid, COLOR_GREY, " Lottery Number not below 1 or above 80 !"); return 1; }
format(string, sizeof(string), "* You bought a Lottery Ticket with number: %d.", lottonr);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - 1500);
PlayerInfo[playerid][pLottoNr] = lottonr;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du bist nicht im Wettbüro / Du bist an keine Lotto Automaten !");
return 1;
}
}
return 1;
} -
breadfish.de
Hat das Thema geschlossen.