[Hilfe] /startlesson mit Geld

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 würde gerne /startlesson mit Geld machen , also damit man
    /startlesson (id) (betrag)
    ^
    -
    -
    genau so


    if(strcmp(cmd, "/startlesson", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "Benutze: /startlesson [playerid/PartOfName]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    format(string, sizeof(string), "* You've started %s's Lesson.",giveplayer);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "* Instructor %s has started your Lesson.",sendername);
    SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
    TakingLesson[giveplayerid] = 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Der Player ist offline !");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du bist kein Lehrer !");
    return 1;
    }
    }
    return 1;
    }

  • if(strcmp(cmd, "/startlesson", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "Benutze: /startlesson [playerid/PartOfName] [Betrag]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "Benutze: /startlesson [playerid/PartOfName] [Betrag]");
    return 1;
    }
    new Betrag = strval(tmp);
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    format(string, sizeof(string), "* You've started %s's Lesson.",giveplayer);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "* Instructor %s has started your Lesson.",sendername);
    SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
    TakingLesson[giveplayerid] = 1;
    GivePlayerMoney(giveplayerid, Betrag);
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Der Player ist offline !");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du bist kein Lehrer !");
    return 1;
    }
    }
    return 1;
    }


    So, müsste funktionieren. Betrügender Abwerber *hust* xD