Level um 1 erhöhen

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 möchte bei meinen /buylevel Befehl , dass er nach dem Kauf um 1 Level aufsteigt.
    Das ist mein Code.


    ocmd:buylevel(playerid,params[])
    {
    new string[128];
    format(string,sizeof(string),"Level: %i\nEXP: %i/%i\nGeld: %i$/%i$",SpielerInfo[playerid][sLevel],SpielerInfo[playerid][EXP],LevelEXP(playerid),GetPlayerMoney(playerid),LevelGD(playerid));
    ShowPlayerDialog(playerid,DIALOG_BUYLEVEL,DIALOG_STYLE_MSGBOX,"Mein Level",string,"Kaufen","Abbrechen");
    return 1;
    }
    Und hier habe ich halt das versucht, was aber nicht klappt -> SetPlayerScore(playerid,SpielerInfo[playerid][sLevel]+1);
    if(dialogid==DIALOG_BUYLEVEL)
    {
    if(response)
    {
    if(SpielerInfo[playerid][EXP]>=LevelEXP(playerid))
    {
    if(GetPlayerMoney(playerid)<LevelGD(playerid)) return SendClientMessage(playerid,Grey,"Du hast nicht genügend Geld vorhanden.");
    {
    SetPlayerScore(playerid,SpielerInfo[playerid][sLevel]+1);
    GivePlayerMoney(playerid,-LevelGD(playerid));
    SpielerInfo[playerid][EXP]=0;
    }
    }
    }
    else
    {


    }
    return 1;
    }
    stock LevelGD(playerid)
    {
    new LGD;
    if(GetPlayerScore(playerid) == 1) LGD = 8000;
    if(GetPlayerScore(playerid) == 2) LGD = 12000;
    if(GetPlayerScore(playerid) == 3) LGD = 16000;
    if(GetPlayerScore(playerid) == 4) LGD = 20000;
    if(GetPlayerScore(playerid) == 5) LGD = 24000;
    if(GetPlayerScore(playerid) == 6) LGD = 28000;
    if(GetPlayerScore(playerid) == 7) LGD = 32000;
    if(GetPlayerScore(playerid) == 8) LGD = 36000;
    if(GetPlayerScore(playerid) == 9) LGD = 40000;
    if(GetPlayerScore(playerid) == 10) LGD = 44000;
    if(GetPlayerScore(playerid) == 11) LGD = 60000;
    if(GetPlayerScore(playerid) == 12) LGD = 64000;
    if(GetPlayerScore(playerid) == 13) LGD = 68000;
    if(GetPlayerScore(playerid) == 14) LGD = 72000;
    if(GetPlayerScore(playerid) == 15) LGD = 76000;
    if(GetPlayerScore(playerid) == 16) LGD = 80000;
    if(GetPlayerScore(playerid) == 17) LGD = 84000;
    if(GetPlayerScore(playerid) == 18) LGD = 88000;
    if(GetPlayerScore(playerid) == 19) LGD = 92000;
    if(GetPlayerScore(playerid) == 20) LGD = 96000;
    if(GetPlayerScore(playerid) == 21) LGD = 100000;
    if(GetPlayerScore(playerid) == 22) LGD = 104000;
    if(GetPlayerScore(playerid) == 23) LGD = 108000;
    if(GetPlayerScore(playerid) == 24) LGD = 112000;
    if(GetPlayerScore(playerid) == 25) LGD = 118000;
    if(GetPlayerScore(playerid) == 26) LGD = 122000;
    if(GetPlayerScore(playerid) == 27) LGD = 126000;
    if(GetPlayerScore(playerid) == 28) LGD = 130000;
    if(GetPlayerScore(playerid) == 29) LGD = 134000;
    if(GetPlayerScore(playerid) == 30) LGD = 138000;
    return LGD;
    }


    stock LevelEXP(playerid)
    {
    new LEXP;
    if(GetPlayerScore(playerid) == 1) LEXP = 1000;
    if(GetPlayerScore(playerid) == 2) LEXP = 2000;
    if(GetPlayerScore(playerid) == 3) LEXP = 4000;
    if(GetPlayerScore(playerid) == 4) LEXP = 8000;
    if(GetPlayerScore(playerid) == 5) LEXP = 12000;
    if(GetPlayerScore(playerid) == 6) LEXP = 16000;
    if(GetPlayerScore(playerid) == 7) LEXP = 20000;
    if(GetPlayerScore(playerid) == 8) LEXP = 24000;
    if(GetPlayerScore(playerid) == 9) LEXP = 28000;
    if(GetPlayerScore(playerid) == 10) LEXP = 32000;
    if(GetPlayerScore(playerid) == 11) LEXP = 36000;
    if(GetPlayerScore(playerid) == 12) LEXP = 40000;
    if(GetPlayerScore(playerid) == 13) LEXP = 44000;
    if(GetPlayerScore(playerid) == 14) LEXP = 48000;
    if(GetPlayerScore(playerid) == 15) LEXP = 52000;
    if(GetPlayerScore(playerid) == 16) LEXP = 56000;
    if(GetPlayerScore(playerid) == 17) LEXP = 60000;
    if(GetPlayerScore(playerid) == 18) LEXP = 64000;
    if(GetPlayerScore(playerid) == 19) LEXP = 68000;
    if(GetPlayerScore(playerid) == 20) LEXP = 72000;
    if(GetPlayerScore(playerid) == 21) LEXP = 76000;
    if(GetPlayerScore(playerid) == 22) LEXP = 80000;
    if(GetPlayerScore(playerid) == 23) LEXP = 84000;
    if(GetPlayerScore(playerid) == 24) LEXP = 88000;
    if(GetPlayerScore(playerid) == 25) LEXP = 92000;
    if(GetPlayerScore(playerid) == 26) LEXP = 96000;
    if(GetPlayerScore(playerid) == 27) LEXP = 100000;
    if(GetPlayerScore(playerid) == 28) LEXP = 104000;
    if(GetPlayerScore(playerid) == 29) LEXP = 108000;
    if(GetPlayerScore(playerid) == 30) LEXP = 112000;
    return LEXP;
    }
    MfG Tiger