Playertopoint

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • 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;
    }

  • 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;
    }