[HILFE]/stats Behfehl

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
  • //Define
    #define DIALOG_STATS 6


    //Befehl
    if (strcmp("/stats", cmdtext, true, 10) == 0)
    {
    new string[128],rangname[20];
    switch(GetPVarInt(playerid,"Fraktion"))
    {
    case 0:{rangname="Zivilist";}
    case 1:{rangname="Terrorist";}
    }
    Name[MAX_PLAYER_NAME];
    Geld = GetPlayerMoney(playerid);
    Score = GetPlayerScore(playerid);
    Kills = GetPVarInt(playerid,"Kills");
    Deaths = GetPVarInt(playerid,"Deaths");
    Fraktion = GetPVarInt(playerid,"Fraktion");
    AdminLevel = GetPVarInt(playerid,"Adminlevel");
    GetPlayerName(playerid,Name,sizeof Name);
    format(string, sizeof(string), "{FFFFFF}Stats von {FF0000}%s\n{FFFFFF}\nName: %s\nGeld: %d\nScore: %d\nKills: %i\nDeaths: %i\nFraktion: %s\nAdminLevel: [%d]", Name, Name, Geld, Score, Kills, Deaths, Fraktion, AdminLevel);
    ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"{FFFFFF}Stats",string,"OK","");
    return 1;
    }



    //Fehler


    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(304) : error 017: undefined symbol "Name"
    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(304) : warning 215: expression has no effect
    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(304) : error 001: expected token: ";", but found "]"
    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(304) : error 029: invalid expression, assumed zero
    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(304) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Errors.

  • //EDIT



    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(305) : error 032: array index out of bounds (variable "Name")
    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(305) : warning 215: expression has no effect
    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(306) : error 017: undefined symbol "Geld"
    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(307) : error 017: undefined symbol "Score"
    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(308) : error 017: undefined symbol "Kills"
    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(309) : error 017: undefined symbol "Deaths"
    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(310) : error 017: undefined symbol "Fraktion"
    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(311) : error 017: undefined symbol "AdminLevel"
    C:\Users\Giuseppe\Desktop\MyServer\gamemodes\Test.pwn(313) : error 017: undefined symbol "Geld"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    8 Errors.


  • if (strcmp("/stats", cmdtext, true, 10) == 0)
    {
    new string[128],rangname[20];
    switch(GetPVarInt(playerid,"Fraktion"))
    {
    case 0:{rangname="Zivilist";}
    case 1:{rangname="Terrorist";}
    }
    Name[MAX_PLAYER_NAME];
    new Geld = GetPlayerMoney(playerid);
    new Score = GetPlayerScore(playerid);
    new Kills = GetPVarInt(playerid,"Kills");
    new Deaths = GetPVarInt(playerid,"Deaths");
    new Fraktion = GetPVarInt(playerid,"Fraktion");
    new AdminLevel = GetPVarInt(playerid,"Adminlevel");
    GetPlayerName(playerid,Name,sizeof Name);
    format(string, sizeof(string), "{FFFFFF}Stats von {FF0000}%s\n{FFFFFF}\nName: %s\nGeld: %d\nScore: %d\nKills: %i\nDeaths: %i\nFraktion: %s\nAdminLevel: [%d]", Name, Name, Geld, Score, Kills, Deaths, Fraktion, AdminLevel);
    ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"{FFFFFF}Stats",string,"OK","");
    return 1;
    }