/stats Befehl Fehler ??

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
  • if (strcmp("/stats", cmdtext, true, 10) == 0)
    {
    new string[128], Name[MAX_PLAYER_NAME], Geld = GetPlayerMoney(playerid), Score = GetPlayerScore(playerid), Kills = GetPVarInt(playerid), Deaths = GetPVarInt(playerid), AdminLevel = GetPVarInt(playerid);
    GetPlayerName(playerid,Name,sizeof Name);
    format(string, sizeof(string), "[Stats von %s]\n Name: %s\n Geld: %d\n Score: %d\n Kills: %i\n Deaths: %i\n AdminLevel: %d", Name, Name, Geld, Score, Kills,Deaths, AdminLevel);
    ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"{FFFFFF}Stats",string,"OK","");
    return 1;
    }


    Stock SpielSpeichern



    dini_IntSet(Spielerdatei,"Kills",GetPVarInt(playerid,"Kills"));
    dini_IntSet(Spielerdatei,"Deaths",GetPVarInt(playerid,"Deaths"));



    Stock Register



    dini_IntSet(Spielerdatei,"Kills",0);
    dini_IntSet(Spielerdatei,"Deaths",0);



    Stock SpielerLaden



    SetPVarInt(playerid,"Kills",dini_Int(Spielerdatei,"Kills"));
    SetPVarInt(playerid,"Deaths",dini_Int(Spielerdatei,"Deaths"));


    Work
    Name
    Geld
    Score


    Not Work
    Kills
    Deaths
    AdminLevel


    Wie das ingame aus Sieht

  • Wenn du nichts aus den PVars ausliest, kann er auch nicht den Wert setzen, den du willst.:


    if (strcmp("/stats", cmdtext, true, 10) == 0)
    {
    new string[128],
    Name[MAX_PLAYER_NAME],
    Geld = GetPlayerMoney(playerid),
    Score = GetPlayerScore(playerid),
    Kills = GetPVarInt(playerid,"Kills"),
    Deaths = GetPVarInt(playerid,"Deaths"),
    AdminLevel = GetPVarInt(playerid,"Adminlevel");
    GetPlayerName(playerid,Name,sizeof Name);
    format(string, sizeof(string), "[Stats von %s]\n Name: %s\n Geld: %d\n Score: %d\n Kills: %i\n Deaths: %i\n AdminLevel: %d", Name, Name, Geld, Score, Kills,Deaths, AdminLevel);
    ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"{FFFFFF}Stats",string,"OK","");
    return 1;
    }

    Back to the roots!

  • Ist auch kein wunder oder?


    Zitat

    new string[128], Name[MAX_PLAYER_NAME], Geld = GetPlayerMoney(playerid), Score = GetPlayerScore(playerid), Kills = GetPVarInt(playerid), Deaths = GetPVarInt(playerid), AdminLevel = GetPVarInt(playerid);


    zu


    Zitat

    new string[128], Name[MAX_PLAYER_NAME], Geld = GetPlayerMoney(playerid), Score = GetPlayerScore(playerid), Kills = GetPVarInt(playerid,"Kills"), Deaths = GetPVarInt(playerid,"Deaths"), AdminLevel = GetPVarInt(playerid,"Adminlevel");