Error beim Reg. System

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
  • Hab eein Error udn ein Paar warnings bei Pawno hoffe ihr könnt mir helfen


    C:\Users\Marcel\Desktop\samp03csvr_R2-2_win32\gamemodes\Codemaster.pwn(69) : warning 217: loose indentationC:\Users\Marcel\Desktop\samp03csvr_R2-2_win32\gamemodes\Codemaster.pwn(82) : warning 217: loose indentationC:\Users\Marcel\Desktop\samp03csvr_R2-2_win32\gamemodes\Codemaster.pwn(266) : warning 202: number of arguments does not match definitionC:\Users\Marcel\Desktop\samp03csvr_R2-2_win32\gamemodes\Codemaster.pwn(318) : error 001: expected token: ",", but found ";"C:\Users\Marcel\Desktop\samp03csvr_R2-2_win32\gamemodes\Codemaster.pwn(370) : warning 217: loose indentationPawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


    1 Error.



    Die Zeilen:


    69 return 1;


    82 return 1;


    266 ShowPlayerDialog(playerid, DIALOG_REGISTER2, DIALOG_STYLE_LIST, "Männlich\r\nWeiblich", "OK", "Abbrechen");


    318 format(pw, sizeof(pw), "%s", dini_Get(path, "password");


    370 return 1;


    hoffe ihr könnt mir helfen


    mfg


  • #include <a_samp>
    #include <dini>


    #define DIALOG_REGISTER1 0
    #define DIALOG_REGISTER2 1
    #define DIALOG_REGISTER3 2
    #define DIALOG_REGISTER4 3
    #define DIALOG_LOGIN1 4
    #define DIALOG_NOPW1 5
    #define DIALOG_NOPW2 6
    #define DIALOG_WRONGPW 7


    enum Info
    {
    sex, // 0 = Männlich, 1 = Weiblich.
    age, // Das Alter
    logged, // Ob der Spieler eingeloggt ist.
    }


    new pInfo[MAX_PLAYERS][Info];




    public OnGameModeInit()
    {
    UsePlayerPedAnims();
    SetGameModeText("by Codemaster");
    AddPlayerClass(1,382.4046,-1860.1348,7.8359,87.9087,0,0,0,0,0,0);
    AddPlayerClass(0,382.4046,-1860.1348,7.8359,87.9087,0,0,0,0,0,0);
    AddPlayerClass(2,382.4046,-1860.1348,7.8359,87.9087,0,0,0,0,0,0);
    AddPlayerClass(3,382.4046,-1860.1348,7.8359,87.9087,0,0,0,0,0,0);
    AddPlayerClass(4,382.4046,-1860.1348,7.8359,87.9087,0,0,0,0,0,0);
    AddPlayerClass(299,382.4046,-1860.1348,7.8359,87.9087,0,0,0,0,0,0);
    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid,216.2658,-1861.1621,3.0452);
    SetPlayerFacingAngle(playerid,44.0221);
    SetPlayerCameraPos(playerid,209.6172,-1854.1028,3.2511);
    SetPlayerCameraLookAt(playerid,216.2658,-1861.1621,3.0452);
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    new pname[MAX_PLAYER_NAME], path[200];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(path, sizeof(path), "/spieler/%s.ini", pname);


    if(!dini_Exists(path))
    {
    // Wenn der Spieler nicht registriert ist:
    ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_INPUT, "Registrierung", "Geben Sie hier Ihr gewünschtes Passwort ein:", "OK", "Abbrechen");
    }
    else
    {
    // Wenn der Spieler registriert ist:
    ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_INPUT, "Login", "Geben Sie hier Ihr Passwort ein:", "OK", "Abbrechen");
    }


    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    new pname[MAX_PLAYER_NAME], path[200];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(path, sizeof(path), "/spieler/%s.ini", pname);


    dini_IntSet(path, "sex", pInfo[playerid][sex]);
    dini_IntSet(path, "age", pInfo[playerid][age]);


    pInfo[playerid][logged] = 0;
    return 1;
    }


    public OnPlayerSpawn(playerid)
    {
    return 1;
    }


    public OnPlayerDeath(playerid, killerid, reason)
    {
    return 1;
    }


    public OnVehicleSpawn(vehicleid)
    {
    return 1;
    }


    public OnVehicleDeath(vehicleid, killerid)
    {
    return 1;
    }


    public OnPlayerText(playerid, text[])
    {
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
    // Do something here
    return 1;
    }
    return 0;
    }


    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    return 1;
    }


    public OnPlayerExitVehicle(playerid, vehicleid)
    {
    return 1;
    }


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    return 1;
    }


    public OnPlayerEnterCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerLeaveCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerEnterRaceCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerLeaveRaceCheckpoint(playerid)
    {
    return 1;
    }


    public OnRconCommand(cmd[])
    {
    return 1;
    }


    public OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }


    public OnObjectMoved(objectid)
    {
    return 1;
    }


    public OnPlayerObjectMoved(playerid, objectid)
    {
    return 1;
    }


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    return 1;
    }


    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    return 1;
    }


    public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
    {
    return 1;
    }


    public OnVehicleRespray(playerid, vehicleid, color1, color2)
    {
    return 1;
    }


    public OnPlayerSelectedMenuRow(playerid, row)
    {
    return 1;
    }


    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }


    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
    {
    return 1;
    }


    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    return 1;
    }


    public OnRconLoginAttempt(ip[], password[], success)
    {
    return 1;
    }


    public OnPlayerUpdate(playerid)
    {
    return 1;
    }


    public OnPlayerStreamIn(playerid, forplayerid)
    {
    return 1;
    }


    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    new pname[MAX_PLAYER_NAME], path[200];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(path, sizeof(path), "/spieler/%s.ini", pname);


    switch(dialogid)
    {
    case DIALOG_REGISTER1:
    {
    if(!response)
    {
    Kick(playerid);
    }
    else
    {
    new pwlength = strlen(inputtext);
    if(pwlength > 0)
    {
    dini_Create(path); // Erstellt die .ini Datei
    dini_Set(path, "password", inputtext); // Schreibt das eingegebene Passwort in die .ini
    ShowPlayerDialog(playerid, DIALOG_REGISTER2, DIALOG_STYLE_LIST, "Männlich\r\nWeiblich", "OK", "Abbrechen");
    }
    else
    {
    ShowPlayerDialog(playerid, DIALOG_NOPW1, DIALOG_STYLE_MSGBOX, "Registrierung", "Sie müssen ein Passwort angeben!", "OK", "Abbrechen");
    }
    }
    }
    case DIALOG_REGISTER2:
    {
    if(!response)
    {
    dini_Remove(path); // .ini löschen, da der User die registrierung abgebrochen hat.
    Kick(playerid);
    }
    else
    {
    dini_IntSet(path, "sex", listitem); // Schreibt entweder 0 oder 1 in die .ini (0 = Männlich, 1 = Weiblich)
    ShowPlayerDialog(playerid, DIALOG_REGISTER3, DIALOG_STYLE_INPUT, "Registrierung", "Geben Sie hier Ihr Alter an: (z.B. 22):", "OK", "Abbrechen");
    }
    }
    case DIALOG_REGISTER3:
    {
    if(!response)
    {
    dini_Remove(path); // .ini löschen, da der User die registrierung abgebrochen hat.
    Kick(playerid);
    }
    else
    {
    dini_Set(path, "age", inputtext);
    ShowPlayerDialog(playerid, DIALOG_REGISTER4, DIALOG_STYLE_MSGBOX, "Registrierung", "Ihre Registrierung ist nun abgeschlossen!", "OK", "OK");
    }
    }
    case DIALOG_REGISTER4:
    {
    pInfo[playerid][sex] = dini_Int(path, "sex");
    pInfo[playerid][age] = dini_Int(path, "age");
    pInfo[playerid][logged] = 1;
    }
    case DIALOG_LOGIN1:
    {
    if(!response)
    {
    Kick(playerid);
    }
    else
    {
    new pwlength = strlen(inputtext);
    if(pwlength > 0)
    {
    new pw[200];
    format(pw, sizeof(pw), "%s", dini_Get(path, "password");
    if(strcmp(inputtext, pw) == 0) // Wenn das Passwort stimmt
    {
    pInfo[playerid][sex] = dini_Int(path, "sex");
    pInfo[playerid][age] = dini_Int(path, "age");
    pInfo[playerid][logged] = 1;
    }
    else
    {
    ShowPlayerDialog(playerid, DIALOG_WRONGPW, DIALOG_STYLE_MSGBOX, "Login", "Sie haben ein inkorrektes Passwort angegen!", "OK", "Abbrechen");
    }
    }
    else
    {
    ShowPlayerDialog(playerid, DIALOG_NOPW2, DIALOG_STYLE_MSGBOX, "Login", "Sie müssen ein Passwort angeben!", "OK", "Abbrechen");
    }
    }
    }
    case DIALOG_NOPW1: // Sollte das Passwort bei der Registrierung "Leer" sein:
    {
    if(!response)
    {
    Kick(playerid);
    }
    else
    {
    ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_INPUT, "Registrierung", "Geben Sie hier Ihr gewünschtes Passwort ein:", "OK", "Abbrechen");
    }
    }
    case DIALOG_NOPW2: // Sollte das Passwort beim Login "Leer" sein:
    {
    if(!response)
    {
    Kick(playerid);
    }
    else
    {
    ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_INPUT, "Login", "Geben Sie hier Ihr Passwort ein:", "OK", "Abbrechen");
    }
    }
    case DIALOG_WRONGPW:
    {
    if(!response)
    {
    Kick(playerid);
    }
    else
    {
    ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_INPUT, "Login", "Geben Sie hier Ihr Passwort ein:", "OK", "Abbrechen");
    }
    }
    }
    return 1;
    }


    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }

  • falsch eingerückt, außerdem ist es ein Warning.



    #pragma tabsize 0